X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=4b8c66fdb2a1feefeacbee711acceef752f7c3a3;hp=7c3444931c0e6f96fca8e4200bf6f21e19860e2f;hb=c13ff402c42143941010cd03bd57658d42f0df7d;hpb=742b566cac5bae98d612bff306f08d45d4e27614 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 7c344493..4b8c66fd 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1,4 +1,4 @@ -;; notmuch-show.el --- displaying notmuch forests. +;;; notmuch-show.el --- displaying notmuch forests. ;; ;; Copyright © Carl Worth ;; Copyright © David Edmondson @@ -21,6 +21,8 @@ ;; Authors: Carl Worth ;; David Edmondson +;;; Code: + (eval-when-compile (require 'cl)) (require 'mm-view) (require 'message) @@ -607,7 +609,7 @@ will return nil if the CID is unknown or cannot be retrieved." (plist-get part :content))) (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth button) - (let ((chosen-type (car (notmuch-multipart/alternative-choose (notmuch-show-multipart/*-to-list part)))) + (let ((chosen-type (car (notmuch-multipart/alternative-choose msg (notmuch-show-multipart/*-to-list part)))) (inner-parts (plist-get part :content)) (start (point))) ;; This inserts all parts of the chosen type rather than just one, @@ -642,15 +644,10 @@ will return nil if the CID is unknown or cannot be retrieved." (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button) (when button (button-put button 'face 'notmuch-crypto-part-header)) - ;; Add signature status button if sigstatus provided. - (if (plist-member part :sigstatus) - (let* ((from (notmuch-show-get-header :From msg)) - (sigstatus (car (plist-get part :sigstatus)))) - (notmuch-crypto-insert-sigstatus-button sigstatus from)) - ;; If we're not adding the signature status, tell the user how - ;; they can get it. - (when button - (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))) + + ;; Insert a button detailing the signature status. + (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus)) + (notmuch-show-get-header :From msg)) (let ((inner-parts (plist-get part :content)) (start (point))) @@ -666,20 +663,13 @@ will return nil if the CID is unknown or cannot be retrieved." (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button) (when button (button-put button 'face 'notmuch-crypto-part-header)) - ;; Add encryption status button if encryption status is specified. - (if (plist-member part :encstatus) - (let ((encstatus (car (plist-get part :encstatus)))) - (notmuch-crypto-insert-encstatus-button encstatus) - ;; Add signature status button if signature status is - ;; specified. - (if (plist-member part :sigstatus) - (let* ((from (notmuch-show-get-header :From msg)) - (sigstatus (car (plist-get part :sigstatus)))) - (notmuch-crypto-insert-sigstatus-button sigstatus from)))) - ;; If we're not adding the encryption status, tell the user how - ;; they can get it. - (when button - (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))) + + ;; Insert a button detailing the encryption status. + (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus))) + + ;; Insert a button detailing the signature status. + (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus)) + (notmuch-show-get-header :From msg)) (let ((inner-parts (plist-get part :content)) (start (point))) @@ -1865,6 +1855,14 @@ any effects from previous calls to (error "No open messages to forward.")) (notmuch-mua-new-forward-messages open-messages prompt-for-sender))) +(defun notmuch-show-resend-message (addresses) + "Resend the current message." + (interactive (list (notmuch-address-from-minibuffer "Resend to: "))) + (when (y-or-n-p (concat "Confirm resend to " addresses " ")) + (notmuch-show-view-raw-message) + (message-resend addresses) + (notmuch-bury-or-kill-this-buffer))) + (defun notmuch-show-next-message (&optional pop-at-end) "Show the next message. @@ -2391,3 +2389,5 @@ is destroyed when FN returns." (provide 'notmuch-show) + +;;; notmuch-show.el ends here