Re: [PATCH v3] nmbug: Translate to Python
[notmuch-archives.git] / ea / 805d758c931ebadbc097483e11094f5f663c87
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 E22A24196F2\r
6         for <notmuch@notmuchmail.org>; Wed, 14 Apr 2010 10:14:47 -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 GOKnjVOLVZi2; Wed, 14 Apr 2010 10:14:47 -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 DC699431FC1;\r
19         Wed, 14 Apr 2010 10:14:46 -0700 (PDT)\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
21         id 77A21568DE1; Wed, 14 Apr 2010 10:14:46 -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: [PATCH] Fix bug, and clean up code duplication,\r
25         in adding or removing tag by region.\r
26 In-Reply-To: <871vejxk94.fsf@jhu.edu>\r
27 References: <m1636w7au5.fsf@watt.gilman.jhu.edu> <87sk90ragj.fsf@jhu.edu>\r
28         <87aatfq88h.fsf@yoom.home.cworth.org> <877hogaf7v.fsf@jhu.edu>\r
29         <878w8rkzis.fsf@yoom.home.cworth.org> <871vejxk94.fsf@jhu.edu>\r
30 Date: Wed, 14 Apr 2010 10:14:46 -0700\r
31 Message-ID: <87zl16ez21.fsf@yoom.home.cworth.org>\r
32 MIME-Version: 1.0\r
33 Content-Type: multipart/signed; boundary="=-=-=";\r
34         micalg=pgp-sha1; protocol="application/pgp-signature"\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Wed, 14 Apr 2010 17:14:48 -0000\r
48 \r
49 --=-=-=\r
50 Content-Transfer-Encoding: quoted-printable\r
51 \r
52 On Tue, 13 Apr 2010 14:47:19 -0400, Jesse Rosenthal <jrosenthal@jhu.edu> wr=\r
53 ote:\r
54 > There was a bug in notmuch-search-{add,remove}-tag-region, which would\r
55 > not behave correctly if the region went beyond the last message. Now,\r
56 > instead of simply iterating to the last line of the region, these\r
57 > functions will iterate to the minimum of the last line of the region\r
58 > and the last possible line, i.e.\r
59 \r
60 Thanks, Jesse!\r
61 \r
62 I tested this and it works great.=20\r
63 \r
64 > (- (line-number-at-pos (point-max)) 2)\r
65 \r
66 The only real problem I see with this approach is that it's fragile in\r
67 depending on the buffer having exactly 2 lines of non-thread text at the\r
68 end. I can easily see myself wanting to remove the "End of Search\r
69 Results" line at the end of the buffer. And if I do that, this code will\r
70 break, (tag manipulations will miss the last message).\r
71 \r
72 A more robust fix would check for the ability to read a thread\r
73 ID. So making a single function such as\r
74 notmuch-search-find-last-line-with-thread-id or so would do the trick\r
75 here.\r
76 \r
77 > Also clean up code duplication, as per Carl's suggestion, by making\r
78 > notmuch-search-{add/remove}-tag-thread a special case of the -region\r
79 > commands, where the region in question is between (point) and (point).\r
80 \r
81 A very nice change as well. My internal alarm on "also" in a commit\r
82 message fired, so I took advantage of "git add -p" and "git rebase -i"\r
83 to split this portion into a separate commit.\r
84 \r
85 All pushed now.\r
86 \r
87 =2DCarl\r
88 \r
89 --=-=-=\r
90 Content-Type: application/pgp-signature\r
91 \r
92 -----BEGIN PGP SIGNATURE-----\r
93 Version: GnuPG v1.4.10 (GNU/Linux)\r
94 \r
95 iD8DBQFLxfgG6JDdNq8qSWgRAskPAKCmUrMpHQVoF5mremO+cSQWcDAmawCeLsva\r
96 ohf/fSkNwWCquB018kjrZqY=\r
97 =sXle\r
98 -----END PGP SIGNATURE-----\r
99 --=-=-=--\r