Re: [PATCH 3/5] nmbug-status: Add an nmbug-status(5) man page
[notmuch-archives.git] / 74 / 7aadc0f76f7e2ee1e092ac46ebbf8ecb20cab9
1 Return-Path: <amdragon@mit.edu>\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 ACDFD431FD7\r
6         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 15:18:26 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 XmqYAmR2v1iX for <notmuch@notmuchmail.org>;\r
16         Tue, 12 Nov 2013 15:18:21 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu\r
18         [18.7.68.35])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id E1292431FCF\r
22         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 15:18:20 -0800 (PST)\r
23 X-AuditID: 12074423-b7f2b6d000000ce1-d9-5282b73c0979\r
24 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id D7.75.03297.C37B2825; Tue, 12 Nov 2013 18:18:20 -0500 (EST)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id rACNIIHa012266; \r
31         Tue, 12 Nov 2013 18:18:19 -0500\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
33         (authenticated bits=0)\r
34         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
35         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rACNIHIZ001869\r
36         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
37         Tue, 12 Nov 2013 18:18:18 -0500\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
39         (envelope-from <amdragon@mit.edu>)\r
40         id 1VgNDt-0007DC-46; Tue, 12 Nov 2013 18:18:17 -0500\r
41 Date: Tue, 12 Nov 2013 18:18:17 -0500\r
42 From: Austin Clements <amdragon@MIT.EDU>\r
43 To: Jameson Graef Rollins <jrollins@finestructure.net>\r
44 Subject: Re: [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'\r
45 Message-ID: <20131112231817.GE13399@mit.edu>\r
46 References: <1382471457-26056-1-git-send-email-amdragon@mit.edu>\r
47         <1382471457-26056-9-git-send-email-amdragon@mit.edu>\r
48         <8761s9gfpm.fsf@servo.finestructure.net>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 Content-Disposition: inline\r
52 In-Reply-To: <8761s9gfpm.fsf@servo.finestructure.net>\r
53 User-Agent: Mutt/1.5.21 (2010-09-15)\r
54 X-Brightmail-Tracker:\r
55  H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1rXZ3hRkMG8Or8WefV4W12/OZHZg\r
56         8rh7msvj2apbzAFMUVw2Kak5mWWpRfp2CVwZOz5/YC9o06mYd30uSwNjn3IXIyeHhICJxO1d\r
57         G5ggbDGJC/fWs3UxcnEICcxmkpi0+hM7hLORUeLfuh1QmdNMElseb2KGcJYAZY4eZQbpZxFQ\r
58         lfj+eTnYLDYBDYlt+5czgtgiAmYSPV/+gNnMAtIS3343A9VwcAgL+EhsmsQLEuYV0JE43b2b\r
59         CWLmIkaJM3+Xs0MkBCVOznzCAtGrJXHj30uwXpA5y/9xgIQ5BUwl9r7exgZiiwqoSEw5uY1t\r
60         AqPQLCTds5B0z0LoXsDIvIpRNiW3Sjc3MTOnODVZtzg5MS8vtUjXTC83s0QvNaV0EyMoqNld\r
61         lHcw/jmodIhRgINRiYfXIqYpSIg1say4MvcQoyQHk5Ior/xWoBBfUn5KZUZicUZ8UWlOavEh\r
62         RgkOZiUR3gMgOd6UxMqq1KJ8mJQ0B4uSOO8tDvsgIYH0xJLU7NTUgtQimKwMB4eSBG8KSKNg\r
63         UWp6akVaZk4JQpqJgxNkOA/Q8Daw4cUFibnFmekQ+VOMilLivEu3ASUEQBIZpXlwvbCk84pR\r
64         HOgVYV4GkCoeYMKC634FNJgJaLBFMdjgkkSElFQDI8tsv3aF7zW2Ow4qvlghNalK567jjkN2\r
65         IheDz6rOeMRgcOBY+cYrzDEuygduavzSEPi/LiHNJFnSXPpE77LLNgv0Cq7s+Ne7spKF477w\r
66         FTm+Zz+489livZb4XJ1wKk13Qkn6j+45x/Tnsds1Vhnzbi60tRFZk/Dq4uumVYVSd1X6ov+o\r
67         StmtVmIpzkg01GIuKk4EAAr6cJ0VAwAA\r
68 Cc: notmuch@notmuchmail.org\r
69 X-BeenThere: notmuch@notmuchmail.org\r
70 X-Mailman-Version: 2.1.13\r
71 Precedence: list\r
72 List-Id: "Use and development of the notmuch mail system."\r
73         <notmuch.notmuchmail.org>\r
74 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
76 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
77 List-Post: <mailto:notmuch@notmuchmail.org>\r
78 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
79 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
80         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
81 X-List-Received-Date: Tue, 12 Nov 2013 23:18:26 -0000\r
82 \r
83 Quoth Jameson Graef Rollins on Nov 03 at  4:42 pm:\r
84 > On Tue, Oct 22 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
85 > > We no longer use this, since we've lifted all interactive behavior to\r
86 > > the appropriate interactive entry points.  Because of this,\r
87 > > `notmuch-tag' also no longer needs to return the tag changes list,\r
88 > > since the caller always passes it in.\r
89 > > ---\r
90 > >  emacs/notmuch-tag.el | 19 ++++---------------\r
91 > >  1 file changed, 4 insertions(+), 15 deletions(-)\r
92 > >\r
93 > > diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
94 > > index f9c1740..feee17c 100644\r
95 > > --- a/emacs/notmuch-tag.el\r
96 > > +++ b/emacs/notmuch-tag.el\r
97 > > @@ -249,27 +249,18 @@ from TAGS if present."\r
98 > >        (error "Changed tag must be of the form `+this_tag' or `-that_tag'")))))\r
99 > >      (sort result-tags 'string<)))\r
100 > >  \r
101 > > -(defun notmuch-tag (query &optional tag-changes)\r
102 > > +(defun notmuch-tag (query tag-changes)\r
103 > >    "Add/remove tags in TAG-CHANGES to messages matching QUERY.\r
104 > >  \r
105 > >  QUERY should be a string containing the search-terms.\r
106 > > -TAG-CHANGES can take multiple forms.  If TAG-CHANGES is a list of\r
107 > > -strings of the form \"+tag\" or \"-tag\" then those are the tag\r
108 > > -changes applied.  If TAG-CHANGES is a string then it is\r
109 > > -interpreted as a single tag change.  If TAG-CHANGES is the string\r
110 > > -\"-\" or \"+\", or null, then the user is prompted to enter the\r
111 > > -tag changes.\r
112 > > +TAG-CHANGES is a list of strings of the form \"+tag\" or\r
113 > > +\"-tag\" to add or remove tags, respectively.\r
114 > >  \r
115 > >  Note: Other code should always use this function alter tags of\r
116 > >  messages instead of running (notmuch-call-notmuch-process \"tag\" ..)\r
117 > >  directly, so that hooks specified in notmuch-before-tag-hook and\r
118 > >  notmuch-after-tag-hook will be run."\r
119 > >    ;; Perform some validation\r
120 > > -  (if (string-or-null-p tag-changes)\r
121 > > -      (if (or (string= tag-changes "-") (string= tag-changes "+") (null tag-changes))\r
122 > > -     (setq tag-changes (notmuch-read-tag-changes\r
123 > > -                        (notmuch-tag-completions query) nil tag-changes))\r
124 > > -   (setq tag-changes (list tag-changes))))\r
125\r
126 > Hey folks.  After a recent upgrade to 0.16+120~gfd733a4+1 I found that\r
127 > my custom tagging functions weren't working, which I traced back to the\r
128 > removal of this section.\r
129\r
130 > Previously notmuch-tag accepted tag changes in two forms: as a list of\r
131 > tag changes:\r
132\r
133 > (list "+foo" "-bar")\r
134\r
135 > or as a space-separated string:\r
136\r
137 > "+foo -bar"\r
138\r
139 > This removed section is what would turn the space-separated string into\r
140 > a list.\r
141\r
142 > I have custom tagging functions that were written like this:\r
143\r
144 > (notmuch-search-tag "+spam")\r
145\r
146 > notmuch-search-tag passes the TAG-CHANGES to notmuch-tag, which was\r
147 > changing it to a list in this removed section.  Since its removal, all\r
148 > of my custom functions started throwing the following error:\r
149\r
150 > Wrong type argument: stringp, 43\r
151\r
152 > I didn't pay super close attention to the rest of the patch series, but\r
153 > From a backwards compatibility point of view, do we really need to\r
154 > remove this section?  Is there a problem with specifying tag changes as\r
155 > a string?  I think it was actually me that last modified notmuch-tag,\r
156 > and I vaguely remember spending time thinking about how to preserve that\r
157 > particular way to specify the changes, so that things would be simpler\r
158 > for simple tag operations.\r
159 \r
160 The difficulty is that notmuch-tag used to play a dual role of both\r
161 parsing the space-separated string into a list of tag changes and\r
162 actually performing the tagging operation and, as a result, other\r
163 functions that were rooted in notmuch-tag also accepted both (though\r
164 functions that weren't, like notmuch-update-tags, required the list\r
165 form).  This dual role was strange from an API perspective, but also,\r
166 because of other restructuring, notmuch-tag is no longer at the core\r
167 of many operations, so it's not in a good position to be a parser.\r
168 \r
169 Hence, while we could make `notmuch-tag' itself support the string\r
170 form, if we wanted this to work from other tagging entry-points, we'd\r
171 need to support both forms in all of the tagging functions.  This\r
172 would be doable, but it would be messy, and without the single parsing\r
173 point it would be difficult to maintain.\r
174 \r
175 > In any event, some amount of backwards compatibility has been removed,\r
176 > so if we do want to keep it removed, we should add a good NEWS item to\r
177 > explain that peoples custom bindings might break.\r
178 \r
179 I'd rather keep the backwards compatibility removed, but you're\r
180 definitely right that we need a good NEWS item for it.  I've posted a\r
181 NEWS item in id:1384296252-17884-1-git-send-email-amdragon@mit.edu,\r
182 but let me know if you think it can be clearer or more helpful.\r
183 \r
184 > jamie.\r
185\r
186 > >    (mapc (lambda (tag-change)\r
187 > >       (unless (string-match-p "^[-+]\\S-+$" tag-change)\r
188 > >         (error "Tag must be of the form `+this_tag' or `-that_tag'")))\r
189 > > @@ -278,9 +269,7 @@ notmuch-after-tag-hook will be run."\r
190 > >      (run-hooks 'notmuch-before-tag-hook)\r
191 > >      (apply 'notmuch-call-notmuch-process "tag"\r
192 > >        (append tag-changes (list "--" query)))\r
193 > > -    (run-hooks 'notmuch-after-tag-hook))\r
194 > > -  ;; in all cases we return tag-changes as a list\r
195 > > -  tag-changes)\r
196 > > +    (run-hooks 'notmuch-after-tag-hook)))\r
197 > >  \r
198 > >  (defun notmuch-tag-change-list (tags &optional reverse)\r
199 > >    "Convert TAGS into a list of tag changes.\r
200 > >\r
201 > > _______________________________________________\r
202 > > notmuch mailing list\r
203 > > notmuch@notmuchmail.org\r
204 > > http://notmuchmail.org/mailman/listinfo/notmuch\r