diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index 94000208..c97b191e 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -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: "