X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=60801f4be7d331269a578599c00abc2c0cc5c831;hb=eab665c573155237001f42ca3bcefc0f7b9281a5;hp=4a08e8a78def2826e09f22673a2ac37ed721ed92;hpb=16b2db0986ce0ed7c420a69d0a98bb41e9ca4bd8;p=notmuch diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 4a08e8a7..60801f4b 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -21,8 +21,6 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) - (require 'message) (require 'mm-view) (require 'format-spec) @@ -99,7 +97,7 @@ the From: header is already filled in by notmuch." :group 'notmuch-send) (defgroup notmuch-reply nil - "Replying to messages in notmuch" + "Replying to messages in notmuch." :group 'notmuch) (defcustom notmuch-mua-cite-function 'message-cite-original @@ -144,9 +142,10 @@ to `notmuch-mua-send-hook'." ;;; Various functions (defun notmuch-mua-attachment-check () - "Signal an error if the message text indicates that an -attachment is expected but no MML referencing an attachment is -found. + "Signal an error an attachement is expected but missing. + +Signal an error if the message text indicates that an attachment +is expected but no MML referencing an attachment is found. Typically this is added to `notmuch-mua-send-hook'." (when (and @@ -218,11 +217,10 @@ Typically this is added to `notmuch-mua-send-hook'." (defun notmuch-mua-reply-crypto (parts) "Add mml sign-encrypt flag if any part of original message is encrypted." (cl-loop for part in parts - if (notmuch-match-content-type (plist-get part :content-type) - "multipart/encrypted") + for type = (plist-get part :content-type) + if (notmuch-match-content-type type "multipart/encrypted") do (mml-secure-message-sign-encrypt) - else if (notmuch-match-content-type (plist-get part :content-type) - "multipart/*") + else if (notmuch-match-content-type type "multipart/*") do (notmuch-mua-reply-crypto (plist-get part :content)))) ;; There is a bug in Emacs' message.el that results in a newline @@ -237,7 +235,7 @@ Typically this is added to `notmuch-mua-send-hook'." ;;; Mua reply (defun notmuch-mua-reply (query-string &optional sender reply-all) - (let ((args '("reply" "--format=sexp" "--format-version=4")) + (let ((args '("reply" "--format=sexp" "--format-version=5")) (process-crypto notmuch-show-process-crypto) reply original) @@ -318,7 +316,9 @@ Typically this is added to `notmuch-mua-send-hook'." ;; text. (notmuch-show-process-crypto process-crypto) ;; Don't indent multipart sub-parts. - (notmuch-show-indent-multipart nil)) + (notmuch-show-indent-multipart nil) + ;; Stop certain mime types from being inlined + (mm-inline-override-types (notmuch--inline-override-types))) ;; We don't want sigstatus buttons (an information leak and usually wrong anyway). (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore) ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore)) @@ -343,8 +343,8 @@ Typically this is added to `notmuch-mua-send-hook'." (defvar notmuch-message-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) - (define-key map (kbd "C-c C-s") #'notmuch-mua-send) + (define-key map [remap message-send-and-exit] #'notmuch-mua-send-and-exit) + (define-key map [remap message-send] #'notmuch-mua-send) (define-key map (kbd "C-c C-p") #'notmuch-draft-postpone) (define-key map (kbd "C-x C-s") #'notmuch-draft-save) map) @@ -389,7 +389,7 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory." (interactive) (when notmuch-mua-user-agent-function (let ((user-agent (funcall notmuch-mua-user-agent-function))) - (unless (string= "" user-agent) + (unless (string-empty-p user-agent) (push (cons 'User-Agent user-agent) other-headers)))) (unless (assq 'From other-headers) (push (cons 'From (message-make-from @@ -476,7 +476,7 @@ the From: address." (with-current-buffer temp-buffer (erase-buffer) (let ((coding-system-for-read 'no-conversion)) - (call-process notmuch-command nil t nil + (notmuch--call-process notmuch-command nil t nil "show" "--format=raw" id)) ;; Because we process the messages in reverse order, ;; always generate a forwarded subject, then use the