[PATCH] emacs: Make the queries used in the all-tags section
authorDaniel Schoepe <daniel.schoepe@googlemail.com>
Thu, 19 May 2011 23:18:35 +0000 (01:18 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:17 +0000 (09:38 -0800)
86/98f94795da63d51392d39379f1d4033c847303 [new file with mode: 0644]

diff --git a/86/98f94795da63d51392d39379f1d4033c847303 b/86/98f94795da63d51392d39379f1d4033c847303
new file mode 100644 (file)
index 0000000..5e036dc
--- /dev/null
@@ -0,0 +1,193 @@
+Return-Path: <daniel.schoepe@googlemail.com>\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 67E78431FD0\r
+       for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:46 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 41HJRH-e6pKQ for <notmuch@notmuchmail.org>;\r
+       Thu, 19 May 2011 16:18:45 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 70898431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:45 -0700 (PDT)\r
+Received: by bwg12 with SMTP id 12so2715588bwg.26\r
+       for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:43 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=googlemail.com; s=gamma;\r
+       h=domainkey-signature:from:to:subject:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=TbVISWAF7WOVctCHSdDAXfJnP8fJf1x7MaE4/wOHtJA=;\r
+       b=mXqvlOuazaPyw7JoV6aRL3x2tP9cgEib7wiotYsTayyog5pX+reHhQFbE7FTEXaqKm\r
+       1FGN05XhZeqsia6QEZVVNrgkgKD6w64+Dz2YBt1NySPv8rm1m9dSboIOWnmDMgKxUrhC\r
+       PipIbLYvig10YLBE34hC2lCPjvPNGNG39Pq5o=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;\r
+       h=from:to:subject:user-agent:date:message-id:mime-version\r
+       :content-type;\r
+       b=QlXVR4b8zNvAKXRaCDyE0jdwngDcmzzcm+AnmrjdQi7RWohdl6+cc1d60petaZ8Co3\r
+       XFO5/H411daqkJB11Uy8C1JEFQaq5Fnahzw78NWEpJB8sfeaRubVPP6YPUD+rOE1DENn\r
+       oARNWcXxsoNPMVuqiCdz7d5VnJl9kNAgEQZUU=\r
+Received: by 10.204.73.157 with SMTP id q29mr3324919bkj.101.1305847123808;\r
+       Thu, 19 May 2011 16:18:43 -0700 (PDT)\r
+Received: from localhost (dslb-088-069-130-239.pools.arcor-ip.net\r
+       [88.69.130.239])\r
+       by mx.google.com with ESMTPS id c11sm1795495bkc.2.2011.05.19.16.18.41\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 19 May 2011 16:18:42 -0700 (PDT)\r
+From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Make the queries used in the all-tags section\r
+User-Agent: Notmuch/0.5-210-g1acc997 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 20 May 2011 01:18:35 +0200\r
+Message-ID: <87fwoath2s.fsf@gilead.home.box>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="==-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\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: Thu, 19 May 2011 23:18:46 -0000\r
+\r
+--==-=-=\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+\r
+From=20the commit message:\r
+\r
+    emacs: Make queries used in the all-tags section configurable\r
+=20=20=20=20\r
+    This patch adds a customization variable that controls what queries\r
+    are used to construct the all-tags section in notmuch-hello. It allows\r
+    the user to specify a function to construct the query given a tag. It\r
+    also allows hiding tags by returning nil.\r
+\r
+Possible uses would be things like displaying the unread count for\r
+tags instead of all messages with that tag and/or hiding uninteresting\r
+tags like "signed" or "encrypted".\r
+\r
+=2D- Daniel\r
+\r
+--=-=-=\r
+Content-Type: text/x-diff\r
+Content-Disposition: inline;\r
+ filename=0001-emacs-Make-queries-used-in-the-all-tags-section-conf.patch\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+From=20bc4e046537518255ad02254c88e7b5bedd347c2b Mon Sep 17 00:00:00 2001\r
+From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+Date: Fri, 20 May 2011 00:53:50 +0200\r
+Subject: [PATCH] emacs: Make queries used in the all-tags section\r
+ configurable\r
+\r
+This patch adds a customization variable that controls what queries\r
+are used to construct the all-tags section in notmuch-hello. It allows\r
+the user to specify a function to construct the query given a tag. It\r
+also allows hiding tags by returning nil.\r
+\r
+Signed-off-by: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+=2D--\r
+ emacs/notmuch-hello.el |   25 ++++++++++++++++++++++---\r
+ 1 files changed, 22 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index e58dd24..0b8c0b9 100644\r
+=2D-- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -55,6 +55,17 @@\r
+   :type 'boolean\r
+   :group 'notmuch)\r
+=20\r
++(defcustom notmuch-hello-tag-list-make-query nil\r
++  "Function to generate queries for the all tags list.\r
++\r
++This variable controls which query results are shown for each tag\r
++in the \"all tags\" list. If this is nil, it uses the default of\r
++\"tag:TAG\", otherwise it should be a function of one argument,\r
++the tag, that should return the query to be used for that tag, or\r
++nil, in which case the tag will be hidden."\r
++  :type '(choice function (const nil :tag "tag:TAG"))\r
++  :group 'notmuch)\r
++\r
+ (defface notmuch-hello-logo-background\r
+   '((((class color)\r
+       (background dark))\r
+@@ -318,6 +329,16 @@ Complete list of currently available key bindings:\r
+  ;;(setq buffer-read-only t)\r
+ )\r
+=20\r
++(defun notmuch-hello-generate-tag-alist ()\r
++  "Return an alist from tags to queries to display in the all-tags section=\r
+."\r
++  (filter 'cdr\r
++        (mapcar '(lambda (tag)\r
++                   (cons tag\r
++                         (if notmuch-hello-tag-list-make-query\r
++                             (funcall notmuch-hello-tag-list-make-query tag)\r
++                           (concat "tag:" tag))))\r
++                (process-lines notmuch-command "search-tags"))))\r
++\r
+ ;;;###autoload\r
+ (defun notmuch-hello (&optional no-display)\r
+   "Run notmuch and display saved searches, known tags, etc."\r
+@@ -396,9 +417,7 @@ Complete list of currently available key bindings:\r
+                     if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0)\r
+                     collect elem)))\r
+            (saved-widest (notmuch-hello-longest-label saved-alist))\r
+=2D         (alltags-alist (if notmuch-show-all-tags-list\r
+=2D                            (mapcar '(lambda (tag) (cons tag (concat "tag:" tag)))\r
+=2D                                    (process-lines notmuch-command "search-tags"))))\r
++           (alltags-alist (if notmuch-show-all-tags-list (notmuch-hello-generat=\r
+e-tag-alist)))\r
+            (alltags-widest (notmuch-hello-longest-label alltags-alist))\r
+            (widest (max saved-widest alltags-widest)))\r
+=20\r
+=2D-=20\r
+1.7.5.1\r
+\r
+\r
+--=-=-=--\r
+\r
+--==-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iQIcBAEBAgAGBQJN1aVLAAoJEIaTAtce+Z+JbhIP/RGZjiBbgRfNViYOqZ9x2HCm\r
+jZ32miXAGNGNc9nbzVxsCxTkNkLC2oSPQbV7pi1BILWSeZI1YwE/VGTMKiLVjb7E\r
+UIjPRLkyZh9Hi+CBp1oLib5btl0rCGZju5KYOwR6BPQVfU/3H+TGnAWIY9RlxCbM\r
+n1gQFMnehntq31jJgxIQn0adgRs79QqI57C43f4vdRuqe+r4eYaNjDqulPSUNbSb\r
+JfDukhcYD3HSyRZPxRTSdjg9X9qj2kzIfaqVrhpPlWWG00gEsa1JbZQJ6CsFDcC9\r
+nihn2tgsdANPEpWjijcRtaf9P+68ekKkT5X9YO5JNFFZ5nFbekHm4aLgPnD5L+pk\r
+n55hgd5GaV4DXaQkQnm5uqfEJ7FGPrI90fGl7WdjYjGe3bIdxwwYccHHWXLhmtZc\r
+sfK2w3x1FHqFz6r55QtujCLop7F8Unq47RH2ZfpjZbej9GpeX9ehIDc6EnZ4NXI2\r
+lplG9QHSDn5QsuUIrgBgYOPTHMoUADnFQIZ/thSRXsZ1/KMsTZG/MfcnoXP4hIux\r
+dOld52wRGoxLERvJKk1QYfUclk5YSiaRClfJrEuG2yzxZYZJYz8/QEllrorp5ppc\r
+VuuOHwFg2wEIf1POZgA8nULllYZH7m1Gvq9sKj9EoZBbgDEovT3/ovKTnlatGg6y\r
+wExTxBGC8+y3+fwbgMdK\r
+=mxr8\r
+-----END PGP SIGNATURE-----\r
+--==-=-=--\r