diff options
author | Tomi Ollila <tomi.ollila@iki.fi> | 2012-11-18 22:06:25 +0200 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-11-26 22:06:41 -0400 |
commit | 59c994e770581acb8effde7057d09823e1194830 (patch) | |
tree | dfc7baf5505959e57cdd0a322120d05ba7a50c43 /emacs | |
parent | 0c4dea4e48c4b8c7f9e7a4a19e983b3c0ca81be3 (diff) |
emacs: less guessing of character set in messages
The macro with-current-notmuch-show-message executes command
`notmuch show --format=raw id:...` which just outputs the contents
of the mail file verbatim (into temporary buffer). In case e.g. utf-8
locale is used the temporary buffer has buffer-file-coding-system as
utf-8. In this case Emacs converts the data to multibyte format, guessing
that input is in utf-8.
However, the "raw" (MIME) message may contain octet data in any other
8bit format, and as no (MIME-)content spesific handling to the message
is done at this point, conversion to other formats may lose information.
By setting coding-system-for-read 'no-conversion drops the conversion part
and makes this handle input as notmuch-get-bodypart-internal() does.
This marks the broken test in previous change fixed.
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/notmuch-show.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 24db4c70..489e32c8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -203,9 +203,10 @@ For example, if you wanted to remove an \"unread\" tag and add a (let ((id (notmuch-show-get-message-id))) (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*")))) (with-current-buffer buf - (call-process notmuch-command nil t nil "show" "--format=raw" id) - ,@body) - (kill-buffer buf))))) + (let ((coding-system-for-read 'no-conversion)) + (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." |