Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / ed / 1021bf84e603d3d0a3129d29f8784951e4ac2a
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 C29D04196F2\r
6         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:10 -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 Fc40xPmcUvkm for <notmuch@notmuchmail.org>;\r
16         Mon, 12 Apr 2010 01:26:10 -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 CF714431FC1\r
20         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:09 -0700 (PDT)\r
21 Received: by bwz2 with SMTP id 2so3959561bwz.30\r
22         for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:08 -0700 (PDT)\r
23 Received: by 10.204.4.211 with SMTP id 19mr4267027bks.166.1271060768355;\r
24         Mon, 12 Apr 2010 01:26:08 -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 x16sm36105693bku.5.2010.04.12.01.26.06\r
27         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
28         Mon, 12 Apr 2010 01:26:07 -0700 (PDT)\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
30         id A1FDE5941E1; Mon, 12 Apr 2010 09:26:03 +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: <87ljctjdek.fsf@ut.hh.sledj.net>\r
34 References: <87wrwd95tl.fsf@nar.taruti.net> <87ljctjdek.fsf@ut.hh.sledj.net>\r
35 From: David Edmondson <dme@dme.org>\r
36 Date: Mon, 12 Apr 2010 09:26:03 +0100\r
37 Message-ID: <87k4sdjcv8.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:26:10 -0000\r
53 \r
54 Oops. That one wasn't complete. Try:\r
55 \r
56 commit 0c55967141e7685b0ba23b45a74c1e48a5964f6c\r
57 Author: David Edmondson <dme@dme.org>\r
58 Date:   Mon Apr 12 09:24:44 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..b6a5e5f 100644\r
71 --- a/emacs/notmuch.el\r
72 +++ b/emacs/notmuch.el\r
73 @@ -888,16 +888,43 @@ 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 +      ;; Must come after `notmuch-folder-mode', as that kills all\r
114 +      ;; local variables.\r
115 +      (set (make-local-variable 'notmuch-folders) folders)\r
116        (notmuch-folder-add notmuch-folders)\r
117        (goto-char (point-min))\r
118        (goto-line n))))\r
119 \r
120 \r
121 dme.\r
122 -- \r
123 David Edmondson, http://dme.org\r