Re: [PATCH v4 16/16] add "notmuch reindex" subcommand
[notmuch-archives.git] / 51 / 1e7c9790c77e98b851e5bb5493d88c72b9fc35
1 Return-Path: <bremner@unb.ca>\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 507AA431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 05:10:36 -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 THwpET-1MajX for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 05:10:35 -0800 (PST)\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 98E83431FAE\r
21         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 05:10:35 -0800 (PST)\r
22 Received: from zancas.localnet\r
23         (fctnnbsc36w-156034071197.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
24         [156.34.71.197]) (authenticated bits=0)\r
25         by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0JDAKo5021639\r
26         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
27         Thu, 19 Jan 2012 09:10:21 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)\r
29         (envelope-from <bremner@unb.ca>)\r
30         id 1Rnrkx-0007s8-Uj; Thu, 19 Jan 2012 09:10:19 -0400\r
31 From: David Bremner <david@tethera.net>\r
32 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
33         Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: Re: RFC: tag macros\r
35 In-Reply-To: <87vco8q1yt.fsf@servo.finestructure.net>\r
36 References: <874nvtvzm5.fsf@convex-new.cs.unb.ca>\r
37         <87vco8q1yt.fsf@servo.finestructure.net>\r
38 User-Agent: Notmuch/0.11+61~gbaa2c97 (http://notmuchmail.org) Emacs/23.3.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Thu, 19 Jan 2012 09:10:19 -0400\r
41 Message-ID: <87d3afltxg.fsf@zancas.localnet>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\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: Thu, 19 Jan 2012 13:10:36 -0000\r
57 \r
58 On Wed, 18 Jan 2012 10:50:50 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
59 \r
60 > Is all of this really easier than just adding the following to your\r
61 > .emacs?:\r
62\r
63 > (define-key notmuch-search-mode-map "o"\r
64 >   (lambda ()\r
65 >     (interactive)\r
66 >     (notmuch-show-add-tag "notmuch::patch")\r
67 >     (notmuch-show-add-tag "notmuch::obsolete")\r
68 >     (notmuch-show-remove-tag "notmuch::needs-review")))\r
69\r
70 \r
71 I started out along this route.  I think there are a few advantages to\r
72 the approach I posted, but only if many people are making similar\r
73 snippets for more than one key.\r
74 \r
75 - it doesn't have the 3 lines of boilerplate per keybinding\r
76 - it doesn't require the user to program in lisp; I suspect that\r
77   explaining to new users how to customize their lisp snippets is some\r
78   support burden as well.\r
79 - it provides the equivalent of a submap, which is another few lines of\r
80   boilerplate. The only actual keybinding is "t" as a prefix. \r
81 \r
82 In my case, assuming the API was improved a bit as Austin suggested,\r
83 this would be a savings of 15-20 lines of boilerplate per user. \r
84 \r
85 Anyway, we can start by improving and documenting the API, and see how\r
86 that goes. The actually "parse lists and turn them into keybindings" part\r
87 is only the 4 line function notmuch-show-apply-tag-macro.\r
88 \r
89 > That seems really simple to me, and doesn't require us to support a\r
90 > bunch of code to do complicated customization stuff.\r
91 \r
92 I'm admittedly ignorant about emacs customization stuff, this requires a\r
93 single list of lists. Personally I use "setq" in .emacs for most\r
94 customization; it plays much better with version control.\r