Re: [PATCH v4 16/16] add "notmuch reindex" subcommand
[notmuch-archives.git] / c0 / 87bce4528ad55222688c200c125be3b320c2c7
1 Return-Path: <dme@dme.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 3DDBB6DE1410\r
6  for <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 09:28:05 -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.135\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.135 tagged_above=-999 required=5\r
12  tests=[AWL=-0.068, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
13  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
14  RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=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 mWF2-dHVqu86 for <notmuch@notmuchmail.org>;\r
19  Mon,  7 Mar 2016 09:28:02 -0800 (PST)\r
20 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com\r
21  [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 80BFB6DE140C for\r
22  <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 09:28:02 -0800 (PST)\r
23 Received: by mail-wm0-f65.google.com with SMTP id n186so12014592wmn.0\r
24  for <notmuch@notmuchmail.org>; Mon, 07 Mar 2016 09:28:02 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26  d=dme-org.20150623.gappssmtp.com; s=20150623;\r
27  h=to:subject:in-reply-to:references:from:date:message-id:mime-version;\r
28  bh=GNwpdXSLiM+UxMJnuNc2HuVYsX/c4T7P/N8FhRIZ5Eg=;\r
29  b=BtD0qEGA9Z92IfCaFQrh7S0nFCwaJMVGBgPt5plGOollAb5Wz6GFxJ1lD0uplH/Um7\r
30  nJ36jdWajx1uHAhDh2+WG21b/csidLMR93f+Xz78GXedbBI2jwn71o+ASAOewt9ipwb1\r
31  PtHDZZRMovn39mxJudC6b4FZBLlZExUfkgeOResHuFofmGGuijnGqqEfGo0BS0qZNupO\r
32  dw8QRdmQVqQlxBcl6hZjoznC8YsHBV3uyoYH92fKA3EM//JdIazh7T3WrqjeerlqvIbt\r
33  b44iJEwBtEp3tAzmZcjBarD9QX+QVEtTYp7wEnfhYlJmnpY+aRz7T3y9J2RPMQ2SmPPl\r
34  RRTQ==\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
36  d=1e100.net; s=20130820;\r
37  h=x-gm-message-state:to:subject:in-reply-to:references:from:date\r
38  :message-id:mime-version;\r
39  bh=GNwpdXSLiM+UxMJnuNc2HuVYsX/c4T7P/N8FhRIZ5Eg=;\r
40  b=matW3LSngeSjJpWX0k7yfMnPYrW4aq+cI0n+pLyG1eZrVP2csW4OQufX9+DU8z1swc\r
41  Hkx1JbCOrT7cX3zBwDzxKH2cxc6AvFFDyfYU5p4usFYJXooDaQi5AF4cifAscZBe71X2\r
42  SwDm2b/ReI6dZrjPQUkHnb22jlqelPb2B9QETNFEzEKh3MhfDLondiqaD7Y9yU7AjgMO\r
43  Gc6gE8LmTkFh3brsRFmr00N43bsc2m+fXf80SHAJA0EdJtWkO3bE89IXMHip1NyWYJwY\r
44  hf6Zfw3gcof6HLIgfndQVNjTp+2UvJMiXmD4U8BwmwlZBYJttkOQ5GSLRVqgYWe52Y4X\r
45  Gq/w==\r
46 X-Gm-Message-State:\r
47  AD7BkJKsKv8HxgNdcpjPo1ZpfmHJfQ2tCSMhnoPIIkdW95rWsFwv9AO8mBncO1z4THgj6Q==\r
48 X-Received: by 10.28.17.141 with SMTP id 135mr2839440wmr.48.1457371681162;\r
49  Mon, 07 Mar 2016 09:28:01 -0800 (PST)\r
50 Received: from disaster-area.hh.sledj.net\r
51  ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
52  by smtp.gmail.com with ESMTPSA id t3sm19023974wjz.11.2016.03.07.09.27.59\r
53  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
54  Mon, 07 Mar 2016 09:27:59 -0800 (PST)\r
55 Received: from localhost (disaster-area.hh.sledj.net [local])\r
56  by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 3f2f74c1;\r
57  Mon, 7 Mar 2016 17:27:58 +0000 (UTC)\r
58 To: Jani Nikula <jani@nikula.org>, Mark Walters <markwalters1009@gmail.com>,\r
59  notmuch@notmuchmail.org\r
60 Subject: Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a\r
61  header in citations.\r
62 In-Reply-To: <87y49uqkc3.fsf@nikula.org>\r
63 References: <1455992680-24978-1-git-send-email-markwalters1009@gmail.com>\r
64  <1455992680-24978-7-git-send-email-markwalters1009@gmail.com>\r
65  <87y49uqkc3.fsf@nikula.org>\r
66 From: David Edmondson <dme@dme.org>\r
67 Date: Mon, 07 Mar 2016 17:27:58 +0000\r
68 Message-ID: <m2a8maurj5.fsf@dme.org>\r
69 MIME-Version: 1.0\r
70 Content-Type: text/plain\r
71 X-BeenThere: notmuch@notmuchmail.org\r
72 X-Mailman-Version: 2.1.20\r
73 Precedence: list\r
74 List-Id: "Use and development of the notmuch mail system."\r
75  <notmuch.notmuchmail.org>\r
76 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
77  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
78 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
79 List-Post: <mailto:notmuch@notmuchmail.org>\r
80 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
81 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
82  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
83 X-List-Received-Date: Mon, 07 Mar 2016 17:28:05 -0000\r
84 \r
85 On Mon, Mar 07 2016, Jani Nikula wrote:\r
86 > On Sat, 20 Feb 2016, Mark Walters <markwalters1009@gmail.com> wrote:\r
87 >> [ text/plain ]\r
88 >\r
89 > This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify\r
90 > which parts get a header in citations.) causes the above to be added to\r
91 > all replies. Why?\r
92 >\r
93 > I don't understand what "header" the patch is talking about. If it's the\r
94 > [ text/plain ] above and it's intentional, *shudder*. Who would want\r
95 > that?\r
96 \r
97 We definitely argued about it ages ago (and Mark pointed out as much in\r
98 his introduction to the patch series), but I don't remember which\r
99 position I took then :-)\r
100 \r
101 Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better\r
102 default.\r
103 \r
104 > BR,\r
105 > Jani.\r
106 >\r
107 >\r
108 >> From: David Edmondson <dme@dme.org>\r
109 >>\r
110 >> Add a customizable function specifying which parts get a header when\r
111 >> replying, and give some sensible possiblities. These are,\r
112 >>\r
113 >> 1) all parts except multipart/*. (Subparts of a multipart part do\r
114 >> receive a header button.)\r
115 >>\r
116 >> 2) only included text/* parts.\r
117 >>\r
118 >> 3) Exactly as in the show buffer.\r
119 >>\r
120 >> 4) None at all. This means the reply contains a mish-mash of all the\r
121 >> original message's parts.\r
122 >>\r
123 >> In the test suite we set the choice to option 4 to match the\r
124 >> previous behaviour.\r
125 >> ---\r
126 >>  emacs/notmuch-mua.el  | 19 ++++++++++++++++++-\r
127 >>  emacs/notmuch-show.el | 10 ++++++++++\r
128 >>  test/test-lib.el      |  4 ++++\r
129 >>  3 files changed, 32 insertions(+), 1 deletion(-)\r
130 >>\r
131 >> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
132 >> index ecc5bec..fcb3e95 100644\r
133 >> --- a/emacs/notmuch-mua.el\r
134 >> +++ b/emacs/notmuch-mua.el\r
135 >> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original\r
136 >>    :link '(custom-manual "(message)Insertion Variables")\r
137 >>    :group 'notmuch-reply)\r
138 >>  \r
139 >> +(defcustom notmuch-mua-reply-insert-header-p-function\r
140 >> +  'notmuch-show-reply-insert-header-p-trimmed\r
141 >> +  "Function to decide which parts get a header when replying.\r
142 >> +\r
143 >> +This function specifies which parts of a mime message with\r
144 >> +mutiple parts get a header."\r
145 >> +  :type '(radio (const :tag "All except multipart/* and hidden parts"\r
146 >> +                           notmuch-show-reply-insert-header-p-trimmed)\r
147 >> +            (const :tag "Only for included text parts"\r
148 >> +                           notmuch-show-reply-insert-header-p-minimal)\r
149 >> +            (const :tag "Exactly as in show view"\r
150 >> +                           notmuch-show-insert-header-p)\r
151 >> +            (const :tag "No part headers"\r
152 >> +                           notmuch-show-reply-insert-header-p-never)\r
153 >> +            (function :tag "Other"))\r
154 >> +  :group 'notmuch-reply)\r
155 >> +\r
156 >>  ;;\r
157 >>  \r
158 >>  (defun notmuch-mua-get-switch-function ()\r
159 >> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
160 >>                     ;; Don't omit long parts.\r
161 >>                     (notmuch-show-max-text-part-size 0)\r
162 >>                     ;; Insert headers for parts as appropriate for replying.\r
163 >> -                   (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never))\r
164 >> +                   (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))\r
165 >>                  (notmuch-show-insert-body original (plist-get original :body) 0)\r
166 >>                  (buffer-substring-no-properties (point-min) (point-max)))))\r
167 >>  \r
168 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
169 >> index 2a81ec1..371e62d 100644\r
170 >> --- a/emacs/notmuch-show.el\r
171 >> +++ b/emacs/notmuch-show.el\r
172 >> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide)\r
173 >>  (defun notmuch-show-reply-insert-header-p-never (part hide)\r
174 >>    nil)\r
175 >>  \r
176 >> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)\r
177 >> +  (let ((mime-type (notmuch-show-mime-type part)))\r
178 >> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))\r
179 >> +     (not hide))))\r
180 >> +\r
181 >> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)\r
182 >> +  (let ((mime-type (notmuch-show-mime-type part)))\r
183 >> +    (and (notmuch-match-content-type mime-type "text/*")\r
184 >> +     (not hide))))\r
185 >> +\r
186 >>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
187 >>    "Insert the body part PART at depth DEPTH in the current thread.\r
188 >>  \r
189 >> diff --git a/test/test-lib.el b/test/test-lib.el\r
190 >> index 596a705..02e020c 100644\r
191 >> --- a/test/test-lib.el\r
192 >> +++ b/test/test-lib.el\r
193 >> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body)\r
194 >>  (setq notmuch-tag-deleted-formats\r
195 >>        '((".*" nil)))\r
196 >>  \r
197 >> +;; For historical reasonse we don't print part headers when replying\r
198 >> +;; in the tests suite\r
199 >> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never)\r
200 >> +\r
201 >>  ;; force a common html renderer, to avoid test variations between\r
202 >>  ;; environments\r
203 >>  \r
204 >> -- \r
205 >> 2.1.4\r
206 >>\r
207 >> _______________________________________________\r
208 >> notmuch mailing list\r
209 >> notmuch@notmuchmail.org\r
210 >> https://notmuchmail.org/mailman/listinfo/notmuch\r
211 > _______________________________________________\r
212 > notmuch mailing list\r
213 > notmuch@notmuchmail.org\r
214 > https://notmuchmail.org/mailman/listinfo/notmuch\r