]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Optionally show all parts in multipart/alternative.
authorDavid Edmondson <dme@dme.org>
Mon, 17 May 2010 12:41:12 +0000 (13:41 +0100)
committerCarl Worth <cworth@cworth.org>
Wed, 18 May 2011 22:51:46 +0000 (15:51 -0700)
Add a variable `notmuch-show-all-multipart/alternative-parts' that
allows the user to indicate that all candidate sub-parts of a
multipart/alternative part should be shown rather than just the
preferred part. The default is `nil', showing only the preferred part.

This is mostly a debugging aid.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
emacs/notmuch-show.el

index 72c87a1f9943a8a6bf1e6a960019e0cef9cb8569..3d8431a6e90f5f04b571ba5e8ce7bbe6f608d39e 100644 (file)
@@ -83,6 +83,12 @@ any given message."
             notmuch-wash-elide-blank-lines
             notmuch-wash-excerpt-citations))
 
             notmuch-wash-elide-blank-lines
             notmuch-wash-excerpt-citations))
 
+;; Mostly useful for debugging.
+(defcustom notmuch-show-all-multipart/alternative-parts nil
+  "Should all parts of multipart/alternative parts be shown?"
+  :group 'notmuch
+  :type 'boolean)
+
 (defcustom notmuch-show-indent-multipart nil
   "Should the sub-parts of a multipart/* part be indented?"
   ;; dme: Not sure which is a good default.
 (defcustom notmuch-show-indent-multipart nil
   "Should the sub-parts of a multipart/* part be indented?"
   ;; dme: Not sure which is a good default.
@@ -319,7 +325,8 @@ current buffer, if possible."
     ;; should be chosen if there are more than one that match?
     (mapc (lambda (inner-part)
            (let ((inner-type (plist-get inner-part :content-type)))
     ;; should be chosen if there are more than one that match?
     (mapc (lambda (inner-part)
            (let ((inner-type (plist-get inner-part :content-type)))
-             (if (string= chosen-type inner-type)
+             (if (or notmuch-show-all-multipart/alternative-parts
+                     (string= chosen-type inner-type))
                  (notmuch-show-insert-bodypart msg inner-part depth)
                (notmuch-show-insert-part-header (plist-get inner-part :id) inner-type inner-type nil " (not shown)"))))
          inner-parts)
                  (notmuch-show-insert-bodypart msg inner-part depth)
                (notmuch-show-insert-part-header (plist-get inner-part :id) inner-type inner-type nil " (not shown)"))))
          inner-parts)