From 9bd65560a5210f725222b2878935be72049ea1eb Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 2 Sep 2014 06:10:38 -0700 Subject: [PATCH] mu4e: make including dates in drafts optional (and disabled by default) Add new configuration variable `mu4e-compose-auto-include-date'. --- mu4e/mu4e-draft.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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: "