1 Return-Path: <jani@nikula.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 3296D429E4E
\r
6 for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[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 PV8Ew36cnxl4 for <notmuch@notmuchmail.org>;
\r
17 Tue, 28 Jun 2011 00:31:54 -0700 (PDT)
\r
18 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com
\r
19 [209.85.216.181]) (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 BA7A2429E5B
\r
22 for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:54 -0700 (PDT)
\r
23 Received: by mail-qy0-f181.google.com with SMTP id 9so3511754qyk.5
\r
24 for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:54 -0700 (PDT)
\r
25 Received: by 10.229.47.18 with SMTP id l18mr1841005qcf.55.1309246314518;
\r
26 Tue, 28 Jun 2011 00:31:54 -0700 (PDT)
\r
27 Received: from localhost (nikula.org [92.243.24.172])
\r
28 by mx.google.com with ESMTPS id t21sm4628575qcs.38.2011.06.28.00.31.53
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Tue, 28 Jun 2011 00:31:53 -0700 (PDT)
\r
31 From: Jani Nikula <jani@nikula.org>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 4/4] emacs: Add pseudo tag to match all messages that have no
\r
35 Date: Tue, 28 Jun 2011 07:31:32 +0000
\r
37 <21340f6b77dcd4f27bb06a39236f276cdfb5b2f7.1309244829.git.jani@nikula.org>
\r
38 X-Mailer: git-send-email 1.7.1
\r
39 In-Reply-To: <cover.1309244829.git.jani@nikula.org>
\r
40 References: <cover.1309244829.git.jani@nikula.org>
\r
41 In-Reply-To: <cover.1309244829.git.jani@nikula.org>
\r
42 References: <cover.1309244829.git.jani@nikula.org>
\r
43 X-Mailman-Approved-At: Tue, 28 Jun 2011 10:59:27 -0700
\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: Tue, 28 Jun 2011 07:31:55 -0000
\r
58 Add a pseudo tag that matches all the messages that have no tags. Add new
\r
59 customization option notmuch-tags-nomatch to enable and name the pseudo
\r
62 emacs/notmuch-hello.el | 18 ++++++++++++++++--
\r
63 1 files changed, 16 insertions(+), 2 deletions(-)
\r
65 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
66 index b9c9b01..1770f60 100644
\r
67 --- a/emacs/notmuch-hello.el
\r
68 +++ b/emacs/notmuch-hello.el
\r
73 +(defcustom notmuch-tags-nomatch nil
\r
74 + "Name of the pseudo tag to match messages that have no tags."
\r
75 + :type '(choice (const :tag "Off" nil)
\r
79 (defvar notmuch-hello-indent 4
\r
80 "How much to indent non-headers.")
\r
82 @@ -352,7 +358,7 @@ Complete list of currently available key bindings:
\r
84 (defun notmuch-hello-generate-tag-alist ()
\r
85 "Return an alist from tags to queries to display in the all-tags section."
\r
86 - (notmuch-remove-if-not
\r
87 + (let ((tag-alist (notmuch-remove-if-not
\r
89 (mapcar (lambda (tag)
\r
91 @@ -367,7 +373,15 @@ Complete list of currently available key bindings:
\r
92 (notmuch-remove-if-not
\r
94 (not (member tag notmuch-hello-hide-tags)))
\r
95 - (process-lines notmuch-command "search-tags")))))
\r
96 + (process-lines notmuch-command "search-tags"))))))
\r
97 + (when notmuch-tags-nomatch
\r
98 + (let ((no-tag-search
\r
99 + (cons notmuch-tags-nomatch
\r
100 + (mapconcat (lambda (arg) (concat "(not (" (cdr arg) "))")) tag-alist " and "))))
\r
101 + (if (> (string-to-number (notmuch-saved-search-count (cdr no-tag-search))) 0)
\r
102 + ;; Append the no-match search.
\r
103 + (add-to-list 'tag-alist no-tag-search t))))
\r
106 (defun notmuch-hello-saved-alist ()
\r
107 (if notmuch-saved-searches
\r