Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / 38 / 30956fddfb23f8b1eb88492d70949594b00ca9
1 Return-Path: <jrollins@finestructure.net>\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 1FC79429E4A\r
6         for <notmuch@notmuchmail.org>; Sun,  3 Nov 2013 16:42:44 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 WOHsS55S8A-V for <notmuch@notmuchmail.org>;\r
16         Sun,  3 Nov 2013 16:42:38 -0800 (PST)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id 8F51F429E38\r
20         for <notmuch@notmuchmail.org>; Sun,  3 Nov 2013 16:42:38 -0800 (PST)\r
21 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by fire-doxen-postvirus (Postfix) with ESMTP id 13E2332806B;\r
23         Sun,  3 Nov 2013 16:42:36 -0800 (PST)\r
24 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
25 Received: from finestructure.net (cpe-76-173-75-27.socal.res.rr.com\r
26         [76.173.75.27]) (Authenticated sender: jrollins)\r
27         by fire-doxen-submit (Postfix) with ESMTP id CE9F0328073;\r
28         Sun,  3 Nov 2013 16:42:32 -0800 (PST)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id 48A2C600B2; Sun,  3 Nov 2013 16:42:32 -0800 (PST)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'\r
34 In-Reply-To: <1382471457-26056-9-git-send-email-amdragon@mit.edu>\r
35 References: <1382471457-26056-1-git-send-email-amdragon@mit.edu>\r
36         <1382471457-26056-9-git-send-email-amdragon@mit.edu>\r
37 User-Agent: Notmuch/0.16+120~gfd733a4 (http://notmuchmail.org) Emacs/24.3.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Sun, 03 Nov 2013 16:42:29 -0800\r
40 Message-ID: <8761s9gfpm.fsf@servo.finestructure.net>\r
41 MIME-Version: 1.0\r
42 Content-Type: multipart/signed; boundary="=-=-=";\r
43         micalg=pgp-sha256; protocol="application/pgp-signature"\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Mon, 04 Nov 2013 00:42:44 -0000\r
57 \r
58 --=-=-=\r
59 Content-Type: text/plain\r
60 Content-Transfer-Encoding: quoted-printable\r
61 \r
62 On Tue, Oct 22 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
63 > We no longer use this, since we've lifted all interactive behavior to\r
64 > the appropriate interactive entry points.  Because of this,\r
65 > `notmuch-tag' also no longer needs to return the tag changes list,\r
66 > since the caller always passes it in.\r
67 > ---\r
68 >  emacs/notmuch-tag.el | 19 ++++---------------\r
69 >  1 file changed, 4 insertions(+), 15 deletions(-)\r
70 >\r
71 > diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
72 > index f9c1740..feee17c 100644\r
73 > --- a/emacs/notmuch-tag.el\r
74 > +++ b/emacs/notmuch-tag.el\r
75 > @@ -249,27 +249,18 @@ from TAGS if present."\r
76 >          (error "Changed tag must be of the form `+this_tag' or `-that_tag'")=\r
77 ))))\r
78 >      (sort result-tags 'string<)))\r
79 >=20=20\r
80 > -(defun notmuch-tag (query &optional tag-changes)\r
81 > +(defun notmuch-tag (query tag-changes)\r
82 >    "Add/remove tags in TAG-CHANGES to messages matching QUERY.\r
83 >=20=20\r
84 >  QUERY should be a string containing the search-terms.\r
85 > -TAG-CHANGES can take multiple forms.  If TAG-CHANGES is a list of\r
86 > -strings of the form \"+tag\" or \"-tag\" then those are the tag\r
87 > -changes applied.  If TAG-CHANGES is a string then it is\r
88 > -interpreted as a single tag change.  If TAG-CHANGES is the string\r
89 > -\"-\" or \"+\", or null, then the user is prompted to enter the\r
90 > -tag changes.\r
91 > +TAG-CHANGES is a list of strings of the form \"+tag\" or\r
92 > +\"-tag\" to add or remove tags, respectively.\r
93 >=20=20\r
94 >  Note: Other code should always use this function alter tags of\r
95 >  messages instead of running (notmuch-call-notmuch-process \"tag\" ..)\r
96 >  directly, so that hooks specified in notmuch-before-tag-hook and\r
97 >  notmuch-after-tag-hook will be run."\r
98 >    ;; Perform some validation\r
99 > -  (if (string-or-null-p tag-changes)\r
100 > -      (if (or (string=3D tag-changes "-") (string=3D tag-changes "+") (n=\r
101 ull tag-changes))\r
102 > -       (setq tag-changes (notmuch-read-tag-changes\r
103 > -                          (notmuch-tag-completions query) nil tag-changes))\r
104 > -     (setq tag-changes (list tag-changes))))\r
105 \r
106 Hey folks.  After a recent upgrade to 0.16+120~gfd733a4+1 I found that\r
107 my custom tagging functions weren't working, which I traced back to the\r
108 removal of this section.\r
109 \r
110 Previously notmuch-tag accepted tag changes in two forms: as a list of\r
111 tag changes:\r
112 \r
113 (list "+foo" "-bar")\r
114 \r
115 or as a space-separated string:\r
116 \r
117 "+foo -bar"\r
118 \r
119 This removed section is what would turn the space-separated string into\r
120 a list.\r
121 \r
122 I have custom tagging functions that were written like this:\r
123 \r
124 (notmuch-search-tag "+spam")\r
125 \r
126 notmuch-search-tag passes the TAG-CHANGES to notmuch-tag, which was\r
127 changing it to a list in this removed section.  Since its removal, all\r
128 of my custom functions started throwing the following error:\r
129 \r
130 Wrong type argument: stringp, 43\r
131 \r
132 I didn't pay super close attention to the rest of the patch series, but\r
133 From=20a backwards compatibility point of view, do we really need to\r
134 remove this section?  Is there a problem with specifying tag changes as\r
135 a string?  I think it was actually me that last modified notmuch-tag,\r
136 and I vaguely remember spending time thinking about how to preserve that\r
137 particular way to specify the changes, so that things would be simpler\r
138 for simple tag operations.\r
139 \r
140 In any event, some amount of backwards compatibility has been removed,\r
141 so if we do want to keep it removed, we should add a good NEWS item to\r
142 explain that peoples custom bindings might break.\r
143 \r
144 jamie.\r
145 \r
146 >    (mapc (lambda (tag-change)\r
147 >         (unless (string-match-p "^[-+]\\S-+$" tag-change)\r
148 >           (error "Tag must be of the form `+this_tag' or `-that_tag'")))\r
149 > @@ -278,9 +269,7 @@ notmuch-after-tag-hook will be run."\r
150 >      (run-hooks 'notmuch-before-tag-hook)\r
151 >      (apply 'notmuch-call-notmuch-process "tag"\r
152 >          (append tag-changes (list "--" query)))\r
153 > -    (run-hooks 'notmuch-after-tag-hook))\r
154 > -  ;; in all cases we return tag-changes as a list\r
155 > -  tag-changes)\r
156 > +    (run-hooks 'notmuch-after-tag-hook)))\r
157 >=20=20\r
158 >  (defun notmuch-tag-change-list (tags &optional reverse)\r
159 >    "Convert TAGS into a list of tag changes.\r
160 > --=20\r
161 > 1.8.4.rc3\r
162 >\r
163 > _______________________________________________\r
164 > notmuch mailing list\r
165 > notmuch@notmuchmail.org\r
166 > http://notmuchmail.org/mailman/listinfo/notmuch\r
167 \r
168 --=-=-=\r
169 Content-Type: application/pgp-signature\r
170 \r
171 -----BEGIN PGP SIGNATURE-----\r
172 Version: GnuPG v1.4.15 (GNU/Linux)\r
173 \r
174 iQIcBAEBCAAGBQJSdu12AAoJEO00zqvie6q8qm4P/iNt9rQEue2PXr+S64TIqiWE\r
175 0eotrTAfGwcGvu2HrIuRUWELc9Nvix0ZIwT+COOxPB/iNn0l8ONTeQ+ATcOrZcOV\r
176 m+H/wBWSFPOP45mYhSCbYQuWlhfO+oKM+9dOIVaHB+RIDkSfKnBgQQVusZVwp7Kw\r
177 69LJ+DPTD3J0QnYAqhHblMwEsTc8ESETKbwa72BTugBdQWlQX3A8gBS2ws9V8NM+\r
178 PBAT0eiHvnA3Dw2NM7BIqiS1MbvFqCeiHVL5b9Zt0HNEa1/nN6Rkp8th8RhSAWrQ\r
179 8kHbUlCpBFdRteXqzgS9ZpfLbiMZPmrDK8RSxL7hbkgWTKKvy7fgYHQ2W7g+pXhm\r
180 vMxuMFWhE/KJMVf4pj18NPMOaViU2843CHSYxN+sbKxHr5NrljNOvRBKNCy9nygE\r
181 TfLGUqLUI7lXEPis0Izs4X373RJBIM2HqYKgdv3IGmuuKjoslwBzFeJHSwbtJ/f8\r
182 6ZLEgu9CL3GC7FLjkjLlGE/wqExSq2slItti7do8ZhGlvJq5fmz0DSeqCIhNM9Z4\r
183 SwpvUAHRcF3Z9JXHjHDl1o9+UDFIc0pkIHEs482Vkjlrr9ymtgiSTS4Fzg0GBmbv\r
184 jR+gwYDz0FyHU00FL27rF/SGlgMAgHfFU4qt3wb88JUv1LTXikvWqQLCMNjpJJpx\r
185 b7X33elCGage5rj/zV5F\r
186 =MV+R\r
187 -----END PGP SIGNATURE-----\r
188 --=-=-=--\r