Re: Hi all
[notmuch-archives.git] / f8 / d5e45c0e1d04889e8fd7bae43124ecf90573bd
1 Return-Path: <taruti@taruti.net>\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 EE9444196F2\r
6         for <notmuch@notmuchmail.org>; Sun, 11 Apr 2010 12:01:09 -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.5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.5 tagged_above=-999 required=5\r
12         tests=[BAYES_50=0.8, RCVD_IN_DNSWL_MED=-2.3] 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 qDk6cvHmR7wx for <notmuch@notmuchmail.org>;\r
16         Sun, 11 Apr 2010 12:01:09 -0700 (PDT)\r
17 X-Greylist: delayed 301 seconds by postgrey-1.32 at olra;\r
18         Sun, 11 Apr 2010 12:01:09 PDT\r
19 Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1])\r
20         by olra.theworths.org (Postfix) with ESMTP id 3B3BB431FC1\r
21         for <notmuch@notmuchmail.org>; Sun, 11 Apr 2010 12:01:09 -0700 (PDT)\r
22 Received: from nar.taruti.net (melkki.cs.helsinki.fi [128.214.9.98])\r
23         by mail.cs.helsinki.fi with esmtp; Sun, 11 Apr 2010 21:56:07 +0300\r
24         id 00093EA6.4BC21B47.000002DF\r
25 From: Taru Karttunen <taruti@taruti.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: sup-like label listings (elisp)\r
28 Date: Sun, 11 Apr 2010 21:56:06 +0300\r
29 Message-ID: <87wrwd95tl.fsf@nar.taruti.net>\r
30 Mime-Version: 1.0\r
31 Content-Type: text/plain; charset=us-ascii\r
32 Content-Transfer-Encoding: 7bit\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Sun, 11 Apr 2010 19:01:10 -0000\r
46 \r
47 \r
48 Hello\r
49 \r
50 Attached is code to produce sup-like label listings.\r
51 It adds two new shortcuts:\r
52 'l' - produce a listing of all tags and their messages\r
53 'L' - produce a listing of all tags and their unread (or starred) messages\r
54 \r
55 (defun taru-notmuch-t2unread (s)\r
56   (mapcar (lambda (s) (cons s (concat "tag:" s " AND (tag:unread OR tag:starred)"))) s))\r
57 (defun taru-notmuch-t2all (s)\r
58   (mapcar (lambda (s) (cons s (concat "tag:" s))) s))\r
59 \r
60 (setq taru-notmuch-real-folders notmuch-folders)\r
61 (setq notmuch-search-oldest-first nil)\r
62 \r
63 (defun taru-notmuch-all-tags () (process-lines "notmuch" "search-tags"))\r
64 \r
65 (setq notmuch-folders (taru-notmuch-t2all (taru-notmuch-all-tags)))\r
66 \r
67 (defun taru-notmuch-folders ()\r
68   (interactive)\r
69   (setq notmuch-folders taru-notmuch-real-folders)\r
70   (notmuch-folder))\r
71 (defun taru-notmuch-list ()\r
72   (interactive)\r
73   (setq notmuch-folders (taru-notmuch-t2all (taru-notmuch-all-tags)))\r
74   (notmuch-folder))\r
75 (defun taru-notmuch-listu ()\r
76   (interactive)\r
77   (setq notmuch-folders (taru-notmuch-t2unread (taru-notmuch-all-tags)))\r
78   (notmuch-folder))\r
79 (defun taru-notmuch-addlist () \r
80   (local-set-key "F" 'taru-notmuch-folders) ; folders\r
81   (local-set-key "l" 'taru-notmuch-list)    ; all tags\r
82   (local-set-key "L" 'taru-notmuch-listu))  ; all tags - unread\r
83   \r
84 (add-hook 'notmuch-search-hook 'taru-notmuch-addlist)\r
85 \r
86 \r
87 I hope others will find this useful.\r
88 \r
89 \r
90 - Taru Karttunen\r