--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9B779431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:05:12 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id DpCNB63-pF4h for <notmuch@notmuchmail.org>;\r
+ Sun, 26 May 2013 00:05:05 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id CC99B431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:05:04 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1UgV0m-0006KM-Bo; Sun, 26 May 2013 08:05:00 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1UgV0m-0005Mi-1O; Sun, 26 May 2013 08:05:00 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2] emacs: Don't override mm-show-part in\r
+ notmuch-show-view-part\r
+In-Reply-To: <1369550086-26986-1-git-send-email-amdragon@mit.edu>\r
+References: <8761ycc19t.fsf@qmul.ac.uk>\r
+ <1369550086-26986-1-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 26 May 2013 08:04:59 +0100\r
+Message-ID: <874ndq2pd0.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 01b4158ce91d9743d5449e3aa5bc2201 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.1\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.1 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.1 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 26 May 2013 07:05:13 -0000\r
+\r
+\r
+LGTM +1\r
+\r
+This does not rely on the followup Austin mentioned in id:20130526063627.GQ5999@mit.edu is\r
+so I think this should go in as is as it fixes the\r
+flet thing without changing the behaviour.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+On Sun, 26 May 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Previously, notmuch-show-view-part overrode the function binding of\r
+> mm-show-part to redirect it to notmuch-show-save-part to get notmuch's\r
+> default file name handling in case mm-display-part decided to fall\r
+> back to saving the part. In addition to being messy, this depended on\r
+> the now-deprecated dynamic binding behavior of flet.\r
+>\r
+> This patch removes the mm-show-part override in favor of passing the\r
+> file name in to mm-show-part the way it expects, so we get its default\r
+> file name handling. It's not clear why we didn't do this before;\r
+> mm-show-part has supported default file names since at least Emacs\r
+> 23.1.\r
+> ---\r
+> This version overrides the default save directory to make it\r
+> consistent with `notmuch-show-save-part'.\r
+>\r
+> emacs/notmuch-show.el | 23 +++++++++--------------\r
+> 1 file changed, 9 insertions(+), 14 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 423dd58..d773396 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -528,20 +528,15 @@ message at DEPTH in the current thread."\r
+> \r
+> (defun notmuch-show-view-part (message-id nth &optional filename content-type )\r
+> (notmuch-with-temp-part-buffer message-id nth\r
+> - ;; set mm-inlined-types to nil to force an external viewer\r
+> - (let ((handle (mm-make-handle (current-buffer) (list content-type)))\r
+> - (mm-inlined-types nil))\r
+> - ;; We override mm-save-part as notmuch-show-save-part is better\r
+> - ;; since it offers the filename. We need to lexically bind\r
+> - ;; everything we need for notmuch-show-save-part to prevent\r
+> - ;; potential dynamic shadowing.\r
+> - (lexical-let ((message-id message-id)\r
+> - (nth nth)\r
+> - (filename filename)\r
+> - (content-type content-type))\r
+> - (flet ((mm-save-part (&rest args) (notmuch-show-save-part\r
+> - message-id nth filename content-type)))\r
+> - (mm-display-part handle))))))\r
+> + (let* ((disposition (if filename `(attachment (filename . ,filename))))\r
+> + (handle (mm-make-handle (current-buffer) (list content-type)\r
+> + nil nil disposition))\r
+> + ;; Set the default save directory to be consistent with\r
+> + ;; `notmuch-show-save-part'.\r
+> + (mm-default-directory (or mailcap-download-directory "~/"))\r
+> + ;; set mm-inlined-types to nil to force an external viewer\r
+> + (mm-inlined-types nil))\r
+> + (mm-display-part handle))))\r
+> \r
+> (defun notmuch-show-interactively-view-part (message-id nth &optional filename content-type)\r
+> (notmuch-with-temp-part-buffer message-id nth\r
+> -- \r
+> 1.7.10.4\r