mu icon indicating copy to clipboard operation
mu copied to clipboard

[RFE] G keybinding unifying C-c C-u, U, and g

Open dcolascione opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I set mu4e-headers-auto-update to nil, so if I'm in the header list and waiting for a message to arrive, I have to hit C-c C-u to run mu4e-update-mail-and-index, then hit g to run mu4e-search-rerun to actually see any new mail that's arrived. This two step process is annoying.

Also, C-c C-u is an annoying keybinding. The more ergonomic U doesn't DWIM in the header view.

Describe the solution you'd like I'd like to add a new G (i.e. S-g) keybinding to all of the mu4e main view, the header view, and the message view. We can define it to

  1. do the same thing as mu4e-update-mail-and-index, and also, when that's done,
  2. mu4e-search-rerun.

With prefix, we'd run in the background.

IOW, G would temporarily enable mu4e-headers-auto-update for one call to mu4e-update-mail-and-index.

G seems to be unused in all three modes, so we get one nice uniform interface to "check your email" in a DWIM way no matter where in mu4e you are and no matter your default setting of mu4e-headers-auto-update.

Describe alternatives you've considered

  • Turning on mu4e-headers-auto-update isn't an option because it's even more annoying for the header list to appear to change unbidden.

  • Defining keyboard macro for C-c C-u then g would work, but wouldn't let me run the refresh in the background.

  • We could add another value to mu4e-headers-auto-update that would have mu4e update the header list only when no window is showing it (addressing the previous point), but doing so wouldn't quite solve my problem.

dcolascione avatar Jan 05 '25 22:01 dcolascione

I'm a bit hesitant to add (more) very special-casy code to mu4e, but I think you could add a command, something like:

(defun my-update-and-index ()
  (interactive)
  (setq mu4e-headers-auto-update t)
  (mu4e-update-mail-and-index)) 

and then append something to mu4e-index-updated-hook (must be last) that resets mu4e-headers-auto-update. You can get fancier, of course.

You can bind the command to your favorite key.

djcb avatar Jan 15 '25 10:01 djcb

I also bind G to mu4e-update-mail-and-index, and then manually update the header view with g. So I agree with this suggested key change.

taingra avatar Dec 20 '25 01:12 taingra