1 Return-Path: <too@guru-group.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id CE81B431FC2
\r
6 for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 12:06:30 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id I0UOfxgbIojp for <notmuch@notmuchmail.org>;
\r
16 Sun, 18 Nov 2012 12:06:30 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id DBB62431FBD
\r
19 for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 12:06:29 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id 81A1F10014D; Sun, 18 Nov 2012 22:06:28 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH 2/2] emacs: less guessing of character set in messages
\r
25 Date: Sun, 18 Nov 2012 22:06:25 +0200
\r
26 Message-Id: <1353269185-23210-2-git-send-email-tomi.ollila@iki.fi>
\r
27 X-Mailer: git-send-email 1.8.0
\r
28 In-Reply-To: <1353269185-23210-1-git-send-email-tomi.ollila@iki.fi>
\r
29 References: <id:87txsm23hs.fsf@betacantrips.com>
\r
30 <1353269185-23210-1-git-send-email-tomi.ollila@iki.fi>
\r
31 Cc: tomi.ollila@iki.fi
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Sun, 18 Nov 2012 20:06:31 -0000
\r
46 The macro with-current-notmuch-show-message executes command
\r
47 `notmuch show --format=raw id:...` which just outputs the contents
\r
48 of the mail file verbatim (into temporary buffer). In case e.g. utf-8
\r
49 locale is used the temporary buffer has buffer-file-coding-system as
\r
50 utf-8. In this case Emacs converts the data to multibyte format, guessing
\r
51 that input is in utf-8.
\r
52 However, the "raw" (MIME) message may contain octet data in any other
\r
53 8bit format, and as no (MIME-)content spesific handling to the message
\r
54 is done at this point, conversion to other formats may lose information.
\r
55 By setting coding-system-for-read 'no-conversion drops the conversion part
\r
56 and makes this handle input as notmuch-get-bodypart-internal() does.
\r
57 This marks the broken test in previous change fixed.
\r
59 emacs/notmuch-show.el | 7 ++++---
\r
60 1 file changed, 4 insertions(+), 3 deletions(-)
\r
62 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
63 index 5b3e70e..44b6f35 100644
\r
64 --- a/emacs/notmuch-show.el
\r
65 +++ b/emacs/notmuch-show.el
\r
66 @@ -203,9 +203,10 @@ For example, if you wanted to remove an \"unread\" tag and add a
\r
67 (let ((id (notmuch-show-get-message-id)))
\r
68 (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
\r
69 (with-current-buffer buf
\r
70 - (call-process notmuch-command nil t nil "show" "--format=raw" id)
\r
72 - (kill-buffer buf)))))
\r
73 + (let ((coding-system-for-read 'no-conversion))
\r
74 + (call-process notmuch-command nil t nil "show" "--format=raw" id)
\r
76 + (kill-buffer buf))))))
\r
78 (defun notmuch-show-turn-on-visual-line-mode ()
\r
79 "Enable Visual Line mode."
\r