Re: [PATCH 0/5] Notmuch Pick (WIP or contrib)
[notmuch-archives.git] / 86 / 98f94795da63d51392d39379f1d4033c847303
1 Return-Path: <daniel.schoepe@googlemail.com>\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 67E78431FD0\r
6         for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:46 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 41HJRH-e6pKQ for <notmuch@notmuchmail.org>;\r
17         Thu, 19 May 2011 16:18:45 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 70898431FB6\r
22         for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:45 -0700 (PDT)\r
23 Received: by bwg12 with SMTP id 12so2715588bwg.26\r
24         for <notmuch@notmuchmail.org>; Thu, 19 May 2011 16:18:43 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=googlemail.com; s=gamma;\r
27         h=domainkey-signature:from:to:subject:user-agent:date:message-id\r
28         :mime-version:content-type;\r
29         bh=TbVISWAF7WOVctCHSdDAXfJnP8fJf1x7MaE4/wOHtJA=;\r
30         b=mXqvlOuazaPyw7JoV6aRL3x2tP9cgEib7wiotYsTayyog5pX+reHhQFbE7FTEXaqKm\r
31         1FGN05XhZeqsia6QEZVVNrgkgKD6w64+Dz2YBt1NySPv8rm1m9dSboIOWnmDMgKxUrhC\r
32         PipIbLYvig10YLBE34hC2lCPjvPNGNG39Pq5o=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;\r
34         h=from:to:subject:user-agent:date:message-id:mime-version\r
35         :content-type;\r
36         b=QlXVR4b8zNvAKXRaCDyE0jdwngDcmzzcm+AnmrjdQi7RWohdl6+cc1d60petaZ8Co3\r
37         XFO5/H411daqkJB11Uy8C1JEFQaq5Fnahzw78NWEpJB8sfeaRubVPP6YPUD+rOE1DENn\r
38         oARNWcXxsoNPMVuqiCdz7d5VnJl9kNAgEQZUU=\r
39 Received: by 10.204.73.157 with SMTP id q29mr3324919bkj.101.1305847123808;\r
40         Thu, 19 May 2011 16:18:43 -0700 (PDT)\r
41 Received: from localhost (dslb-088-069-130-239.pools.arcor-ip.net\r
42         [88.69.130.239])\r
43         by mx.google.com with ESMTPS id c11sm1795495bkc.2.2011.05.19.16.18.41\r
44         (version=TLSv1/SSLv3 cipher=OTHER);\r
45         Thu, 19 May 2011 16:18:42 -0700 (PDT)\r
46 From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
47 To: notmuch@notmuchmail.org\r
48 Subject: [PATCH] emacs: Make the queries used in the all-tags section\r
49 User-Agent: Notmuch/0.5-210-g1acc997 (http://notmuchmail.org) Emacs/23.3.1\r
50         (x86_64-pc-linux-gnu)\r
51 Date: Fri, 20 May 2011 01:18:35 +0200\r
52 Message-ID: <87fwoath2s.fsf@gilead.home.box>\r
53 MIME-Version: 1.0\r
54 Content-Type: multipart/signed; boundary="==-=-=";\r
55         micalg=pgp-sha1; protocol="application/pgp-signature"\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Thu, 19 May 2011 23:18:46 -0000\r
69 \r
70 --==-=-=\r
71 Content-Type: multipart/mixed; boundary="=-=-="\r
72 \r
73 --=-=-=\r
74 Content-Type: text/plain\r
75 Content-Transfer-Encoding: quoted-printable\r
76 \r
77 \r
78 From=20the commit message:\r
79 \r
80     emacs: Make queries used in the all-tags section configurable\r
81 =20=20=20=20\r
82     This patch adds a customization variable that controls what queries\r
83     are used to construct the all-tags section in notmuch-hello. It allows\r
84     the user to specify a function to construct the query given a tag. It\r
85     also allows hiding tags by returning nil.\r
86 \r
87 Possible uses would be things like displaying the unread count for\r
88 tags instead of all messages with that tag and/or hiding uninteresting\r
89 tags like "signed" or "encrypted".\r
90 \r
91 =2D- Daniel\r
92 \r
93 --=-=-=\r
94 Content-Type: text/x-diff\r
95 Content-Disposition: inline;\r
96  filename=0001-emacs-Make-queries-used-in-the-all-tags-section-conf.patch\r
97 Content-Transfer-Encoding: quoted-printable\r
98 \r
99 From=20bc4e046537518255ad02254c88e7b5bedd347c2b Mon Sep 17 00:00:00 2001\r
100 From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
101 Date: Fri, 20 May 2011 00:53:50 +0200\r
102 Subject: [PATCH] emacs: Make queries used in the all-tags section\r
103  configurable\r
104 \r
105 This patch adds a customization variable that controls what queries\r
106 are used to construct the all-tags section in notmuch-hello. It allows\r
107 the user to specify a function to construct the query given a tag. It\r
108 also allows hiding tags by returning nil.\r
109 \r
110 Signed-off-by: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
111 =2D--\r
112  emacs/notmuch-hello.el |   25 ++++++++++++++++++++++---\r
113  1 files changed, 22 insertions(+), 3 deletions(-)\r
114 \r
115 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
116 index e58dd24..0b8c0b9 100644\r
117 =2D-- a/emacs/notmuch-hello.el\r
118 +++ b/emacs/notmuch-hello.el\r
119 @@ -55,6 +55,17 @@\r
120    :type 'boolean\r
121    :group 'notmuch)\r
122 =20\r
123 +(defcustom notmuch-hello-tag-list-make-query nil\r
124 +  "Function to generate queries for the all tags list.\r
125 +\r
126 +This variable controls which query results are shown for each tag\r
127 +in the \"all tags\" list. If this is nil, it uses the default of\r
128 +\"tag:TAG\", otherwise it should be a function of one argument,\r
129 +the tag, that should return the query to be used for that tag, or\r
130 +nil, in which case the tag will be hidden."\r
131 +  :type '(choice function (const nil :tag "tag:TAG"))\r
132 +  :group 'notmuch)\r
133 +\r
134  (defface notmuch-hello-logo-background\r
135    '((((class color)\r
136        (background dark))\r
137 @@ -318,6 +329,16 @@ Complete list of currently available key bindings:\r
138   ;;(setq buffer-read-only t)\r
139  )\r
140 =20\r
141 +(defun notmuch-hello-generate-tag-alist ()\r
142 +  "Return an alist from tags to queries to display in the all-tags section=\r
143 ."\r
144 +  (filter 'cdr\r
145 +         (mapcar '(lambda (tag)\r
146 +                    (cons tag\r
147 +                          (if notmuch-hello-tag-list-make-query\r
148 +                              (funcall notmuch-hello-tag-list-make-query tag)\r
149 +                            (concat "tag:" tag))))\r
150 +                 (process-lines notmuch-command "search-tags"))))\r
151 +\r
152  ;;;###autoload\r
153  (defun notmuch-hello (&optional no-display)\r
154    "Run notmuch and display saved searches, known tags, etc."\r
155 @@ -396,9 +417,7 @@ Complete list of currently available key bindings:\r
156                       if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0)\r
157                       collect elem)))\r
158              (saved-widest (notmuch-hello-longest-label saved-alist))\r
159 =2D          (alltags-alist (if notmuch-show-all-tags-list\r
160 =2D                             (mapcar '(lambda (tag) (cons tag (concat "tag:" tag)))\r
161 =2D                                     (process-lines notmuch-command "search-tags"))))\r
162 +            (alltags-alist (if notmuch-show-all-tags-list (notmuch-hello-generat=\r
163 e-tag-alist)))\r
164              (alltags-widest (notmuch-hello-longest-label alltags-alist))\r
165              (widest (max saved-widest alltags-widest)))\r
166 =20\r
167 =2D-=20\r
168 1.7.5.1\r
169 \r
170 \r
171 --=-=-=--\r
172 \r
173 --==-=-=\r
174 Content-Type: application/pgp-signature\r
175 \r
176 -----BEGIN PGP SIGNATURE-----\r
177 Version: GnuPG v1.4.11 (GNU/Linux)\r
178 \r
179 iQIcBAEBAgAGBQJN1aVLAAoJEIaTAtce+Z+JbhIP/RGZjiBbgRfNViYOqZ9x2HCm\r
180 jZ32miXAGNGNc9nbzVxsCxTkNkLC2oSPQbV7pi1BILWSeZI1YwE/VGTMKiLVjb7E\r
181 UIjPRLkyZh9Hi+CBp1oLib5btl0rCGZju5KYOwR6BPQVfU/3H+TGnAWIY9RlxCbM\r
182 n1gQFMnehntq31jJgxIQn0adgRs79QqI57C43f4vdRuqe+r4eYaNjDqulPSUNbSb\r
183 JfDukhcYD3HSyRZPxRTSdjg9X9qj2kzIfaqVrhpPlWWG00gEsa1JbZQJ6CsFDcC9\r
184 nihn2tgsdANPEpWjijcRtaf9P+68ekKkT5X9YO5JNFFZ5nFbekHm4aLgPnD5L+pk\r
185 n55hgd5GaV4DXaQkQnm5uqfEJ7FGPrI90fGl7WdjYjGe3bIdxwwYccHHWXLhmtZc\r
186 sfK2w3x1FHqFz6r55QtujCLop7F8Unq47RH2ZfpjZbej9GpeX9ehIDc6EnZ4NXI2\r
187 lplG9QHSDn5QsuUIrgBgYOPTHMoUADnFQIZ/thSRXsZ1/KMsTZG/MfcnoXP4hIux\r
188 dOld52wRGoxLERvJKk1QYfUclk5YSiaRClfJrEuG2yzxZYZJYz8/QEllrorp5ppc\r
189 VuuOHwFg2wEIf1POZgA8nULllYZH7m1Gvq9sKj9EoZBbgDEovT3/ovKTnlatGg6y\r
190 wExTxBGC8+y3+fwbgMdK\r
191 =mxr8\r
192 -----END PGP SIGNATURE-----\r
193 --==-=-=--\r