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

[mu4e rfe] Multiple marks per message (e.g. mark-as-read and mark-for-refile, executed at once) #2671

Open
alphapapa opened this issue Mar 26, 2024 · 1 comment
Labels
mu4e specific for mu4e rfe

Comments

@alphapapa
Copy link
Contributor

alphapapa commented Mar 26, 2024

Is your feature request related to a problem? Please describe.

My workflow for processing incoming mail is that, for most mail, I do two things: mark as read and refile/archive. mu4e seems to only allow each message to be marked for one action at a time, so to mark a single message as read and archive it, I have to: 1) mark it as read, 2) execute marks, 3) find the message again, 4) mark it for refiling, 5) execute marks.

Describe the solution you'd like

I'd like to be able to mark a message for multiple actions. Then I could: 1) mark as read, 2) mark for refiling, 3) execute marks. (Compare with, e.g. Thunderbird, in which I can press m a f on a single message to Mark it as read, Archive it, and Flag it for later action. With mu4e, each marking and flagging requires the extra step of executing marks before the next can be done.)

This would be especially useful when acting on multiple messages at once.

Describe alternatives you've considered

The alternative would seem to require me to either implement a custom flag that does multiple actions (which seems unnatural, since both actions already exist independently), or to implement a custom marking system that is separate from mu4e's.

Additional context

FWIW, I'm working on an alternative UI that uses Taxy and magit-section to provide programmable grouping of emails. This makes it especially easy to act on groups of messages at once, which has allowed me to process years of old mail in mere minutes.

Thanks to mu4e's flexible design, it took surprisingly little code to override the mu4e-headers view with my alternative one. See https://github.com/alphapapa/emu.el/blob/master/emu.el if you're interested. Here's a screenshot:

example

Thanks very much for your work on mu4e. It's allowed me to put together the most powerful email UI I've ever seen. :)

@alphapapa alphapapa added mu4e specific for mu4e new rfe labels Mar 26, 2024
@alphapapa alphapapa changed the title [mu4e rfe] Multiple marks per message (e.g. mark-as-read and mark-for-refile executed at once) [mu4e rfe] Multiple marks per message (e.g. mark-as-read and mark-for-refile, executed at once) Mar 26, 2024
@alphapapa
Copy link
Contributor Author

FWIW, I did read the mu4e manual. ;) So I've implemented this for my own needs:

(progn
    ;; Marking as read and archiving with a single flag.
    (add-to-list 'mu4e-marks
                 '(read-and-archive
                   :char       ("A" . "🗹")
                   :prompt     "read-and-archive"
                   :dyn-target (lambda (target msg) (mu4e-get-refile-folder msg))
                   :action      (lambda (docid msg target)
                                  (mu4e--server-move docid nil "+S-u-N")
                                  (mu4e--server-move docid (mu4e--mark-check-target target) "-N"))))
    
    (defun ap/mu4e-mark-read-and-archive ()
      "Mark the message as read and archive it."
      (interactive)
      (mu4e-headers-mark-and-next 'read-and-archive))

    ;; NOTE: This only binds it for `emu-headers-mode', not for `mu4e-headers-mode'.
    (define-key emu-headers-mode-map (kbd "A") (emu-define-mark-command ap/mu4e-mark-read-and-archive)))

But in general, since actions like marking messages as read and refiling them is done with marks and batch actions, it seems like it would be very helpful if mu4e supported multiple marks per message (otherwise common actions like marking as read and refiling require multiple "executions"--unless I'm missing something obvious?).

@djcb djcb removed the new label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mu4e specific for mu4e rfe
Projects
None yet
Development

No branches or pull requests

2 participants