Re: Flat search and threaded views
[notmuch-archives.git] / cc / 32fd0cb80d87fc9f4d24263aedd33a1d5c0d79
1 Return-Path: <m.walters@qmul.ac.uk>\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 2B164431FB6\r
6         for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 01:20:00 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id YIQYDwurL6Gv for <notmuch@notmuchmail.org>;\r
17         Sun, 12 Feb 2012 01:19:59 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 4BCB7431FAE\r
22         for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 01:19:59 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1RwVb9-0005q7-Gs; Sun, 12 Feb 2012 09:19:57 +0000\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1RwVb9-00064R-0O; Sun, 12 Feb 2012 09:19:55 +0000\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH v3 2/3] emacs: Optionally hide some part headers.\r
35 In-Reply-To: <1328542748-19530-4-git-send-email-dme@dme.org>\r
36 References: <1327052612-1040-1-git-send-email-dme@dme.org>\r
37         <1328542748-19530-1-git-send-email-dme@dme.org>\r
38         <1328542748-19530-4-git-send-email-dme@dme.org>\r
39 User-Agent: Notmuch/0.11.1+172~g6a5d2c5 (http://notmuchmail.org) Emacs/23.2.1\r
40         (i486-pc-linux-gnu)\r
41 Date: Sun, 12 Feb 2012 09:21:14 +0000\r
42 Message-ID: <87ty2wif05.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 94.192.233.223\r
46 X-QM-SPAM-Info: Sender has good ham record.  :)\r
47 X-QM-Body-MD5: 652e325df3b6bd62685f54e233565f48 (of first 20000 bytes)\r
48 X-SpamAssassin-Score: -1.8\r
49 X-SpamAssassin-SpamBar: -\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
51         determine if it is\r
52         spam. We require at least 5.0 points to mark a message as spam.\r
53         This message scored -1.8 points.\r
54         Summary of the scoring: \r
55         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
56         *      medium trust\r
57         *      [138.37.6.40 listed in list.dnswl.org]\r
58         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
59         provider *      (markwalters1009[at]gmail.com)\r
60         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
61         *      domain\r
62         *  0.5 AWL AWL: From: address is in the auto white-list\r
63 X-QM-Scan-Virus: ClamAV says the message is clean\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Sun, 12 Feb 2012 09:20:00 -0000\r
77 \r
78 On Mon,  6 Feb 2012 15:39:07 +0000, David Edmondson <dme@dme.org> wrote:\r
79 > Add a regexp, `notmuch-show-part-headers-hidden' and if the\r
80 > content-type of a part matches, don't show the part header.\r
81 > ---\r
82 >  emacs/notmuch-show.el |   43 ++++++++++++++++++++++++++++---------------\r
83 >  1 files changed, 28 insertions(+), 15 deletions(-)\r
84\r
85 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
86 > index 079d7cb..ce79762 100644\r
87 > --- a/emacs/notmuch-show.el\r
88 > +++ b/emacs/notmuch-show.el\r
89 > @@ -125,6 +125,12 @@ indentation."\r
90 >                (const :tag "View interactively"\r
91 >                       notmuch-show-interactively-view-part)))\r
92 >  \r
93 > +(defcustom notmuch-show-part-headers-hidden nil\r
94 > +  "Headers for parts whose content-type matches this regexp will\r
95 > +not be shown."\r
96 > +  :group 'notmuch\r
97 > +  :type 'regexp)\r
98 > +\r
99 \r
100 Hi \r
101 \r
102 I found this confusing for two reasons: first I thought the entire\r
103 content-type would have to match the regular expression but content-type\r
104 only needs to contain the regular expression. Secondly the value I typed\r
105 into the defcustom box seemed to need to be in quotes or I got an error\r
106 message.\r
107 \r
108 Best wishes\r
109 \r
110 Mark\r
111 \r
112 >  (defmacro with-current-notmuch-show-message (&rest body)\r
113 >    "Evaluate body with current buffer set to the text of current message"\r
114 >    `(save-excursion\r
115 > @@ -397,24 +403,31 @@ message at DEPTH in the current thread."\r
116 >    "Submap for button commands")\r
117 >  (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
118 >  \r
119 > +(defun notmuch-show-hidden-part-header (content-type)\r
120 > +  "Return non-nil if a part header should be hidden for\r
121 > +CONTENT-TYPE parts."\r
122 > +  (and notmuch-show-part-headers-hidden\r
123 > +       (string-match notmuch-show-part-headers-hidden content-type)))\r
124 > +\r
125 >  (defun notmuch-show-insert-part-header (nth content-type declared-type\r
126 >                                           &optional name comment\r
127 >                                           &rest button-parameters)\r
128 > -  (apply #'insert-button\r
129 > -      (concat "[ "\r
130 > -              (if name (concat name ": ") "")\r
131 > -              declared-type\r
132 > -              (if (not (string-equal declared-type content-type))\r
133 > -                  (concat " (as " content-type ")")\r
134 > -                "")\r
135 > -              (or comment "")\r
136 > -              " ]")\r
137 > -      :type 'notmuch-show-part-button-type\r
138 > -      :notmuch-part nth\r
139 > -      :notmuch-filename name\r
140 > -      :notmuch-content-type content-type\r
141 > -      button-parameters)\r
142 > -  (insert "\n"))\r
143 > +  (unless (notmuch-show-hidden-part-header content-type)\r
144 > +    (apply #'insert-button\r
145 > +        (concat "[ "\r
146 > +                (if name (concat name ": ") "")\r
147 > +                declared-type\r
148 > +                (if (not (string-equal declared-type content-type))\r
149 > +                    (concat " (as " content-type ")")\r
150 > +                  "")\r
151 > +                (or comment "")\r
152 > +                " ]")\r
153 > +        :type 'notmuch-show-part-button-type\r
154 > +        :notmuch-part nth\r
155 > +        :notmuch-filename name\r
156 > +        :notmuch-content-type content-type\r
157 > +        button-parameters)\r
158 > +    (insert "\n")))\r
159 >  \r
160 >  ;; Functions handling particular MIME parts.\r
161 >  \r
162 > -- \r
163 > 1.7.8.3\r
164\r
165 > _______________________________________________\r
166 > notmuch mailing list\r
167 > notmuch@notmuchmail.org\r
168 > http://notmuchmail.org/mailman/listinfo/notmuch\r