Re: notmuch and "mute" -- useful to anyone?
[notmuch-archives.git] / 07 / b12486c7e64905acd88629cf776535cfd0e689
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 972B2429E5F\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 15:42:10 -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 1dXu4ThyRh5l for <notmuch@notmuchmail.org>;\r
17         Tue, 17 Jan 2012 15:42:10 -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 E06EB429E27\r
22         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 15:42:09 -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 1RnIfE-0003cg-VL; Tue, 17 Jan 2012 23:42:05 +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 1RnIfE-0006Nc-N1; Tue, 17 Jan 2012 23:42:04 +0000\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Austin Clements <amdragon@MIT.EDU>\r
34 Subject: Re: [PATCH 1/1] Make buttons for attachments allow viewing as well as\r
35         saving\r
36 In-Reply-To: <20120117230255.GW16740@mit.edu>\r
37 References: <1326629796-11436-1-git-send-email-markwalters1009@gmail.com>\r
38         <1326629796-11436-2-git-send-email-markwalters1009@gmail.com>\r
39         <87wr8r5trv.fsf@servo.finestructure.net>\r
40         <87lip7fhkc.fsf@qmul.ac.uk> <20120117022330.GE16740@mit.edu>\r
41         <8739beitq4.fsf@qmul.ac.uk> <20120117202603.GP16740@mit.edu>\r
42         <871uqy3vy4.fsf@qmul.ac.uk> <20120117210158.GS16740@mit.edu>\r
43         <87obu2q80o.fsf@qmul.ac.uk> <20120117230255.GW16740@mit.edu>\r
44 User-Agent: Notmuch/0.11~rc2+73~g1ea2b60 (http://notmuchmail.org) Emacs/23.2.1\r
45         (i486-pc-linux-gnu)\r
46 Date: Tue, 17 Jan 2012 23:42:52 +0000\r
47 Message-ID: <87lip5rj43.fsf@qmul.ac.uk>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 X-Sender-Host-Address: 94.192.233.223\r
51 X-QM-SPAM-Info: Sender has good ham record.  :)\r
52 X-QM-Body-MD5: ac6e21fbaa3487fcfec61851dc6f910d (of first 20000 bytes)\r
53 X-SpamAssassin-Score: -1.8\r
54 X-SpamAssassin-SpamBar: -\r
55 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
56         determine if it is\r
57         spam. We require at least 5.0 points to mark a message as spam.\r
58         This message scored -1.8 points.\r
59         Summary of the scoring: \r
60         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
61         *      medium trust\r
62         *      [138.37.6.40 listed in list.dnswl.org]\r
63         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
64         provider *      (markwalters1009[at]gmail.com)\r
65         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
66         *      domain\r
67         *  0.6 AWL AWL: From: address is in the auto white-list\r
68 X-QM-Scan-Virus: ClamAV says the message is clean\r
69 Cc: notmuch@notmuchmail.org\r
70 X-BeenThere: notmuch@notmuchmail.org\r
71 X-Mailman-Version: 2.1.13\r
72 Precedence: list\r
73 List-Id: "Use and development of the notmuch mail system."\r
74         <notmuch.notmuchmail.org>\r
75 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
77 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
78 List-Post: <mailto:notmuch@notmuchmail.org>\r
79 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
80 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
81         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
82 X-List-Received-Date: Tue, 17 Jan 2012 23:42:10 -0000\r
83 \r
84\r
85 > Oops, actually there was a bug in that macro.  It should have been\r
86\r
87 > (defmacro notmuch-with-temp-part-buffer (message-id nth &rest body)\r
88 >   (declare (indent 2))\r
89 >   (let ((process-crypto (make-symbol "process-crypto")))\r
90 >     `(let ((,process-crypto notmuch-show-process-crypto))\r
91 >        (with-temp-buffer\r
92 >          (setq notmuch-show-process-crypto ,process-crypto)\r
93 >          ;; Always acquires the part via `notmuch part', even if it is\r
94 >          ;; available in the JSON output.\r
95 >          (insert (notmuch-show-get-bodypart-internal ,message-id ,nth))\r
96 >          ,@body))))\r
97\r
98 > The only difference is on the "insert" line.  Sorry about that.\r
99 \r
100 Fixed.\r
101 \r
102 [Snip excellent explanation of defmacro]\r
103 \r
104 Thanks for the excellent explanation!\r
105 \r
106 > > Finally, I have discovered one bug/misfeature. If you try to "view" an\r
107 > > attachment then it will offer to save it but will not offer a\r
108 > > filename. If you try and save it (or use the default action) it will\r
109 > > offer a filename as now. As far as I can see this is not fixable if I\r
110 > > use mm-display-part: however, I could include a slight tweaked version,\r
111 > > notmuch-show-mm-display-part say, which would fix this corner\r
112 > > case. (Essentially, it would call notmuch-show-save-part if it failed to\r
113 > > find a handler rather than mailcap-save-binary-file.) However, this is\r
114 > > about 50 lines of lisp so I am not sure it is worth it.\r
115\r
116 > Hmm.  This is probably worth fixing, but probably in a separate patch.\r
117 > Duplicating mm-display-part is probably not the way to go.  It think\r
118 > it will work to pass t as the no-default argument to mm-display-part\r
119 > and check the return value, which should be 'inline if it was able to\r
120 > handle it internally or 'external if it found an external helper.  I'm\r
121 > pretty sure it will never fall in to mailcap-save-binary-file in that\r
122 > case.  If that doesn't work, you could flet mailcap-save-binary-file\r
123 > around the call to mm-display-part.\r
124 \r
125 I had tried passing t to mm-display-part and that didn't work as I\r
126 expected. I will experiment some more and try your flet suggestion but I\r
127 think that will be a separate patch.\r
128 \r
129 I will send a potential final version of this patch as a reply to this\r
130 email. Many thanks for all the guidance and help!\r
131 \r
132 Best wishes\r
133 \r
134 Mark\r
135 \r