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

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

Open
dcolascione opened this issue Jan 5, 2025 · 1 comment
Open

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

dcolascione opened this issue Jan 5, 2025 · 1 comment
Labels

Comments

@dcolascione
Copy link
Contributor

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.

@djcb
Copy link
Owner

djcb commented Jan 15, 2025

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 djcb removed the new label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants