Let’s see what’s contained in a context. Most of it is optional.
A mu4e-context is a Lisp object with the following members:
name: the name of the context, e.g. work or private.
In the default completion UI, mu4e uses the first letter of the context
to select them, so you should ensure all start with a different letter
vars:
an association-list (alist) of variable settings for this account.
enter-func:
an (optional) function that takes no parameter and is invoked when entering
the context. You can use this for extra setup etc.
leave-func:
an (optional) function that takes no parameter and is invoked when leaving
the context. You can use this for cleaning things up.
match-func:
an (optional) function that takes an MSG message plist as argument,
and returns non-nil if this context matches the situation. mu4e
uses the first context that matches, in a couple of situations:
mu4e to determine the
starting context; in this case, MSG is nil. You can use e.g. the host name
or the time of day to determine which context matches.
nil when
composing a brand new message. The function should return t when
this context is the right one for this message, or nil otherwise.
mu4e uses a variable mu4e-contexts, which is a list of such
objects.