1 Return-Path: <pieter@praet.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 9BE5542119B
\r
6 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 00:56:27 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 A9+ZzXSxHtcv for <notmuch@notmuchmail.org>;
\r
16 Thu, 30 Jun 2011 00:56:27 -0700 (PDT)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 028A6421192 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 00:56:26 -0700
\r
22 Received: by wwj40 with SMTP id 40so1610357wwj.2
\r
23 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 00:56:25 -0700 (PDT)
\r
24 Received: by 10.216.163.207 with SMTP id a57mr1510889wel.39.1309420585768;
\r
25 Thu, 30 Jun 2011 00:56:25 -0700 (PDT)
\r
26 Received: from localhost ([109.131.21.173])
\r
27 by mx.google.com with ESMTPS id l53sm983153weq.47.2011.06.30.00.56.23
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Thu, 30 Jun 2011 00:56:24 -0700 (PDT)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
32 Subject: Re: [PATCH 4/4] emacs: Add pseudo tag to match all messages that have
\r
35 <21340f6b77dcd4f27bb06a39236f276cdfb5b2f7.1309244829.git.jani@nikula.org>
\r
36 References: <cover.1309244829.git.jani@nikula.org>
\r
37 <21340f6b77dcd4f27bb06a39236f276cdfb5b2f7.1309244829.git.jani@nikula.org>
\r
38 User-Agent: Notmuch/0.5-303-g00a1bf6 (http://notmuchmail.org) Emacs/23.1.50.1
\r
39 (x86_64-pc-linux-gnu)
\r
40 Date: Thu, 30 Jun 2011 09:56:22 +0200
\r
41 Message-ID: <871uyb7nx5.fsf@praet.org>
\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
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, 30 Jun 2011 07:56:27 -0000
\r
58 On Tue, 28 Jun 2011 07:31:32 +0000, Jani Nikula <jani@nikula.org> wrote:
\r
59 > Add a pseudo tag that matches all the messages that have no tags. Add new
\r
60 > customization option notmuch-tags-nomatch to enable and name the pseudo
\r
63 > emacs/notmuch-hello.el | 18 ++++++++++++++++--
\r
64 > 1 files changed, 16 insertions(+), 2 deletions(-)
\r
66 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
67 > index b9c9b01..1770f60 100644
\r
68 > --- a/emacs/notmuch-hello.el
\r
69 > +++ b/emacs/notmuch-hello.el
\r
70 > @@ -53,6 +53,12 @@
\r
74 > +(defcustom notmuch-tags-nomatch nil
\r
75 > + "Name of the pseudo tag to match messages that have no tags."
\r
76 > + :type '(choice (const :tag "Off" nil)
\r
78 > + :group 'notmuch)
\r
80 > (defvar notmuch-hello-indent 4
\r
81 > "How much to indent non-headers.")
\r
83 > @@ -352,7 +358,7 @@ Complete list of currently available key bindings:
\r
85 > (defun notmuch-hello-generate-tag-alist ()
\r
86 > "Return an alist from tags to queries to display in the all-tags section."
\r
87 > - (notmuch-remove-if-not
\r
88 > + (let ((tag-alist (notmuch-remove-if-not
\r
90 > (mapcar (lambda (tag)
\r
92 > @@ -367,7 +373,15 @@ Complete list of currently available key bindings:
\r
93 > (notmuch-remove-if-not
\r
95 > (not (member tag notmuch-hello-hide-tags)))
\r
96 > - (process-lines notmuch-command "search-tags")))))
\r
97 > + (process-lines notmuch-command "search-tags"))))))
\r
98 > + (when notmuch-tags-nomatch
\r
99 > + (let ((no-tag-search
\r
100 > + (cons notmuch-tags-nomatch
\r
101 > + (mapconcat (lambda (arg) (concat "(not (" (cdr arg) "))")) tag-alist " and "))))
\r
102 > + (if (> (string-to-number (notmuch-saved-search-count (cdr no-tag-search))) 0)
\r
103 > + ;; Append the no-match search.
\r
104 > + (add-to-list 'tag-alist no-tag-search t))))
\r
107 > (defun notmuch-hello-saved-alist ()
\r
108 > (if notmuch-saved-searches
\r
112 > _______________________________________________
\r
113 > notmuch mailing list
\r
114 > notmuch@notmuchmail.org
\r
115 > http://notmuchmail.org/mailman/listinfo/notmuch
\r
118 IMHO, this should be handled in notmuch core.
\r
121 `notmuch search tag:*' matches all tagged
\r
122 `notmuch search tag:' matches all non-tagged.
\r
124 -> No need for an extra customization option in Emacs,
\r
125 just a simple saved search.
\r