mu icon indicating copy to clipboard operation
mu copied to clipboard

[mu4e bug] Current header marked incorrectly, when switch-to-buffer-obey-display-actions is set

Open martin5233 opened this issue 3 years ago • 3 comments

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

  1. Eval (setq switch-to-buffer-obey-display-actions t)
  2. Open mu4e
  3. Select any message
  4. 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

martin5233 avatar Sep 22 '22 11:09 martin5233

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".

djcb avatar Oct 07 '22 08:10 djcb

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.

martin5233 avatar Oct 07 '22 10:10 martin5233

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.

djcb avatar Oct 14 '22 23:10 djcb

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:

  1. Start mu4e

  2. j (mu4e~headers-jump-to-maildir) to maildir A

  3. 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

  4. j to maildir B or C

  5. 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.

rdiaz02 avatar Nov 26 '22 14:11 rdiaz02

Is this still a problem with the new window-management code (which was contributed by @mickeynp mentioned here)?

djcb avatar Dec 30 '22 13:12 djcb

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).

rdiaz02 avatar Dec 31 '22 13:12 rdiaz02

Can't reproduce the problem with master. Can you, @martin5233 or @rdiaz02 ?

djcb avatar Jan 20 '23 13:01 djcb

I can't reproduce either. Thanks a lot!

rdiaz02 avatar Jan 21 '23 23:01 rdiaz02

Great, thanks. Closing this (I think this was fixed as the side-effect of something else)

djcb avatar Jan 22 '23 06:01 djcb