Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 9d / 2c898db4a08fc9021667dc86e83d931ea6de9c
1 Return-Path: <markwalters1009@gmail.com>\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 arlo.cworth.org (Postfix) with ESMTP id E98366DE01BE\r
6  for <notmuch@notmuchmail.org>; Mon,  2 May 2016 00:38:01 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.306\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.306 tagged_above=-999 required=5 tests=[AWL=0.264,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id ng3Vavm_NEhg for <notmuch@notmuchmail.org>;\r
19  Mon,  2 May 2016 00:37:51 -0700 (PDT)\r
20 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com\r
21  [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id B216C6DE00F5 for\r
22  <notmuch@notmuchmail.org>; Mon,  2 May 2016 00:37:50 -0700 (PDT)\r
23 Received: by mail-wm0-f66.google.com with SMTP id n129so15966730wmn.1\r
24  for <notmuch@notmuchmail.org>; Mon, 02 May 2016 00:37:50 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26  h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27  :mime-version; bh=jyUvm/jh9U3EesS14XXW3DOsiSjy9K4/efHfPNiw2M0=;\r
28  b=BA2KHN2n3lRFfAUh2KNR0ai44crcfRTavMDuN1cQOYoxRko6SsJPspOVOxb6dhNi6m\r
29  O/EAh4g9PcD3JPvfspxwUPC3s5G0gFZXa3iilHRnQ+9nic6SssCMTxtwi/OUwqIsKGsJ\r
30  iv1HILx+AFtzNXp+ekEevrBHHulx7blCHByg1Jcf6iM1MCRY+RfDiip7AAVLRdPDN2i3\r
31  z1wy0eIHdv66++lsxDjf86kljlqaUaM+jPi9T+bouoJ+NSfdgVcFQmRYmN1oWdeZUowU\r
32  lZ0oDyY0tdvNwi9z99FG5mCog6twKmKPwIxv0lUPSFtNUU0jf1HkhWzSZf4w5WJ66d0u\r
33  JeMw==\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
35  d=1e100.net; s=20130820;\r
36  h=x-gm-message-state:from:to:subject:in-reply-to:references\r
37  :user-agent:date:message-id:mime-version;\r
38  bh=jyUvm/jh9U3EesS14XXW3DOsiSjy9K4/efHfPNiw2M0=;\r
39  b=g6aLXZZZhBeLi93cmfrWHTlEwRXwhuut2SoXD4FyTEJ2iMkad7dWEin18NSng7eFrC\r
40  0jJKzdxns/HJz3PQ0pPcMfQgR0tXW5bXlfNQnpschvBOXsdbp+BXWb6T847lHjrA2VC1\r
41  +05OmMRw9ZLXhK/xWq1lkDnlN9aM7uoqPcekkgtSeb8OVCux0SOJJesE3fit2HTYedC8\r
42  JSN3bVUamXz47FzyxSionprXUfOGBN0R8OXM/pNg0x75zPYiIG9bIItyoOVAHbpbgKP7\r
43  gBQb/YXqi4Av+r2ivMckugb6Lj8QK60Z5lamZlWcX0+FFTsduaD3+a4k69jC0VKp3sYI\r
44  z3FA==\r
45 X-Gm-Message-State:\r
46  AOPr4FVSIBLECRL/61jKkHKqyun9mUD6ZWRN1TYtXLS/RkDaF/XBAj95PWDo7oe0BAaDzg==\r
47 X-Received: by 10.194.10.162 with SMTP id j2mr34405240wjb.72.1462174668681;\r
48  Mon, 02 May 2016 00:37:48 -0700 (PDT)\r
49 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
50  by smtp.gmail.com with ESMTPSA id y70sm17293483wmd.3.2016.05.02.00.37.47\r
51  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
52  Mon, 02 May 2016 00:37:47 -0700 (PDT)\r
53 From: Mark Walters <markwalters1009@gmail.com>\r
54 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
55 Subject: Re: [PATCH v1 1/2] emacs: Observe the charset of MIME parts when\r
56  reading them.\r
57 In-Reply-To: <1461999108-68582-2-git-send-email-dme@dme.org>\r
58 References: <1461999108-68582-1-git-send-email-dme@dme.org>\r
59  <1461999108-68582-2-git-send-email-dme@dme.org>\r
60 User-Agent: Notmuch/0.22~rc1+2~g56141bf (http://notmuchmail.org) Emacs/24.4.1\r
61  (x86_64-pc-linux-gnu)\r
62 Date: Mon, 02 May 2016 08:37:46 +0100\r
63 Message-ID: <877ffc9agl.fsf@qmul.ac.uk>\r
64 MIME-Version: 1.0\r
65 Content-Type: text/plain\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.20\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70  <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
72  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
77  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Mon, 02 May 2016 07:38:02 -0000\r
79 \r
80 \r
81 On Sat, 30 Apr 2016, David Edmondson <dme@dme.org> wrote:\r
82 > `notmuch--get-bodypart-raw' previously assumed that all non-binary MIME\r
83 > parts could be successfully read by assuming that they were UTF-8\r
84 > encoded. This was demonstrated to be wrong, specifically when a part was\r
85 > marked as ISO8859-1 and included accented characters (which were\r
86 > incorrectly rendered as a result).\r
87 >\r
88 > Rather than assuming UTF-8, attempt to use the part's declared charset\r
89 > when reading it, falling back to US-ASCII if the declared charset is\r
90 > unknown, unsupported or invalid.\r
91 \r
92 As this seemed hard to test (if I understand the bug correctly it didn't\r
93 show up on my test of the entire of the entire performance corpus -- of\r
94 course my testing could have been wrong) would it be possible to add a test\r
95 for it?\r
96 \r
97 Best wishes\r
98 \r
99 Mark\r
100 \r
101 \r
102 > ---\r
103 >  emacs/notmuch-lib.el | 16 +++++++++++++++-\r
104 >  1 file changed, 15 insertions(+), 1 deletion(-)\r
105 >\r
106 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
107 > index 78978ee..f05ded6 100644\r
108 > --- a/emacs/notmuch-lib.el\r
109 > +++ b/emacs/notmuch-lib.el\r
110 > @@ -23,6 +23,7 @@\r
111 >  \r
112 >  ;;; Code:\r
113 >  \r
114 > +(require 'mm-util)\r
115 >  (require 'mm-view)\r
116 >  (require 'mm-decode)\r
117 >  (require 'cl)\r
118 > @@ -572,7 +573,20 @@ the given type."\r
119 >                                  ,@(when process-crypto '("--decrypt"))\r
120 >                                  ,(notmuch-id-to-query (plist-get msg :id))))\r
121 >                          (coding-system-for-read\r
122 > -                         (if binaryp 'no-conversion 'utf-8)))\r
123 > +                         (if binaryp 'no-conversion\r
124 > +                           (let ((coding-system (mm-charset-to-coding-system\r
125 > +                                                 (plist-get part :content-charset))))\r
126 > +                             ;; Sadly,\r
127 > +                             ;; `mm-charset-to-coding-system' seems\r
128 > +                             ;; to return things that are not\r
129 > +                             ;; considered acceptable values for\r
130 > +                             ;; `coding-system-for-read'.\r
131 > +                             (if (coding-system-p coding-system)\r
132 > +                                 coding-system\r
133 > +                               ;; RFC 2047 says that the default\r
134 > +                               ;; charset is US-ASCII. RFC6657\r
135 > +                               ;; complicates this somewhat.\r
136 > +                               'us-ascii)))))\r
137 >                      (apply #'call-process notmuch-command nil '(t nil) nil args)\r
138 >                      (buffer-string))))))\r
139 >      (when (and cache data)\r
140 > -- \r
141 > 2.7.1\r
142 >\r
143 > _______________________________________________\r
144 > notmuch mailing list\r
145 > notmuch@notmuchmail.org\r
146 > https://notmuchmail.org/mailman/listinfo/notmuch\r