[mu4e bug] Current header marked incorrectly, when switch-to-buffer-obey-display-actions is set
Describe the bug
When the init files contains the setting (setq switch-to-buffer-obey-display-actions t) the current message header is not correctly highlighted, after pressing 'n' or 'p' in the message view.
How to Reproduce
- Eval (setq switch-to-buffer-obey-display-actions t)
- Open mu4e
- Select any message
- In message view type 'n' or 'p' to display the next or previous message
The current header is then set twice. Once to the correct message and then to the first message instead.
Environment Emacs 28.1 on Linux, mu4e 1.8.9
Checklist
- [x ] you are running either the latest 1.6.x release, or a 1.8.x release (otherwise, please upgrade)
- [x ] you are running mu4e without any third-party extensions (otherwise, make sure you can reproduce without those)
- [x ] you have read all of the above
Never used that option, but suspect that simply might be incompatible with what mu4e does. So perhaps for now I'd say "don't do that".
So, this means I can either use mu4e or use display-buffer-alist to organize my buffer display, which is rather disappointing. From my point of view additional packages should strive to work with all standard Emacs features. Mickey Petersen has recommended this approach to handle display-buffer-alist in his article.
No need to be disappointed, you can help if you can give an analysis about what this option is expecting and what mu4e is doing; it seems it depends on some unwritten rule, but I have no idea.
For the record, this is the setting that also causes the issue asked about here: "mu4e-headers sometimes selects the wrong email" : https://groups.google.com/g/mu-discuss/c/z94akIoAyg8 .
For completeness I am copying the steps I follow:
Suppose we have three accounts, call them A, B, C (and we have (setq switch-to-buffer-obey-display-actions t) ) . The following shows the problem:
-
Start mu4e
-
j (mu4e~headers-jump-to-maildir) to maildir A
-
C (mu4e-compose-new) with account B; in my case, it asks for the context and I choose context B. You can abort it (e.g., kill the draft buffer) or send it
-
j to maildir B or C
-
Open any email. Close it (q). The cursor is generally on the top one on the mu4e-headers list, not in the one you just opened.
As for why I set switch-to-buffer-obey-display-actions to t: I do it by default in my init.el to force even misbehaving commands (not from mu4e, but from other packages) to obey the rules I set in display-buffer-a-list. (This is my understanding from, for example, https://www.masteringemacs.org/article/demystifying-emacs-window-manager , the same article referenced by @martin5233 ).
For now, I am setting (setq switch-to-buffer-obey-display-actions nil) in the Emacs instance that is running mu4e and that solves the issue.
Is this still a problem with the new window-management code (which was contributed by @mickeynp mentioned here)?
Thanks for the fixes. But, yes, at least for me the problem remains (meaning if I follow the steps in https://github.com/djcb/mu/issues/2338#issuecomment-1328055845 the same thing happens).
Can't reproduce the problem with master. Can you, @martin5233 or @rdiaz02 ?
I can't reproduce either. Thanks a lot!
Great, thanks. Closing this (I think this was fixed as the side-effect of something else)