Allow setting a policy about what context to choose when starting mu4e
and composing a message. Basically:
When you have defined contexts and you start mu4e it decides which
context to use based on the variable `mu4e-context-policy';
similarly, when you compose a new message, the context is determined
using `mu4e-compose-context-policy'.
These policies can be one of the following:
- a symbol always-ask: unconditionally ask the user what context to pick
The other choices only apply if none of the context matches (i.e., if
none of the contexts' match-functions returns t:
- symbol ask: ask the user
- a symbol pick-first: pick the first context
- nil: don't change the context
Update mu4e-context-switch to not call the enter/leave functions when
'changing' to the current context. However, calling those functions (if
defined) can be force through a prefix arg. Document this.
Make mu4e-context-determine recognize 'policies', i.e. what to do when
no context matches. This part is WIP.
Since the environment (and settings) can change, default to
re-calculating the maildirs when we need them. When you have so many
maildirs that this is slow, you can set mu4e-cache-maildir-list to
t (but be sure to read the docstring).
Make `global-mode-string' local in all buffers where we use it, so we
don't leak the "context" string outside mu4e.
Also add the context string to the compose buffer's modeline.
This fixes#740.
When contexts have been defined, automatically select one at startup --
either the first whose match-function returns non-nil, or simply the
first one.
Document this, too.
Doing:
!access(...) == 0
Is equivalent to:
(!access(...)) == 0
Not:
!(access(...) == 0)
And throws this warning under clang:
mu-store.cc:77:6: warning: logical not is only applied to the left hand
side of this comparison [-Wlogical-not-parentheses]
if (!access(xpath, F_OK) == 0) {
^ ~~
mu-store.cc:77:6: note: add parentheses after the '!' to evaluate the
comparison first
if (!access(xpath, F_OK) == 0) {
^
( )
mu-store.cc:77:6: note: add parentheses around left hand side expression
to silence this warning
if (!access(xpath, F_OK) == 0) {
^
( )
It ends up doing what the author intended anyway since access() returns
-1 on error, and !-1 == 0, but just do the more obvious check and check
that we don't get 0 here with !=.
Let's not spam the poor sods who own foo.com and bar.com, or home.com
etc. Went through the various examples and changed them to use
example.com or subdomains of example.com where appropriate, even when
the domain or TLD didn't exist (yet!) for completeness.
See-Also: https://tools.ietf.org/html/rfc2606
Define mu4e-context - a structure with settings and enter/leave
functions for contexts, and some functions for switching between
contexts and auto-detecting them.