Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8FD01429E26 for ; Wed, 8 Feb 2012 08:55:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nc7yQ7PNgeOm for ; Wed, 8 Feb 2012 08:55:24 -0800 (PST) Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 56C84431FAF for ; Wed, 8 Feb 2012 08:55:24 -0800 (PST) Received: by qadc10 with SMTP id c10so4265234qad.5 for ; Wed, 08 Feb 2012 08:55:23 -0800 (PST) Received: by 10.224.195.133 with SMTP id ec5mr28068542qab.7.1328720123680; Wed, 08 Feb 2012 08:55:23 -0800 (PST) Received: from localhost (nikula.org. [92.243.24.172]) by mx.google.com with ESMTPS id g9sm3869610qad.16.2012.02.08.08.55.21 (version=SSLv3 cipher=OTHER); Wed, 08 Feb 2012 08:55:22 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: support defining a list of alternative parts to show Date: Wed, 8 Feb 2012 16:55:15 +0000 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:55:28 -0000 Make notmuch-show-all-multipart/alternative-parts accept a list of multipart/alternative types to show in addition to the preferred types. This allows the user to force display some alternative part types while normally showing just the preferred ones. Signed-off-by: Jani Nikula --- emacs/notmuch-show.el | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index faa9f9b..1340380 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -97,7 +97,9 @@ any given message." ;; Mostly useful for debugging. (defcustom notmuch-show-all-multipart/alternative-parts t "Should all parts of multipart/alternative parts be shown?" - :type 'boolean + :type '(choice (const :tag "Show all" t) + (const :tag "Show preferred" nil) + (repeat :tag "Show preferred and custom" string)) :group 'notmuch-show) (defcustom notmuch-show-indent-messages-width 1 @@ -513,7 +515,9 @@ 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))) - (if (or notmuch-show-all-multipart/alternative-parts + (if (or (equal notmuch-show-all-multipart/alternative-parts t) + (member inner-type + 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)")))) -- 1.7.1