1 Return-Path: <amdragon@mit.edu>
\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 5E4C5429E5F
\r
6 for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 17:25:57 -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 6A4jHd0Gcg-9 for <notmuch@notmuchmail.org>;
\r
16 Tue, 17 Jan 2012 17:25:57 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id D1820429E27
\r
20 for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 17:25:56 -0800 (PST)
\r
21 X-AuditID: 12074424-b7fae6d000000906-f0-4f161fa2aee1
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 8D.59.02310.2AF161F4; Tue, 17 Jan 2012 20:25:54 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q0I1PrG7001243;
\r
27 Tue, 17 Jan 2012 20:25:54 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0I1Pqva012791
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 17 Jan 2012 20:25:52 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1RnKHU-0008P3-0z; Tue, 17 Jan 2012 20:25:40 -0500
\r
37 Date: Tue, 17 Jan 2012 20:25:39 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Mark Walters <markwalters1009@gmail.com>
\r
40 Subject: Re: [PATCH v3] Make buttons for attachments allow viewing as well as
\r
42 Message-ID: <20120118012539.GA16740@mit.edu>
\r
43 References: <87lip5rj43.fsf@qmul.ac.uk>
\r
44 <1326843886-18387-1-git-send-email-markwalters1009@gmail.com>
\r
45 <20120117235318.GZ16740@mit.edu> <87ipk9rgg9.fsf@qmul.ac.uk>
\r
47 Content-Type: text/plain; charset=us-ascii
\r
48 Content-Disposition: inline
\r
49 In-Reply-To: <87ipk9rgg9.fsf@qmul.ac.uk>
\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
51 X-Brightmail-Tracker:
\r
52 H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1l0kL+Zv8H+vosXquTwW12/OZHZg
\r
53 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4MjbubGcrOMlbcbHvKFsD4zGuLkZODgkBE4mJ
\r
54 x2czQthiEhfurWfrYuTiEBLYxyhx8VwXI4SzgVHi5cEPzBDOSSaJdYdWQWWWMEqsbTvBDNLP
\r
55 IqAqsWjCMzYQm01AQ2Lb/uVgc0UEdCRuH1rADmIzC0hLfPvdzARiCwuESXxt3g7WywtUc2zi
\r
56 IjBbSGAFo8TC7WIQcUGJkzOfsED0aknc+PcSqJcDbM7yfxwgJifQqkfnMkAqRAVUJKac3MY2
\r
57 gVFoFpLmWUiaZyE0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrrpebWaKXmlK6iREU1Owu
\r
58 KjsYmw8pHWIU4GBU4uGV2CDqL8SaWFZcmXuIUZKDSUmUlx8YE0J8SfkplRmJxRnxRaU5qcWH
\r
59 GCU4mJVEeFmZgXK8KYmVValF+TApaQ4WJXFeDa13fkIC6YklqdmpqQWpRTBZGQ4OJQlef5Ch
\r
60 gkWp6akVaZk5JQhpJg5OkOE8QMMZQWp4iwsSc4sz0yHypxgVpcR5jUASAiCJjNI8uF5Y0nnF
\r
61 KA70ijCvI0gVDzBhwXW/AhrMBDQ4p1UIZHBJIkJKqoExe0Lzv8ffnQs3hcytj3riNi/rwceJ
\r
62 Fy+d4V+4s+5wtHO1wrd3k7TXsz9yOsDqxGnCxmCz8PLTq6zLNNe4sy3PTRZXbb+6mMu3KoL7
\r
63 Tt6JDtY5L6w0zncm27YKeId1iRlzbegzlZFPuVlfdHv6mqshr9m6bP7slOSWYah7/1Pcz2rl
\r
64 3CxBqSYlluKMREMt5qLiRACzgEv7FQMAAA==
\r
65 Cc: notmuch@notmuchmail.org
\r
66 X-BeenThere: notmuch@notmuchmail.org
\r
67 X-Mailman-Version: 2.1.13
\r
69 List-Id: "Use and development of the notmuch mail system."
\r
70 <notmuch.notmuchmail.org>
\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
74 List-Post: <mailto:notmuch@notmuchmail.org>
\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
77 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
78 X-List-Received-Date: Wed, 18 Jan 2012 01:25:57 -0000
\r
80 Quoth Mark Walters on Jan 18 at 12:40 am:
\r
82 > > Oof, sorry. Two more tweaks that I really should have caught in the
\r
83 > > previous version. After that this gets my automatic +1.
\r
85 > Both fixed. I have also fixed the bug I mentioned (missing filename when
\r
86 > "view" falls back on save); I couldn't make it work with the
\r
87 > "no-default" option. However overriding mm-save-part with flet seems to
\r
90 Oh, indeed. I'd foolishly assumed that when mm-display-part passed
\r
91 the function mailcap-save-binary-file as the method to
\r
92 mm-display-external that it would actually *use* that function, but
\r
93 you're right that it uses mm-save-part.
\r
95 > +(defun notmuch-show-view-part (message-id nth &optional filename content-type )
\r
96 > + (notmuch-with-temp-part-buffer message-id nth
\r
97 > + ;; set mm-inlined-types to nil to force an external viewer
\r
98 > + (let ((handle (mm-make-handle (current-buffer) (list content-type)))
\r
99 > + (mm-inlined-types nil))
\r
100 > + ;; We override mm-save-part as notmuch-show-save-part is better
\r
101 > + ;; since it offers the filename
\r
102 > + (flet ((mm-save-part (&rest args) (ignore)))
\r
103 > + (or (mm-display-part handle)
\r
104 > + (notmuch-show-save-part message-id nth filename content-type))))))
\r
106 > Is that a reasonable solution?
\r
108 It's *probably* safe to depend on the result of mm-display-part, but
\r
109 you can avoid the question altogether by simply calling
\r
110 notmuch-show-save-part from your flet mm-save-part. E.g.,
\r
112 (flet ((mm-save-part (&rest args) (notmuch-show-save-part
\r
113 message-id nth filename content-type)))
\r
114 (mm-display-part handle))
\r
116 (Yeah, flet indentation is lame.)
\r