1 Return-Path: <tomi.ollila@iki.fi>
\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 6B2D6431FBF
\r
6 for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:31:26 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 fYo7VQi5lImW for <notmuch@notmuchmail.org>;
\r
16 Sun, 26 May 2013 00:31:18 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 85E60431FAE
\r
19 for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:31:17 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 4E39E100093;
\r
22 Sun, 26 May 2013 10:31:13 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH v2] emacs: Don't override mm-show-part in
\r
26 notmuch-show-view-part
\r
27 In-Reply-To: <1369550086-26986-1-git-send-email-amdragon@mit.edu>
\r
28 References: <8761ycc19t.fsf@qmul.ac.uk>
\r
29 <1369550086-26986-1-git-send-email-amdragon@mit.edu>
\r
30 User-Agent: Notmuch/0.15.2+115~g12cf6af (http://notmuchmail.org) Emacs/24.3.1
\r
31 (x86_64-unknown-linux-gnu)
\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
33 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
34 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
35 Date: Sun, 26 May 2013 10:31:13 +0300
\r
36 Message-ID: <m238takxj2.fsf@guru.guru-group.fi>
\r
38 Content-Type: text/plain
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Sun, 26 May 2013 07:31:26 -0000
\r
53 On Sun, May 26 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
55 > Previously, notmuch-show-view-part overrode the function binding of
\r
56 > mm-show-part to redirect it to notmuch-show-save-part to get notmuch's
\r
57 > default file name handling in case mm-display-part decided to fall
\r
58 > back to saving the part. In addition to being messy, this depended on
\r
59 > the now-deprecated dynamic binding behavior of flet.
\r
61 > This patch removes the mm-show-part override in favor of passing the
\r
62 > file name in to mm-show-part the way it expects, so we get its default
\r
63 > file name handling. It's not clear why we didn't do this before;
\r
64 > mm-show-part has supported default file names since at least Emacs
\r
67 > This version overrides the default save directory to make it
\r
68 > consistent with `notmuch-show-save-part'.
\r
76 > emacs/notmuch-show.el | 23 +++++++++--------------
\r
77 > 1 file changed, 9 insertions(+), 14 deletions(-)
\r
79 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
80 > index 423dd58..d773396 100644
\r
81 > --- a/emacs/notmuch-show.el
\r
82 > +++ b/emacs/notmuch-show.el
\r
83 > @@ -528,20 +528,15 @@ message at DEPTH in the current thread."
\r
85 > (defun notmuch-show-view-part (message-id nth &optional filename content-type )
\r
86 > (notmuch-with-temp-part-buffer message-id nth
\r
87 > - ;; set mm-inlined-types to nil to force an external viewer
\r
88 > - (let ((handle (mm-make-handle (current-buffer) (list content-type)))
\r
89 > - (mm-inlined-types nil))
\r
90 > - ;; We override mm-save-part as notmuch-show-save-part is better
\r
91 > - ;; since it offers the filename. We need to lexically bind
\r
92 > - ;; everything we need for notmuch-show-save-part to prevent
\r
93 > - ;; potential dynamic shadowing.
\r
94 > - (lexical-let ((message-id message-id)
\r
96 > - (filename filename)
\r
97 > - (content-type content-type))
\r
98 > - (flet ((mm-save-part (&rest args) (notmuch-show-save-part
\r
99 > - message-id nth filename content-type)))
\r
100 > - (mm-display-part handle))))))
\r
101 > + (let* ((disposition (if filename `(attachment (filename . ,filename))))
\r
102 > + (handle (mm-make-handle (current-buffer) (list content-type)
\r
103 > + nil nil disposition))
\r
104 > + ;; Set the default save directory to be consistent with
\r
105 > + ;; `notmuch-show-save-part'.
\r
106 > + (mm-default-directory (or mailcap-download-directory "~/"))
\r
107 > + ;; set mm-inlined-types to nil to force an external viewer
\r
108 > + (mm-inlined-types nil))
\r
109 > + (mm-display-part handle))))
\r
111 > (defun notmuch-show-interactively-view-part (message-id nth &optional filename content-type)
\r
112 > (notmuch-with-temp-part-buffer message-id nth
\r
116 > _______________________________________________
\r
117 > notmuch mailing list
\r
118 > notmuch@notmuchmail.org
\r
119 > http://notmuchmail.org/mailman/listinfo/notmuch
\r