X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch.el;h=5fc38bf711682cf7d016f0fc4a42e0e35d8e7eb9;hb=becdb42b1f660950f1d755ba2d96ff403e995671;hp=ff4a0bd0205a1afa58837e1054205600917580b2;hpb=ca16b2225dd6323a3c1537d6c3e5ea0da8d63197;p=notmuch diff --git a/notmuch.el b/notmuch.el index ff4a0bd0..5fc38bf7 100644 --- a/notmuch.el +++ b/notmuch.el @@ -321,13 +321,28 @@ buffer." (with-current-buffer buf (insert-file-contents filename nil nil nil t) ,@body) - (kill-buffer buf))))) + (kill-buffer buf))))) (defun notmuch-show-view-all-mime-parts () "Use external viewers to view all attachments from the current message." (interactive) (with-current-notmuch-show-message - (mm-display-parts (mm-dissect-buffer)))) + ; We ovverride the mm-inline-media-tests to indicate which message + ; parts are already sufficiently handled by the original + ; presentation of the message in notmuch-show mode. These parts + ; will be inserted directly into the temporary buffer of + ; with-current-notmuch-show-message and silently discarded. + ; + ; Any MIME part not explicitly mentioned here will be handled by an + ; external viewer as configured in the various mailcap files. + (let ((mm-inline-media-tests '( + ("text/.*" ignore identity) + ("application/pgp-signature" ignore identity) + ("multipart/alternative" ignore identity) + ("multipart/mixed" ignore identity) + ("multipart/related" ignore identity) + ))) + (mm-display-parts (mm-dissect-buffer))))) (defun notmuch-foreach-mime-part (function mm-handle) (cond ((stringp (car mm-handle)) @@ -718,7 +733,7 @@ is what to put on the button." (let (mime-message mime-type) (save-excursion (re-search-forward notmuch-show-contentype-regexp end t) - (setq mime-type (car (split-string (buffer-substring + (setq mime-type (car (split-string (buffer-substring (match-beginning 1) (match-end 1)))))) (if (equal mime-type "text/html") @@ -1335,7 +1350,7 @@ This function advances the next thread when finished." (more t) (inhibit-read-only t)) (while more - (if (string-match "^\\(thread:[0-9A-Fa-f]*\\) \\(.*\\) \\(\\[[0-9/]*\\]\\) \\([^:]*\\); \\(.*\\) (\\([^()]*\\))$" string line) + (if (string-match "^\\(thread:[0-9A-Fa-f]*\\) \\(.*\\) \\(\\[[0-9/]*\\]\\) \\([^;]*\\); \\(.*\\) (\\([^()]*\\))$" string line) (let* ((thread-id (match-string 1 string)) (date (match-string 2 string)) (count (match-string 3 string))