Re: [notmuch] [PATCH -v2] notmuch.el: Support for customizing search result display
authorCarl Worth <cworth@cworth.org>
Fri, 5 Feb 2010 19:55:26 +0000 (11:55 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:07 +0000 (09:36 -0800)
17/e3ff517f311daaf6c6aded484504cac0d900df [new file with mode: 0644]

diff --git a/17/e3ff517f311daaf6c6aded484504cac0d900df b/17/e3ff517f311daaf6c6aded484504cac0d900df
new file mode 100644 (file)
index 0000000..76c5a01
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <cworth@cworth.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A5F28431FBD\r
+       for <notmuch@notmuchmail.org>; Fri,  5 Feb 2010 11:55:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -3.177\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-3.177 tagged_above=-999 required=5\r
+       tests=[ALL_TRUSTED=-1.8, AWL=1.222, BAYES_00=-2.599] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 3LZ92c3o4p4a; Fri,  5 Feb 2010 11:55:26 -0800 (PST)\r
+Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9B0B3431FAE;\r
+       Fri,  5 Feb 2010 11:55:26 -0800 (PST)\r
+Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
+       id 541FC254181; Sat,  6 Feb 2010 08:55:26 +1300 (NZDT)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,\r
+       aneesh.kumar@linux.vnet.ibm.com\r
+In-Reply-To:\r
+ <1259758178-26584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+References: <1259684149-9574-3-git-send-email-aneesh.kumar@gmail.com>\r
+       <1259758178-26584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+Date: Fri, 05 Feb 2010 11:55:26 -0800\r
+Message-ID: <87bpg3e9u9.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Cc: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [notmuch] [PATCH -v2] notmuch.el: Support for customizing\r
+ search result display\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 05 Feb 2010 19:55:27 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Wed,  2 Dec 2009 18:19:38 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.=\r
+vnet.ibm.com> wrote:\r
+> From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\r
+>=20\r
+> This patch helps in customizing search result display\r
+> similar to mutt's index_format. The customization is done\r
+> by defining an alist as below\r
+>=20\r
+> (setq notmuch-search-result-format '(("date" . "%s ")\r
+>                                   ("authors" . "%-40s ")\r
+>                                   ("subject" . "%s ")\r
+>                                   ("tags" . "(%s)")))\r
+>=20\r
+> The supported keywords are date, count, authors, subject and tags.\r
+>=20\r
+> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\r
+\r
+Hi Aneesh,\r
+\r
+I'm sorry this patch has lingered so long without comment. There's\r
+really only one problem I see with it:\r
+\r
+> +(defcustom notmuch-search-result-format nil\r
+> +  "Search result formating. Supported fields are\r
+> +    date, count, authors, subject, tags\r
+> +ex: (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)\r
+> +                                    \(\"subject\" . \"%s\"\)\)\)"\r
+> +:type '(alist :key-type (string) :value-type (string))\r
+> +:group 'notmuch)\r
+\r
+...\r
+\r
+> -                    (insert (format "%s %-7s %-40s %s (%s)\n" date count authors subject =\r
+tags))\r
+> +                    (if (not notmuch-search-result-format)\r
+> +                        (progn (insert (format "%s %-7s %-40s %s" date count authors subj=\r
+ect))\r
+> +                               ;; insert the fontified tag\r
+> +                               (insert-tags (format "%s" tags))\r
+> +                               (insert "\n"))\r
+> +                      (notmuch-search-show-result date count authors subject tags))\r
+\r
+I don't like that the new format variable is nil by default and then\r
+there's an open-coded implementation of the default formatting. This has\r
+a couple of problems:\r
+\r
+1. The new code is not being exercised by default, so it would be easy\r
+   to break it without realizing.\r
+\r
+2. The system is not very self-documenting.\r
+\r
+   If a new user wants to tweak the default format, that will be a lot\r
+   easier if they find a customizable variable that describes the\r
+   current format. *That* will be a lot easier to modify rather than\r
+   trying to learn what should be used instead of "nil".\r
+\r
+=2DCarl\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iD8DBQFLbHeu6JDdNq8qSWgRAk8xAJ9IyK6g1eLB9W2ZOsbgZ5eEJxLw6gCfc5DD\r
+znAAjdaoCHx3dG1pXUEYsrY=\r
+=r1Bd\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r