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 A5F28431FBD
\r
6 for <notmuch@notmuchmail.org>; Fri, 5 Feb 2010 11:55:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-3.177 tagged_above=-999 required=5
\r
12 tests=[ALL_TRUSTED=-1.8, AWL=1.222, BAYES_00=-2.599] autolearn=ham
\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 3LZ92c3o4p4a; Fri, 5 Feb 2010 11:55:26 -0800 (PST)
\r
16 Received: from yoom.home.cworth.org (localhost [127.0.0.1])
\r
17 by olra.theworths.org (Postfix) with ESMTP id 9B0B3431FAE;
\r
18 Fri, 5 Feb 2010 11:55:26 -0800 (PST)
\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)
\r
20 id 541FC254181; Sat, 6 Feb 2010 08:55:26 +1300 (NZDT)
\r
21 From: Carl Worth <cworth@cworth.org>
\r
22 To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
\r
23 aneesh.kumar@linux.vnet.ibm.com
\r
25 <1259758178-26584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
26 References: <1259684149-9574-3-git-send-email-aneesh.kumar@gmail.com>
\r
27 <1259758178-26584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
\r
28 Date: Fri, 05 Feb 2010 11:55:26 -0800
\r
29 Message-ID: <87bpg3e9u9.fsf@yoom.home.cworth.org>
\r
31 Content-Type: multipart/signed; boundary="=-=-=";
\r
32 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
33 Cc: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>, notmuch@notmuchmail.org
\r
34 Subject: Re: [notmuch] [PATCH -v2] notmuch.el: Support for customizing
\r
35 search result display
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Fri, 05 Feb 2010 19:55:27 -0000
\r
51 Content-Transfer-Encoding: quoted-printable
\r
53 On Wed, 2 Dec 2009 18:19:38 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.=
\r
54 vnet.ibm.com> wrote:
\r
55 > From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
\r
57 > This patch helps in customizing search result display
\r
58 > similar to mutt's index_format. The customization is done
\r
59 > by defining an alist as below
\r
61 > (setq notmuch-search-result-format '(("date" . "%s ")
\r
62 > ("authors" . "%-40s ")
\r
63 > ("subject" . "%s ")
\r
64 > ("tags" . "(%s)")))
\r
66 > The supported keywords are date, count, authors, subject and tags.
\r
68 > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
\r
72 I'm sorry this patch has lingered so long without comment. There's
\r
73 really only one problem I see with it:
\r
75 > +(defcustom notmuch-search-result-format nil
\r
76 > + "Search result formating. Supported fields are
\r
77 > + date, count, authors, subject, tags
\r
78 > +ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
\r
79 > + \(\"subject\" . \"%s\"\)\)\)"
\r
80 > +:type '(alist :key-type (string) :value-type (string))
\r
85 > - (insert (format "%s %-7s %-40s %s (%s)\n" date count authors subject =
\r
87 > + (if (not notmuch-search-result-format)
\r
88 > + (progn (insert (format "%s %-7s %-40s %s" date count authors subj=
\r
90 > + ;; insert the fontified tag
\r
91 > + (insert-tags (format "%s" tags))
\r
93 > + (notmuch-search-show-result date count authors subject tags))
\r
95 I don't like that the new format variable is nil by default and then
\r
96 there's an open-coded implementation of the default formatting. This has
\r
97 a couple of problems:
\r
99 1. The new code is not being exercised by default, so it would be easy
\r
100 to break it without realizing.
\r
102 2. The system is not very self-documenting.
\r
104 If a new user wants to tweak the default format, that will be a lot
\r
105 easier if they find a customizable variable that describes the
\r
106 current format. *That* will be a lot easier to modify rather than
\r
107 trying to learn what should be used instead of "nil".
\r
112 Content-Type: application/pgp-signature
\r
114 -----BEGIN PGP SIGNATURE-----
\r
115 Version: GnuPG v1.4.10 (GNU/Linux)
\r
117 iD8DBQFLbHeu6JDdNq8qSWgRAk8xAJ9IyK6g1eLB9W2ZOsbgZ5eEJxLw6gCfc5DD
\r
118 znAAjdaoCHx3dG1pXUEYsrY=
\r
120 -----END PGP SIGNATURE-----
\r