unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH v1] emacs: `with-current-notmuch-show-message' should not leak	`coding-system-for-read'
Date: Wed, 19 Nov 2014 13:06:50 +0200	[thread overview]
Message-ID: <m2389fsb3p.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1416294197-3170-1-git-send-email-dme@dme.org>

On Tue, Nov 18 2014, David Edmondson <dme@dme.org> 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

  reply	other threads:[~2014-11-19 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  7:03 [PATCH v1] emacs: `with-current-notmuch-show-message' should not leak `coding-system-for-read' David Edmondson
2014-11-19 11:06 ` Tomi Ollila [this message]
2014-11-28  7:08 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2389fsb3p.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).