Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 66 / e7cc2fa20b130713a25a997de20793e60826f2
1 Return-Path: <jani@nikula.org>\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 00BDB6DE177E\r
6  for <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 11:17:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.554\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.554 tagged_above=-999 required=5 tests=[AWL=0.166,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
13  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id OuRxEZclb3m7 for <notmuch@notmuchmail.org>;\r
17  Mon,  7 Mar 2016 11:17:06 -0800 (PST)\r
18 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
19  [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 257936DE176A for\r
20  <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 11:17:06 -0800 (PST)\r
21 Received: by mail-wm0-f67.google.com with SMTP id 1so12481338wmg.2\r
22  for <notmuch@notmuchmail.org>; Mon, 07 Mar 2016 11:17:06 -0800 (PST)\r
23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
24  d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
25  h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
26  :mime-version; bh=cpR0y2ylHbM8t5j3BxKw/RNL/Iq1ZQTyeKZ8GmGR4cg=;\r
27  b=0+Yx1nlRVU5gZ5qHXAnmDW7nEgS0qJgKSVDTNuaVm0/Iqip17ADVvqkMNYO77px1Bm\r
28  CprONktmXXpCkD3qXJpLj68xpN0nWqgyxB0R/OzmyDnHYaWDX+GcnudHH91L6wcb4owR\r
29  f/bMeEgGAXOiy0Bs7gfOLMjUe0G9BLxLxDkJqBK5/6QlYi+qqgCWY91xuHcBpms5Z27q\r
30  ye8xiHbTBD+cATLV/KUMcCOM+Kbef8MYJeJTES+r/5D76+2CuNAn2NbeMhkAwwATU2OR\r
31  tiQavnk9k+580ZQto0ijvlnx+5M7W2b/PNzT695ZTWA36ZEnxd+Wu08Y+mAxVgwa+cy2\r
32  IjiA==\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
34  d=1e100.net; s=20130820;\r
35  h=x-gm-message-state:from:to:subject:in-reply-to:references\r
36  :user-agent:date:message-id:mime-version;\r
37  bh=cpR0y2ylHbM8t5j3BxKw/RNL/Iq1ZQTyeKZ8GmGR4cg=;\r
38  b=WY3JWC02KvmRq1/utS5US9bqn8CKiv+sOhLEQFsJ0ZJlFotUYOeychLoiAfq2uYmuY\r
39  FvGQ9hriks6zN8n07ZoQ7fNhJAnGtUkmBZW/Wzt0IdGx/3fkIxtB5VhbJTRw5TFeheWi\r
40  ZlPr4DR/nh5/L5tECN3f5W5uORriW5/bNO/uzPdo0bX+8cui2HEf+36x6WwGIWdx+0IG\r
41  mvawfa3XRglPoJucUaf3svWMZuq4QkL4ydjTX5IFMRMXVsC+XnMb3hSzVqNKVX0wwtjH\r
42  t0EANEAPnc7pHiE5FKg6KzPki6obqs0C3+QUe2VUtQiLkaAaLI2vecRpaGy4nUwvzCh3\r
43  NKWQ==\r
44 X-Gm-Message-State:\r
45  AD7BkJLHlF3jRJb0nIy0tr19MHTOQCjeebAub8GpSYU+UB7PYcARZ9YAAtfzJguNs9wGFg==\r
46 X-Received: by 10.194.191.199 with SMTP id ha7mr24602900wjc.128.1457378224891;\r
47   Mon, 07 Mar 2016 11:17:04 -0800 (PST)\r
48 Received: from localhost (mobile-access-bcee39-255.dhcp.inet.fi.\r
49  [188.238.57.255])\r
50  by smtp.gmail.com with ESMTPSA id gk4sm19399733wjd.7.2016.03.07.11.17.03\r
51  (version=TLSv1/SSLv3 cipher=OTHER);\r
52  Mon, 07 Mar 2016 11:17:03 -0800 (PST)\r
53 From: Jani Nikula <jani@nikula.org>\r
54 To: David Edmondson <dme@dme.org>, Mark Walters <markwalters1009@gmail.com>,\r
55  notmuch@notmuchmail.org\r
56 Subject: Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a\r
57  header in citations.\r
58 In-Reply-To: <m2a8maurj5.fsf@dme.org>\r
59 References: <1455992680-24978-1-git-send-email-markwalters1009@gmail.com>\r
60  <1455992680-24978-7-git-send-email-markwalters1009@gmail.com>\r
61  <87y49uqkc3.fsf@nikula.org> <m2a8maurj5.fsf@dme.org>\r
62 User-Agent: Notmuch/0.21+73~gf8cc320 (http://notmuchmail.org) Emacs/24.4.1\r
63  (x86_64-pc-linux-gnu)\r
64 Date: Mon, 07 Mar 2016 21:16:01 +0200\r
65 Message-ID: <8760wy5cb2.fsf@nikula.org>\r
66 MIME-Version: 1.0\r
67 Content-Type: text/plain\r
68 X-BeenThere: notmuch@notmuchmail.org\r
69 X-Mailman-Version: 2.1.20\r
70 Precedence: list\r
71 List-Id: "Use and development of the notmuch mail system."\r
72  <notmuch.notmuchmail.org>\r
73 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
74  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
76 List-Post: <mailto:notmuch@notmuchmail.org>\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
78 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
79  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
80 X-List-Received-Date: Mon, 07 Mar 2016 19:17:09 -0000\r
81 \r
82 On Mon, 07 Mar 2016, David Edmondson <dme@dme.org> wrote:\r
83 > On Mon, Mar 07 2016, Jani Nikula wrote:\r
84 >> On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:\r
85 >>> [ text/plain ]\r
86 >>\r
87 >> This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify\r
88 >> which parts get a header in citations.) causes the above to be added to\r
89 >> all replies. Why?\r
90 >>\r
91 >> I don't understand what "header" the patch is talking about. If it's the\r
92 >> [ text/plain ] above and it's intentional, *shudder*. Who would want\r
93 >> that?\r
94 >\r
95 > We definitely argued about it ages ago (and Mark pointed out as much in\r
96 > his introduction to the patch series), but I don't remember which\r
97 > position I took then :-)\r
98 >\r
99 > Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better\r
100 > default.\r
101 \r
102 I'm not sure. Replying to a message with multipart/alternative and\r
103 hidden parts and attachments leads to quite a mess, to be honest (which,\r
104 I presume, is the reason for the current default).\r
105 \r
106 I'll set it to no part headers, but I might find an option to insert\r
107 part headers for parts with "content-disposition: attachment"\r
108 interesting. Either that, or the current default plus no headers for\r
109 single part messages.\r
110 \r
111 BR,\r
112 Jani.\r
113 \r
114 \r
115 >\r
116 >> BR,\r
117 >> Jani.\r
118 >>\r
119 >>\r
120 >>> From: David Edmondson <dme@dme.org>\r
121 >>>\r
122 >>> Add a customizable function specifying which parts get a header when\r
123 >>> replying, and give some sensible possiblities. These are,\r
124 >>>\r
125 >>> 1) all parts except multipart/*. (Subparts of a multipart part do\r
126 >>> receive a header button.)\r
127 >>>\r
128 >>> 2) only included text/* parts.\r
129 >>>\r
130 >>> 3) Exactly as in the show buffer.\r
131 >>>\r
132 >>> 4) None at all. This means the reply contains a mish-mash of all the\r
133 >>> original message's parts.\r
134 >>>\r
135 >>> In the test suite we set the choice to option 4 to match the\r
136 >>> previous behaviour.\r
137 >>> ---\r
138 >>>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-\r
139 >>>  emacs/notmuch-show.el | 10 ++++++++++\r
140 >>>  test/test-lib.el      |  4 ++++\r
141 >>>  3 files changed, 32 insertions(+), 1 deletion(-)\r
142 >>>\r
143 >>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
144 >>> index ecc5bec..fcb3e95 100644\r
145 >>> --- a/emacs/notmuch-mua.el\r
146 >>> +++ b/emacs/notmuch-mua.el\r
147 >>> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original\r
148 >>>    :link '(custom-manual "(message)Insertion Variables")\r
149 >>>    :group 'notmuch-reply)\r
150 >>>  \r
151 >>> +(defcustom notmuch-mua-reply-insert-header-p-function\r
152 >>> +  'notmuch-show-reply-insert-header-p-trimmed\r
153 >>> +  "Function to decide which parts get a header when replying.\r
154 >>> +\r
155 >>> +This function specifies which parts of a mime message with\r
156 >>> +mutiple parts get a header."\r
157 >>> +  :type '(radio (const :tag "All except multipart/* and hidden parts"\r
158 >>> +                          notmuch-show-reply-insert-header-p-trimmed)\r
159 >>> +           (const :tag "Only for included text parts"\r
160 >>> +                          notmuch-show-reply-insert-header-p-minimal)\r
161 >>> +           (const :tag "Exactly as in show view"\r
162 >>> +                          notmuch-show-insert-header-p)\r
163 >>> +           (const :tag "No part headers"\r
164 >>> +                          notmuch-show-reply-insert-header-p-never)\r
165 >>> +           (function :tag "Other"))\r
166 >>> +  :group 'notmuch-reply)\r
167 >>> +\r
168 >>>  ;;\r
169 >>>  \r
170 >>>  (defun notmuch-mua-get-switch-function ()\r
171 >>> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
172 >>>                    ;; Don't omit long parts.\r
173 >>>                    (notmuch-show-max-text-part-size 0)\r
174 >>>                    ;; Insert headers for parts as appropriate for replying.\r
175 >>> -                  (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))\r
176 >>> +                  (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))\r
177 >>>                 (notmuch-show-insert-body original (plist-get original :body) 0)\r
178 >>>                 (buffer-substring-no-properties (point-min) (point-max)))))\r
179 >>>  \r
180 >>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
181 >>> index 2a81ec1..371e62d 100644\r
182 >>> --- a/emacs/notmuch-show.el\r
183 >>> +++ b/emacs/notmuch-show.el\r
184 >>> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)\r
185 >>>  (defun notmuch-show-reply-insert-header-p-never (part hide)\r
186 >>>    nil)\r
187 >>>  \r
188 >>> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)\r
189 >>> +  (let ((mime-type (notmuch-show-mime-type part)))\r
190 >>> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))\r
191 >>> +    (not hide))))\r
192 >>> +\r
193 >>> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)\r
194 >>> +  (let ((mime-type (notmuch-show-mime-type part)))\r
195 >>> +    (and (notmuch-match-content-type mime-type "text/*")\r
196 >>> +    (not hide))))\r
197 >>> +\r
198 >>>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
199 >>>    "Insert the body part PART at depth DEPTH in the current thread.\r
200 >>>  \r
201 >>> diff --git a/test/test-lib.el b/test/test-lib.el\r
202 >>> index 596a705..02e020c 100644\r
203 >>> --- a/test/test-lib.el\r
204 >>> +++ b/test/test-lib.el\r
205 >>> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)\r
206 >>>  (setq notmuch-tag-deleted-formats\r
207 >>>        '((".*" nil)))\r
208 >>>  \r
209 >>> +;; For historical reasonse we don't print part headers when replying\r
210 >>> +;; in the tests suite\r
211 >>> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)\r
212 >>> +\r
213 >>>  ;; force a common html renderer, to avoid test variations between\r
214 >>>  ;; environments\r
215 >>>  \r
216 >>> -- \r
217 >>> 2.1.4\r
218 >>>\r
219 >>> _______________________________________________\r
220 >>> notmuch mailing list\r
221 >>> notmuch@notmuchmail.org\r
222 >>> https://notmuchmail.org/mailman/listinfo/notmuch\r
223 >> _______________________________________________\r
224 >> notmuch mailing list\r
225 >> notmuch@notmuchmail.org\r
226 >> https://notmuchmail.org/mailman/listinfo/notmuch\r