Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / df / 3cb2e43f9debd94e2c4e72e7fb0e2196c999a8
1 Return-Path: <cworth@cworth.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 olra.theworths.org (Postfix) with ESMTP id 262D04196F0\r
6         for <notmuch@notmuchmail.org>; Wed,  7 Apr 2010 14:10:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.89\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]\r
13         autolearn=ham\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 0ngserUuMYMX; Wed,  7 Apr 2010 14:10:39 -0700 (PDT)\r
17 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
18         by olra.theworths.org (Postfix) with ESMTP id 0FA64431FC1;\r
19         Wed,  7 Apr 2010 14:10:39 -0700 (PDT)\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
21         id B0E5525400C; Wed,  7 Apr 2010 14:10:38 -0700 (PDT)\r
22 From: Carl Worth <cworth@cworth.org>\r
23 To: Jesse Rosenthal <jrosenthal@jhu.edu>, notmuch@notmuchmail.org\r
24 Subject: Re: [notmuch] [PATCH v2] notmuch.el: add functionality in notmuch\r
25         search mode to add or remove tags by region\r
26 In-Reply-To: <87sk90ragj.fsf@jhu.edu>\r
27 References: <m1636w7au5.fsf@watt.gilman.jhu.edu> <87sk90ragj.fsf@jhu.edu>\r
28 Date: Wed, 07 Apr 2010 14:10:38 -0700\r
29 Message-ID: <87aatfq88h.fsf@yoom.home.cworth.org>\r
30 MIME-Version: 1.0\r
31 Content-Type: multipart/signed; boundary="=-=-=";\r
32         micalg=pgp-sha1; protocol="application/pgp-signature"\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Wed, 07 Apr 2010 21:10:40 -0000\r
46 \r
47 --=-=-=\r
48 Content-Transfer-Encoding: quoted-printable\r
49 \r
50 On Tue, 16 Feb 2010 19:07:40 -0500, Jesse Rosenthal <jrosenthal@jhu.edu> wr=\r
51 ote:\r
52 > This patch adds `-region' versions of the `notmuch-search-' commands to f=\r
53 ind\r
54 > properties. It also splits up  `notmuch-add/remove-tags' into both a\r
55 > `-thread' and a `-region' version. (This makes us modify\r
56 > `notmuch-search-archive-thread' to use the\r
57 > `notmuch-search-remove-tag-thread' function, instead of\r
58 > `notmuch-search-remove-tag', for consistency.) The add/remove-tag command\r
59 > called by pressing `+' or `-' will then choose accordingly, based on whet=\r
60 her\r
61 > region is active.\r
62 >=20\r
63 > This version fixes a couple of errors in the first version, which led to\r
64 > incorrect marking of some tags in the search view (though the actual\r
65 > tagging was still correct). It's also based on current master.\r
66 >=20\r
67 > I'm not sure any more if region selection is actually the correct way to\r
68 > do this, or if a mutt-style message-marking method would be better. But\r
69 > I didn't want a buggy incorrect version out there.\r
70 \r
71 I think this feature is very useful, and that the region is definitely\r
72 an appropriate way to implement it, (doing region-based operations is\r
73 very natural for emacs users). Mutt-style marking could be implemented\r
74 as well, but that would be separate I think.\r
75 \r
76 I tested this patch a bit and added one small cleanup to the\r
77 documentation (see below).\r
78 \r
79 I also don't like the duplication of code in\r
80 notmuch-search-add-tag-thread and notmuch-search-add-tag-region, (and\r
81 the same in the remove case). Fortunately, I think this easy to avoid by\r
82 simply making notmuch-search-add-tag-thread call:\r
83 \r
84        (notmuch-search-add-tag-region tag (point) (point))\r
85 \r
86 and the same in the remove case.\r
87 \r
88 But I haven't pushed this patch yet for a flaw in the case of selecting\r
89 beyond the last thread, (such as selecting to the line that includes the\r
90 "End of search results). If I try an operation on that line, it will act\r
91 like it works, (it displays the new tags by all threads), but then a\r
92 refresh makes them all disappear again. Presumably the "notmuch tag"\r
93 command is failing, this isn't being noticed, and the code marches on to\r
94 update the representation of the tags.\r
95 \r
96 And presumably the notmuch tag is failing because no thread ID is found\r
97 for the last line, so the mapconcat call is sticking an extra " or "\r
98 onto the end of the search string. And Xapian doesn't like that:\r
99 \r
100         $ notmuch search tag:inbox or\r
101         A Xapian exception occurred performing query: Syntax: <expression> OR <exp=\r
102 ression>\r
103         Query string was: tag:inbox or\r
104 \r
105 Things behave even worse if I make the region be the entire buffer,\r
106 (including the last blank line). Then the commands hang. I got nervous\r
107 that this was then adding "or or" and trying to add/remove a tag to\r
108 every message containing the word "or". But I haven't looked closely.\r
109 \r
110 If we can fix this bug, then I'd like to apply this patch. I'd even like\r
111 to fix the "*" binding to be implemented in terms of something like\r
112 these functions so that we could get visual updates of the tag state\r
113 From=20that command. (But that will take some reworking of the interface\r
114 as the current implementation can't support multiple tags added/removed\r
115 as * current expects).\r
116 \r
117 I'd appreciate any help fixing up the patch.\r
118 \r
119 =2DCarl\r
120 \r
121 From=20fec5622add1a4e9f305c16e96143439ee22a5c58 Mon Sep 17 00:00:00 2001\r
122 From: Carl Worth <cworth@cworth.org>\r
123 Date: Wed, 7 Apr 2010 13:15:27 -0700\r
124 Subject: [PATCH] emacs: Correct the documentation for notmuch-search-add-ta=\r
125 g (and -remove-tag)\r
126 \r
127 These commands act on all messages in the thread, not simply those\r
128 that match the search. (There are use case for both behaviors, but the\r
129 documentation must match the behavior that's actually implemented).\r
130 =2D--\r
131  emacs/notmuch.el |    9 ++++-----\r
132  1 files changed, 4 insertions(+), 5 deletions(-)\r
133 \r
134 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
135 index 64f3e3d..517c53a 100644\r
136 =2D-- a/emacs/notmuch.el\r
137 +++ b/emacs/notmuch.el\r
138 @@ -532,12 +532,11 @@ and will also appear in a buffer named \"*Notmuch err=\r
139 ors*\"."\r
140           (notmuch-search-set-tags (delete tag (notmuch-search-get-tags)))\r
141           (forward-line))))))\r
142 =20\r
143 =2D\r
144  (defun notmuch-search-add-tag (tag)\r
145    "Add a tag to the currently selected thread or region.\r
146 =20\r
147 =2DThe tag is added to messages in the currently selected thread or\r
148 =2Dregion which match the current search terms."\r
149 +The tag is added to all messages in the currently selected thread\r
150 +or threads in the current region."\r
151    (interactive\r
152     (list (notmuch-select-tag-with-completion "Tag to add: ")))\r
153    (save-excursion\r
154 @@ -550,8 +549,8 @@ region which match the current search terms."\r
155  (defun notmuch-search-remove-tag (tag)\r
156    "Remove a tag from the currently selected thread or region.\r
157 =20\r
158 =2DThe tag is removed from all messages in the currently selected thread\r
159 =2Dor region which match the current search terms."\r
160 +The tag is removed from all messages in the currently selected\r
161 +thread or threads in the current region."\r
162    (interactive\r
163     (list (notmuch-select-tag-with-completion\r
164           "Tag to remove: "\r
165 =2D-=20\r
166 1.7.0\r
167 \r
168 \r
169 --=-=-=\r
170 Content-Type: application/pgp-signature\r
171 \r
172 -----BEGIN PGP SIGNATURE-----\r
173 Version: GnuPG v1.4.10 (GNU/Linux)\r
174 \r
175 iD8DBQFLvPTO6JDdNq8qSWgRAsxHAKCpnJDPWvi6vZhr6L0qctDiAcoryACbBbTJ\r
176 CIsitjtUX2yLdude6PH796M=\r
177 =25Nm\r
178 -----END PGP SIGNATURE-----\r
179 --=-=-=--\r