[PATCH v3 3/3] emacs: Don't insert a part header if it's the first part and text/*.

David Edmondson dme at dme.org
Mon Feb 6 07:39:08 PST 2012


Previously this logic applied only to text/plain. Allow it for other
text/* parts as well.
---
 emacs/notmuch-show.el |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index ce79762..c60e613 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -412,7 +412,9 @@ CONTENT-TYPE parts."
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment
 					    &rest button-parameters)
-  (unless (notmuch-show-hidden-part-header content-type)
+  (unless (or (notmuch-show-hidden-part-header content-type)
+	      (and (= nth 1)
+		   (string-match "text/*" content-type)))
     (apply #'insert-button
 	   (concat "[ "
 		   (if name (concat name ": ") "")
@@ -703,10 +705,7 @@ current buffer, if possible."
 
 (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)
   (let ((start (point)))
-    ;; If this text/plain part is not the first part in the message,
-    ;; insert a header to make this clear.
-    (if (> nth 1)
-	(notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename)))
+    (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
     (insert (notmuch-show-get-bodypart-content msg part nth))
     (save-excursion
       (save-restriction
-- 
1.7.8.3



More information about the notmuch mailing list