1 Return-Path: <dme@dme.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 798E8431FCB
\r
6 for <notmuch@notmuchmail.org>; Mon, 6 Feb 2012 07:39:19 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 6urgHWwPcOl7 for <notmuch@notmuchmail.org>;
\r
16 Mon, 6 Feb 2012 07:39:16 -0800 (PST)
\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
18 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id ECFD9431FAF
\r
21 for <notmuch@notmuchmail.org>; Mon, 6 Feb 2012 07:39:15 -0800 (PST)
\r
22 Received: by wibhi8 with SMTP id hi8so4927745wib.26
\r
23 for <notmuch@notmuchmail.org>; Mon, 06 Feb 2012 07:39:14 -0800 (PST)
\r
24 Received: by 10.180.103.68 with SMTP id fu4mr24991109wib.7.1328542754254;
\r
25 Mon, 06 Feb 2012 07:39:14 -0800 (PST)
\r
26 Received: from hotblack-desiato.hh.sledj.net
\r
27 (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])
\r
28 by mx.google.com with ESMTPS id p10sm26449625wic.0.2012.02.06.07.39.10
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Mon, 06 Feb 2012 07:39:11 -0800 (PST)
\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
32 id 52146A0E82; Mon, 6 Feb 2012 15:39:09 +0000 (GMT)
\r
33 From: David Edmondson <dme@dme.org>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH v3 2/3] emacs: Optionally hide some part headers.
\r
36 Date: Mon, 6 Feb 2012 15:39:07 +0000
\r
37 Message-Id: <1328542748-19530-4-git-send-email-dme@dme.org>
\r
38 X-Mailer: git-send-email 1.7.8.3
\r
39 In-Reply-To: <1328542748-19530-1-git-send-email-dme@dme.org>
\r
40 References: <1327052612-1040-1-git-send-email-dme@dme.org>
\r
41 <1328542748-19530-1-git-send-email-dme@dme.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Mon, 06 Feb 2012 15:39:19 -0000
\r
56 Add a regexp, `notmuch-show-part-headers-hidden' and if the
\r
57 content-type of a part matches, don't show the part header.
\r
59 emacs/notmuch-show.el | 43 ++++++++++++++++++++++++++++---------------
\r
60 1 files changed, 28 insertions(+), 15 deletions(-)
\r
62 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
63 index 079d7cb..ce79762 100644
\r
64 --- a/emacs/notmuch-show.el
\r
65 +++ b/emacs/notmuch-show.el
\r
66 @@ -125,6 +125,12 @@ indentation."
\r
67 (const :tag "View interactively"
\r
68 notmuch-show-interactively-view-part)))
\r
70 +(defcustom notmuch-show-part-headers-hidden nil
\r
71 + "Headers for parts whose content-type matches this regexp will
\r
76 (defmacro with-current-notmuch-show-message (&rest body)
\r
77 "Evaluate body with current buffer set to the text of current message"
\r
79 @@ -397,24 +403,31 @@ message at DEPTH in the current thread."
\r
80 "Submap for button commands")
\r
81 (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)
\r
83 +(defun notmuch-show-hidden-part-header (content-type)
\r
84 + "Return non-nil if a part header should be hidden for
\r
85 +CONTENT-TYPE parts."
\r
86 + (and notmuch-show-part-headers-hidden
\r
87 + (string-match notmuch-show-part-headers-hidden content-type)))
\r
89 (defun notmuch-show-insert-part-header (nth content-type declared-type
\r
90 &optional name comment
\r
91 &rest button-parameters)
\r
92 - (apply #'insert-button
\r
94 - (if name (concat name ": ") "")
\r
96 - (if (not (string-equal declared-type content-type))
\r
97 - (concat " (as " content-type ")")
\r
101 - :type 'notmuch-show-part-button-type
\r
102 - :notmuch-part nth
\r
103 - :notmuch-filename name
\r
104 - :notmuch-content-type content-type
\r
105 - button-parameters)
\r
107 + (unless (notmuch-show-hidden-part-header content-type)
\r
108 + (apply #'insert-button
\r
110 + (if name (concat name ": ") "")
\r
112 + (if (not (string-equal declared-type content-type))
\r
113 + (concat " (as " content-type ")")
\r
117 + :type 'notmuch-show-part-button-type
\r
118 + :notmuch-part nth
\r
119 + :notmuch-filename name
\r
120 + :notmuch-content-type content-type
\r
121 + button-parameters)
\r
124 ;; Functions handling particular MIME parts.
\r