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
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
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
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
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
50 Content-Transfer-Encoding: quoted-printable
\r
52 On Tue, 13 Apr 2010 14:47:19 -0400, Jesse Rosenthal <jrosenthal@jhu.edu> wr=
\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
62 I tested this and it works great.=20
\r
64 > (- (line-number-at-pos (point-max)) 2)
\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
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
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
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
90 Content-Type: application/pgp-signature
\r
92 -----BEGIN PGP SIGNATURE-----
\r
93 Version: GnuPG v1.4.10 (GNU/Linux)
\r
95 iD8DBQFLxfgG6JDdNq8qSWgRAskPAKCmUrMpHQVoF5mremO+cSQWcDAmawCeLsva
\r
96 ohf/fSkNwWCquB018kjrZqY=
\r
98 -----END PGP SIGNATURE-----
\r