Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
authorJani Nikula <jani@nikula.org>
Tue, 21 Feb 2012 07:50:11 +0000 (07:50 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:46 +0000 (09:44 -0800)
c2/da5cb0de385a7711b5f5b7ebf530d0087c460e [new file with mode: 0644]

diff --git a/c2/da5cb0de385a7711b5f5b7ebf530d0087c460e b/c2/da5cb0de385a7711b5f5b7ebf530d0087c460e
new file mode 100644 (file)
index 0000000..823b066
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9E8C9431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 23:50:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id NqrmZfdhu+wO for <notmuch@notmuchmail.org>;\r
+       Mon, 20 Feb 2012 23:50:16 -0800 (PST)\r
+Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com\r
+       [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D5FCA431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 23:50:16 -0800 (PST)\r
+Received: by qadc10 with SMTP id c10so4570797qad.5\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 23:50:15 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of jani@nikula.org designates\r
+       10.229.136.144 as permitted sender) client-ip=10.229.136.144; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of jani@nikula.org\r
+       designates 10.229.136.144 as permitted sender)\r
+       smtp.mail=jani@nikula.org\r
+Received: from mr.google.com ([10.229.136.144])\r
+       by 10.229.136.144 with SMTP id r16mr18499281qct.62.1329810615299\r
+       (num_hops = 1); Mon, 20 Feb 2012 23:50:15 -0800 (PST)\r
+Received: by 10.229.136.144 with SMTP id r16mr15593502qct.62.1329810615157;\r
+       Mon, 20 Feb 2012 23:50:15 -0800 (PST)\r
+Received: from localhost (nikula.org. [92.243.24.172])\r
+       by mx.google.com with ESMTPS id hp1sm6771287qab.22.2012.02.20.23.50.13\r
+       (version=SSLv3 cipher=OTHER); Mon, 20 Feb 2012 23:50:14 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 1/2] emacs: support defining a list of alternative\r
+       parts to show\r
+In-Reply-To:\r
+ <ab777cf0fa83778d3399ac52094df9230738819d.1328798471.git.jani@nikula.org>\r
+References: <cover.1328719309.git.jani@nikula.org>\r
+       <ab777cf0fa83778d3399ac52094df9230738819d.1328798471.git.jani@nikula.org>\r
+User-Agent: Notmuch/0.11.1+168~g25a7ceb (http://notmuchmail.org) Emacs/23.1.1\r
+       (i686-pc-linux-gnu)\r
+Date: Tue, 21 Feb 2012 07:50:11 +0000\r
+Message-ID: <87obssiq18.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQmH41EQSC7KaHI6o1t1HpFsjHLflYRGPKyU1RjOgQRT9HW67lyi3+K7k7egDo6zVCDpcsJf\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 21 Feb 2012 07:50:17 -0000\r
+\r
+On Thu,  9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:\r
+> Make notmuch-show-all-multipart/alternative-parts accept a list of\r
+> regexps to match the part types to determine which parts to show in\r
+> addition to the preferred types. This allows the user to force display\r
+> some alternative part types while normally showing just the preferred\r
+> ones.\r
+\r
+Wah, this patch (1/2) is crap, as it also seems to affect the\r
+reply. I'll probably return to this later, after the json reply stuff is\r
+merged or so.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+> \r
+> Signed-off-by: Jani Nikula <jani@nikula.org>\r
+> ---\r
+>  emacs/notmuch-show.el |   23 ++++++++++++++++++-----\r
+>  1 files changed, 18 insertions(+), 5 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 24fde05..5f643f1 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -94,10 +94,20 @@ any given message."\r
+>    :group 'notmuch-show\r
+>    :group 'notmuch-hooks)\r
+>  \r
+> -;; Mostly useful for debugging.\r
+>  (defcustom notmuch-show-all-multipart/alternative-parts t\r
+> -  "Should all parts of multipart/alternative parts be shown?"\r
+> -  :type 'boolean\r
+> +  "Which parts of multipart/alternative should be shown?\r
+> +\r
+> +This variable determines which parts of multipart/alternative\r
+> +should be displayed. Set to t (the default) to show all\r
+> +parts. Set to nil to only show the preferred parts. Set to a list\r
+> +of regexps to display the preferred parts, and parts matching any\r
+> +of the regexps, for example:\r
+> +\r
+> + (setq notmuch-show-all-multipart/alternative-parts\r
+> +      '(\"text/.*calendar\" \"text/html\"))"\r
+> +  :type '(choice (const :tag "Show all parts" t)\r
+> +             (const :tag "Show preferred parts" nil)\r
+> +             (repeat :tag "Show preferred and parts matching regexps" string))\r
+>    :group 'notmuch-show)\r
+>  \r
+>  (defcustom notmuch-show-indent-messages-width 1\r
+> @@ -513,8 +523,11 @@ current buffer, if possible."\r
+>      ;; should be chosen if there are more than one that match?\r
+>      (mapc (lambda (inner-part)\r
+>          (let ((inner-type (plist-get inner-part :content-type)))\r
+> -          (if (or notmuch-show-all-multipart/alternative-parts\r
+> -                  (string= chosen-type inner-type))\r
+> +          (if (or (equal notmuch-show-all-multipart/alternative-parts t)\r
+> +                  (string= chosen-type inner-type)\r
+> +                  (and\r
+> +                   notmuch-show-all-multipart/alternative-parts\r
+> +                   (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))\r
+>                (notmuch-show-insert-bodypart msg inner-part depth)\r
+>              (notmuch-show-insert-part-header (plist-get inner-part :id) inner-type inner-type nil " (not shown)"))))\r
+>        inner-parts)\r
+> -- \r
+> 1.7.1\r
+> \r