From 151c4a67fa45073c276877add17c149861b676a5 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 19 Nov 2014 13:06:50 +0200 Subject: [PATCH] Re: [PATCH v1] emacs: `with-current-notmuch-show-message' should not leak `coding-system-for-read' --- 20/20816f8978ef928cfddffe2cccaa0c6592fba6 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 20/20816f8978ef928cfddffe2cccaa0c6592fba6 diff --git a/20/20816f8978ef928cfddffe2cccaa0c6592fba6 b/20/20816f8978ef928cfddffe2cccaa0c6592fba6 new file mode 100644 index 000000000..701fdd5a7 --- /dev/null +++ b/20/20816f8978ef928cfddffe2cccaa0c6592fba6 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 8E8DF431FAF + for ; Wed, 19 Nov 2014 03:07:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id DN-ljETRdh+D for ; + Wed, 19 Nov 2014 03:07:05 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 828E4431FAE + for ; Wed, 19 Nov 2014 03:07:05 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 169BD1000C1; + Wed, 19 Nov 2014 13:06:51 +0200 (EET) +From: Tomi Ollila +To: David Edmondson , notmuch@notmuchmail.org +Subject: Re: [PATCH v1] emacs: `with-current-notmuch-show-message' should not + leak `coding-system-for-read' +In-Reply-To: <1416294197-3170-1-git-send-email-dme@dme.org> +References: <1416294197-3170-1-git-send-email-dme@dme.org> +User-Agent: Notmuch/0.19+6~g8725b09 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 19 Nov 2014 11:07:13 -0000 + +On Tue, Nov 18 2014, David Edmondson wrote: + +> `with-current-notmuch-show-message' applies a `no-conversion' coding +> system when reading a raw message from notmuch. That coding system +> should _not_ be applied when the body of the macro is evaluated, as it +> can cause file operations used during that evaluation to incorrectly +> apply the `no-conversion' coding system. +> +> This was discovered when a user's .signature file contained non-ASCII +> characters. When a message is forwarded, the `no-conversion' coding +> system was applied to the reading of the .signature file, resulting in +> raw rather than UTF-8 interpretation of the data. +> --- + +Uh, this looks as good as it can be ;), and tests pass, +1 + +Tomi + + + +> +> Fix for id:87ioifb55d.fsf@nautilus.nautilus. +> +> emacs/notmuch-show.el | 6 +++--- +> 1 file changed, 3 insertions(+), 3 deletions(-) +> +> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +> index 4035fe8..b8cfbb8 100644 +> --- a/emacs/notmuch-show.el +> +++ b/emacs/notmuch-show.el +> @@ -241,9 +241,9 @@ every user interaction with notmuch." +> (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*")))) +> (with-current-buffer buf +> (let ((coding-system-for-read 'no-conversion)) +> - (call-process notmuch-command nil t nil "show" "--format=raw" id) +> - ,@body) +> - (kill-buffer buf)))))) +> + (call-process notmuch-command nil t nil "show" "--format=raw" id)) +> + ,@body) +> + (kill-buffer buf))))) +> +> (defun notmuch-show-turn-on-visual-line-mode () +> "Enable Visual Line mode." +> -- +> 2.1.3 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2