X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=33f139987e659135cb2aeb29767144455a26429e;hp=bf6253fc4669638da27b934063deb0fe035c75f9;hb=2bbe5e034db4d982a754e481e7a59a0a4d886e44;hpb=30a0ed197efae461912138fb4e5f70849124fee3 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index bf6253fc..33f13998 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -75,6 +75,22 @@ list." :type '(repeat string) :group 'notmuch-send) +(defgroup notmuch-reply nil + "Replying to messages in notmuch" + :group 'notmuch) + +(defcustom notmuch-mua-cite-function 'message-cite-original + "*Function for citing an original message. +Predefined functions include `message-cite-original' and +`message-cite-original-without-signature'. +Note that these functions use `mail-citation-hook' if that is non-nil." + :type '(radio (function-item message-cite-original) + (function-item message-cite-original-without-signature) + (function-item sc-cite-original) + (function :tag "Other")) + :link '(custom-manual "(message)Insertion Variables") + :group 'notmuch-reply) + ;; (defun notmuch-mua-get-switch-function () @@ -116,10 +132,9 @@ list." notmuch-mua-hidden-headers)) (defun notmuch-mua-reply-crypto (parts) + "Add mml sign-encrypt flag if any part of original message is encrypted." (loop for part in parts - if (notmuch-match-content-type (plist-get part :content-type) "multipart/signed") - do (mml-secure-message-sign) - else if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted") + if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted") do (mml-secure-message-sign-encrypt) else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*") do (notmuch-mua-reply-crypto (plist-get part :content)))) @@ -221,8 +236,9 @@ list." (date (plist-get original-headers :Date)) (start (point))) - ;; message-cite-original constructs a citation line based on the From and Date - ;; headers of the original message, which are assumed to be in the buffer. + ;; notmuch-mua-cite-function constructs a citation line based + ;; on the From and Date headers of the original message, which + ;; are assumed to be in the buffer. (insert "From: " from "\n") (insert "Date: " date "\n\n") @@ -234,9 +250,9 @@ list." (set-mark (point)) (goto-char start) ;; Quote the original message according to the user's configured style. - (message-cite-original))) + (funcall notmuch-mua-cite-function))) - ;; Sign and/or encrypt replies to signed and/or encrypted messages. + ;; Crypto processing based crypto content of the original message (when process-crypto (notmuch-mua-reply-crypto (plist-get original :body)))) @@ -347,7 +363,8 @@ the From: address first." (message-forward-make-body cur) ;; `message-forward-make-body' shows the User-agent header. Hide ;; it again. - (message-hide-headers))) + (message-hide-headers) + (set-buffer-modified-p nil))) (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all) "Compose a reply to the message identified by QUERY-STRING.