This allows to re-tag a message in a mark action.
Two examples of what one can do with this stuff:
1. G-mail archiving:
(archive
:char "a"
:prompt "archive"
:show-target (lambda (target) "archive")
:action (lambda (docid msg target)
(mu4e~proc-move docid nil "-N")
(mu4e-action-retag-message msg "-\\Inbox")))
2. Tagging:
(tag
:char "g"
:prompt "gtag"
:ask-target (lambda () (read-string "What tag do you want to add?"))
:show-target (lambda (target) target)
:action (lambda (docid msg target)
(mu4e~proc-move docid nil "-N")
(mu4e-action-retag-message msg (concat "+" target))))
:get-target is split into:
- :ask-target (run once per bulk operation)
- :dyn-target (run once per message)
A side benefit is that the existence of the target of a move is not
checked for every message when doing bulk moves.
This is a bug fix. Previously, recomputing was done only for refile,
which is wrong: trash target can also be dynamic, and we want to allow
the user to configure more dynamic targets.
This commit puts all what defines a mark (how to display, how to handle
targets, what action to apply, ...) in a single entry of a list. The list
is stored in a variable.
This should allow for customization of marks.
Now, mark commands with region on headers view,
target of the first email is reflected in the rest of email.
```
Date From Subject
--------------------------------------------
2012-12-05 Github ...
2012-12-05 Yahoo! ...
2012-12-05 Work ...
refiling to
Date From Subject
--------------------------------------------
r -> /github 2012-12-05 Github ...
r -> /github 2012-12-05 Yahoo! ...
r -> /github 2012-12-05 Work ...
```
In this patch, change target in region email.
```
Date From Subject
--------------------------------------------
r -> /github 2012-12-05 Github ...
r -> /yahoo 2012-12-05 Yahoo! ...
r -> /work 2012-12-05 Work ...
```
The first sentence should summarize the variable's or function's
purpose and it should fit on the first line. Change existing
doc-string by:
* Move first sentence onto first line even if that makes it _a bit_
long.
* Move additional notes out of first sentence and add them later,
possibly as complete sentences.
* If I am uncertain whether doing the above would alter the meaning,
_don't_ do it.
* If fitting the initial sentence on the first line would require a
complete rewrite of the doc-string _don't_ do so unless it is very
easy to do.
* Remove indentation from second and later lines if it is there to
align them with the first in the source code, instead of in
`describe-*' output.
* Make "pullet point" lists a bit more consistent.
Obviously this does not fix all problems but it's a start.