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 8650D431FAE for ; Mon, 17 Nov 2014 23:03:25 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001] 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 qDgqLi8+-QzZ for ; Mon, 17 Nov 2014 23:03:20 -0800 (PST) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7DAE7431FB6 for ; Mon, 17 Nov 2014 23:03:20 -0800 (PST) Received: by mail-wi0-f169.google.com with SMTP id r20so4641800wiv.2 for ; Mon, 17 Nov 2014 23:03:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:from:to:subject:date:message-id; bh=nTcUTeONsIoHZg90ncFBFtegIMwiRGe1mFxIndP7uts=; b=OZbQlA0+dUw4xxSu0tmPyQhdMT5QU/D3AN1KgKb6Z0Uct0e6Als/yZM3ff86FrejKx qvJ60KeUJrrDFdXieqj3KVZS5HuifudSJyRV7SZcWjc18ZNIJw20KKkLoxWl4H6fQtdB y5J3uP1304xFtiLbjYLah+bGbKSMsBfFYOs8OFO1PHk05bywUzQGfVuONkLCzA6+mYvA wLXPSHYlZXwkoFar9kuF2cNXSvnLgve/UkUbwme7VHQv+Wqfvs+bkiMCXyX2pMQBkKjB olXrGSMhckXI6Ec0M/cPzmrUlQWAyBqVMnMwlaXANmBOLrjXJC+EwxE6GR0mLkZ7lRBE VBrg== X-Gm-Message-State: ALoCoQkGRkFjIcsy2l7rdbS3t3TOJbR5q8lAxEaErLGJ5J5+UmyiIA/jidsM65rKOyZFa8/m+lrN X-Received: by 10.194.185.68 with SMTP id fa4mr43906968wjc.83.1416294199167; Mon, 17 Nov 2014 23:03:19 -0800 (PST) Received: from disaster-area.hh.sledj.net ([2a01:348:1a2:1:ea39:35ff:fe2c:a227]) by mx.google.com with ESMTPSA id kn5sm46987420wjb.48.2014.11.17.23.03.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 23:03:18 -0800 (PST) Received: from localhost (30000@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id 44a161b1; for ; Tue, 18 Nov 2014 07:03:17 +0000 (UTC) User-Agent: OpenSMTPD enqueuer (Demoostik) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v1] emacs: `with-current-notmuch-show-message' should not leak `coding-system-for-read' Date: Tue, 18 Nov 2014 07:03:17 +0000 Message-Id: <1416294197-3170-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 2.1.3 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: Tue, 18 Nov 2014 07:03:25 -0000 `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. --- 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