Single-window mode is meant to minimize mu4e window operations (opening,
killing, resizing, etc) and buffer changes, while still retaining the
view and headers buffers. In addition, it replaces mu4e main view with a
minibuffer prompt containing the same information.
Ensure we the marks get counted correctly outside the headers view. This
avoids mu4e trying to refresh the headers buffer when we're reading a
message.
Right now we have this for showing the status of messages, e.g. whether
it has an attachment etc. But not for the "d", "D" etc. in the leftmost
column of the headers view.
This adds support for that, while bending over backwards to ensure that
anyone who's customized this in the past won't have their customizations
broken, i.e. like `mu4e-headers-trashed-mark` we can set this to a cons
cell of basic/fancy characters, but we also continue to support this
just being a string for existing users.
The next patch in this series adds a couple of non-ASCII characters to
be used for the trash / delete mark.
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.