mu4e: context policy tweaking

As discussed in issue #751, mu4e should tried to accommodate some
different ways of choosing the context.

We add a new policy `ask-if-none', that will only query the user if
there is no context yet; this is the new default for
mu4e-context-policy, i.e. what happens when entering the main view.

The default policy for mu4e-compose-context-policy is now `ask',
i.e. ask if none of the contexts match.

The idea is for the defaults to ask when we don't know a context, and we
can't determine one using the match functions; this is probably the
least confusing. When user gets annoyed by too many question, they can
tweak the behavior to their liking. I.e. 'ask questions first, shoot
later'

Document all of this.
This commit is contained in:
djcb
2016-01-03 13:29:19 +02:00
parent 8e43e8cac3
commit b373f8e5f0
5 changed files with 150 additions and 113 deletions

View File

@ -279,7 +279,7 @@ never hits the disk. Also see `mu4e~draft-insert-mail-header-separator."
(replace-match "")))))
(defun mu4e~draft-user-wants-reply-all (origmsg)
(defun mu4e~draft-reply-all-p (origmsg)
"Ask user whether she wants to reply to *all* recipients.
If there is just one recipient of ORIGMSG do nothing."
(let* ((recipnum
@ -315,11 +315,10 @@ You can append flags."
(defun mu4e~draft-common-construct ()
"Construct the common headers for each message."
(concat
(mu4e~draft-header "User-agent" mu4e-user-agent-string)
(mu4e~draft-header "User-agent" mu4e-user-agent-string)
(when mu4e-compose-auto-include-date
(mu4e~draft-header "Date" (message-make-date)))))
(defconst mu4e~draft-reply-prefix "Re: "
"String to prefix replies with.")
@ -332,7 +331,7 @@ fields will be the same as in the original."
(+ (length (mu4e~draft-create-to-lst origmsg))
(length (mu4e~draft-create-cc-lst origmsg t))))
;; reply-to-self implies reply-all
(reply-all (or reply-to-self (mu4e~draft-user-wants-reply-all origmsg)))
(reply-all (or reply-to-self (mu4e~draft-reply-all-p origmsg)))
(old-msgid (plist-get origmsg :message-id))
(subject
(concat mu4e~draft-reply-prefix