mu4e: make including dates in drafts optional (and disabled by default)

Add new configuration variable `mu4e-compose-auto-include-date'.
This commit is contained in:
djcb 2014-09-02 06:10:38 -07:00
parent 003b7a7b7a
commit 9bd65560a5
1 changed files with 9 additions and 5 deletions

View File

@ -67,6 +67,12 @@ messages (if it is set)."
:type 'boolean
:group 'mu4e-compose)
(defcustom mu4e-compose-auto-include-date nil
"Whether to include a date header when starting to draft a
message; if nil, only do so when sending the message."
:type 'boolean
:group 'mu4e-compose)
(defun mu4e~draft-user-agent-construct ()
"Return the User-Agent string for mu4e.
This is either the value of `mu4e-user-agent', or, if not set, a
@ -300,14 +306,12 @@ You can append flags."
(format "%s-%02x%04x-%s:2,%s"
(format-time-string "%Y%m%d" (current-time))
(random 255) (random 65535) hostname (or flagstr ""))))
;; New
;; Automatically add a date to new drafts, so one can
;; sort drafts by date.
(defun mu4e~draft-common-construct ()
"Construct the common headers for each message."
(mu4e~draft-header "User-agent" (mu4e~draft-user-agent-construct))
(mu4e~draft-header "Date" (message-make-date)))
(when mu4e-compose-auto-include-date
(mu4e~draft-header "Date" (message-make-date))))
(defconst mu4e~draft-reply-prefix "Re: "