Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seems to interfere with mu4e #55

Closed
danielgoldin opened this issue Mar 26, 2024 · 7 comments
Closed

seems to interfere with mu4e #55

danielgoldin opened this issue Mar 26, 2024 · 7 comments
Assignees

Comments

@danielgoldin
Copy link

I'm a non programmer who uses emacs on linux for academic papers. When I run mu4e under an activity, the index area gets periodically taken over by a pop-up message "appease-gnus. I'm really loving activities, but I also love using emacs for email. Thanks for any help.

@alphapapa
Copy link
Owner

Hi Daniel,

Thanks for the report. Please provide a screenshot so I can understand what you mean.

@alphapapa
Copy link
Owner

I was linked by another user to:

After some digging, I see the problem now:

  • https://github.com/djcb/mu/blob/3caa04fc2b5547611bb88022cb2aba0cc29bb894/mu4e/mu4e-view.el#L711 makes a fake summary buffer to appease Gnus's expectation that the summary buffer exists when https://github.com/djcb/mu/blob/3caa04fc2b5547611bb88022cb2aba0cc29bb894/mu4e/mu4e-view.el#L731 calls gnus-article-prepare-display. It sets gnus-summary-buffer to that buffer.
  • gnus-article-prepare-display puts the message rendering buffer into gnus-article-mode, which sets the buffer's bookmark-make-record-function to gnus-summary-bookmark-make-record.
  • When gnus-summary-bookmark-make-record is called, it calls gnus-article-show-summary, which, as the comment says, "Go[es] back in summary buffer" (apparently then calling (gnus-configure-windows 'article), which changes the window configuration accordingly).
  • Dogears and Activities work by bookmarking the currently displayed buffers. So whenever Dogears and Activities save bookmarks for a window configuration's buffers, and one of those buffers is one displaying a message rendered by mu4e--view-render-buffer, gnus-summary-bookmark-make-record makes the "appease" buffer visible.

It's hard to blame mu4e for doing this, as it was (and probably still is) necessary to appease Gnus's internal functions to reuse them this way.

AFAICT the simplest fix would be for mu4e--view-render-buffer to do something like (kill-local-variable 'bookmark-make-record-function) after rendering the message, which would prevent the gnus-summary-bookmark-make-record from being called.

This would generally be a correct thing to do, regardless of packages like Dogears and Activities triggering the problem, because the message buffer can't be bookmarked correctly, anyway (e.g. if the user did C-x r m, it would also trigger the problem, and the bookmark wouldn't work).

In the meantime, this workaround will probably do:

(define-advice mu4e--view-render-buffer (:after (&rest _) unset-bookmark-make-record-function)
  (kill-local-variable 'bookmark-make-record-function))

alphapapa added a commit to alphapapa/mu that referenced this issue Mar 27, 2024
The function 'gnus-summary-bookmark-make-record' does not work properly with the
faux "appeasement" summary buffer, causing undesired changes in the window
configuration when the message rendering buffer's bookmark function is
called (which some packages, like Activities, Burly, and Dogears do routinely).

See <alphapapa/activities.el#55>.

Reported-by: Daniel Goldin <https://github.com/danielgoldin>
@danielgoldin
Copy link
Author

danielgoldin commented Mar 27, 2024 via email

@alphapapa alphapapa self-assigned this Mar 28, 2024
@shrysr
Copy link

shrysr commented Apr 9, 2024

Thank you for the fix! fwiw - I wanted to add that this works for me as well.

@alphapapa
Copy link
Owner

Thanks. Can anyone confirm whether the advice workaround is still needed for mu 1.12.3? I ask because a different fix was applied to that branch of mu, and I don't know if it also fixes this problem.

djcb pushed a commit to djcb/mu that referenced this issue Apr 10, 2024
The function 'gnus-summary-bookmark-make-record' does not work properly with the
faux "appeasement" summary buffer, causing undesired changes in the window
configuration when the message rendering buffer's bookmark function is
called (which some packages, like Activities, Burly, and Dogears do routinely).

See <alphapapa/activities.el#55>.

Reported-by: Daniel Goldin <https://github.com/danielgoldin>
@shrysr
Copy link

shrysr commented Apr 18, 2024 via email

@alphapapa
Copy link
Owner

@shrysr

I upgraded to 1.12.4 (via homebrew) and without the advice workaround. The issue did not occur.

Great, thank you for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants