Re: [PATCH] Fix typo in Message.maildir_flags_to_tags
[notmuch-archives.git] / 9e / e93270510d54bfbca734584bf654f762ac2c1f
1 Return-Path: <dme@dme.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 763F54196F2\r
6         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:14:36 -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: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\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 FiPFLM02iFKO for <notmuch@notmuchmail.org>;\r
16         Mon, 12 Apr 2010 01:14:34 -0700 (PDT)\r
17 Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com\r
18         [209.85.218.210])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4D78A431FC1\r
20         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:14:34 -0700 (PDT)\r
21 Received: by bwz2 with SMTP id 2so3946736bwz.30\r
22         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:14:33 -0700 (PDT)\r
23 Received: by 10.204.136.15 with SMTP id p15mr4283318bkt.172.1271060073328;\r
24         Mon, 12 Apr 2010 01:14:33 -0700 (PDT)\r
25 Received: from ut.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])\r
26         by mx.google.com with ESMTPS id d5sm36020672bkd.7.2010.04.12.01.14.31\r
27         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
28         Mon, 12 Apr 2010 01:14:32 -0700 (PDT)\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
30         id E0CE65941E1; Mon, 12 Apr 2010 09:14:27 +0100 (BST)\r
31 To: Taru Karttunen <taruti@taruti.net>, notmuch@notmuchmail.org\r
32 Subject: Re: sup-like label listings (elisp)\r
33 In-Reply-To: <87wrwd95tl.fsf@nar.taruti.net>\r
34 References: <87wrwd95tl.fsf@nar.taruti.net>\r
35 From: David Edmondson <dme@dme.org>\r
36 Date: Mon, 12 Apr 2010 09:14:27 +0100\r
37 Message-ID: <87ljctjdek.fsf@ut.hh.sledj.net>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain; charset=us-ascii\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Mon, 12 Apr 2010 08:14:36 -0000\r
53 \r
54 How about this approach:\r
55 \r
56 commit 0f591b5ac149179540327f1d300009b593c043ec\r
57 Author: David Edmondson <dme@dme.org>\r
58 Date:   Mon Apr 12 09:13:15 2010 +0100\r
59 \r
60     emacs: More flexible folder mode construction\r
61     \r
62     Allow callers to `notmuch-folder' to optionally specify the alist of\r
63     folders to be shown and a title for the buffer.\r
64     \r
65     Add `notmuch-folder-all-tags' and `notmuch-folder-all-tags-unread'\r
66     based on the above.\r
67 \r
68         Modified emacs/notmuch.el\r
69 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
70 index 6d44249..7b867c6 100644\r
71 --- a/emacs/notmuch.el\r
72 +++ b/emacs/notmuch.el\r
73 @@ -888,17 +888,41 @@ Currently available key bindings:\r
74      (if search\r
75         (notmuch-search (cdr search) notmuch-search-oldest-first))))\r
76  \r
77 +(defun notmuch-folder-all-tags-unread ()\r
78 +  "Show the notmuch folder view for messages tagged `unread' for\r
79 +all tags."\r
80 +  (interactive)\r
81 +  (notmuch-folder-all-tags "tag:unread"))\r
82 +\r
83 +(defun notmuch-folder-all-tags (&optional search-restriction)\r
84 +  "Show the notmuch folder view for all tags. The optional\r
85 +parameter `search-restriction' allows the tag based search to be\r
86 +refined."\r
87 +  (interactive)\r
88 +  (notmuch-folder\r
89 +   (mapcar '(lambda (tag)\r
90 +             (cons tag (concat "tag:" tag\r
91 +                               (if search-restriction\r
92 +                                   (concat " AND ( " search-restriction " )")\r
93 +                                 ""))))\r
94 +          (process-lines notmuch-command "search-tags"))\r
95 +   search-restriction))\r
96 +\r
97  ;;;###autoload\r
98 -(defun notmuch-folder ()\r
99 +(defun notmuch-folder (&optional folders title)\r
100    "Show the notmuch folder view and update the displayed counts."\r
101    (interactive)\r
102 -  (let ((buffer (get-buffer-create "*notmuch-folders*")))\r
103 +  (let ((buffer (get-buffer-create\r
104 +                (concat "*notmuch-folders"\r
105 +                        (if title (concat "-" title) "")\r
106 +                        "*")))\r
107 +       (folders (or folders notmuch-folders)))\r
108      (switch-to-buffer buffer)\r
109      (let ((inhibit-read-only t)\r
110           (n (line-number-at-pos)))\r
111        (erase-buffer)\r
112        (notmuch-folder-mode)\r
113 -      (notmuch-folder-add notmuch-folders)\r
114 +      (notmuch-folder-add folders)\r
115        (goto-char (point-min))\r
116        (goto-line n))))\r
117  \r
118 \r
119 \r
120 dme.\r
121 -- \r
122 David Edmondson, http://dme.org\r