From: Taru Karttunen <taruti@taruti.net>
To: notmuch@notmuchmail.org
Subject: sup-like label listings (elisp)
Date: Sun, 11 Apr 2010 21:56:06 +0300 [thread overview]
Message-ID: <87wrwd95tl.fsf@nar.taruti.net> (raw)
Hello
Attached is code to produce sup-like label listings.
It adds two new shortcuts:
'l' - produce a listing of all tags and their messages
'L' - produce a listing of all tags and their unread (or starred) messages
(defun taru-notmuch-t2unread (s)
(mapcar (lambda (s) (cons s (concat "tag:" s " AND (tag:unread OR tag:starred)"))) s))
(defun taru-notmuch-t2all (s)
(mapcar (lambda (s) (cons s (concat "tag:" s))) s))
(setq taru-notmuch-real-folders notmuch-folders)
(setq notmuch-search-oldest-first nil)
(defun taru-notmuch-all-tags () (process-lines "notmuch" "search-tags"))
(setq notmuch-folders (taru-notmuch-t2all (taru-notmuch-all-tags)))
(defun taru-notmuch-folders ()
(interactive)
(setq notmuch-folders taru-notmuch-real-folders)
(notmuch-folder))
(defun taru-notmuch-list ()
(interactive)
(setq notmuch-folders (taru-notmuch-t2all (taru-notmuch-all-tags)))
(notmuch-folder))
(defun taru-notmuch-listu ()
(interactive)
(setq notmuch-folders (taru-notmuch-t2unread (taru-notmuch-all-tags)))
(notmuch-folder))
(defun taru-notmuch-addlist ()
(local-set-key "F" 'taru-notmuch-folders) ; folders
(local-set-key "l" 'taru-notmuch-list) ; all tags
(local-set-key "L" 'taru-notmuch-listu)) ; all tags - unread
(add-hook 'notmuch-search-hook 'taru-notmuch-addlist)
I hope others will find this useful.
- Taru Karttunen
next reply other threads:[~2010-04-11 19:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-11 18:56 Taru Karttunen [this message]
2010-04-12 8:14 ` sup-like label listings (elisp) David Edmondson
2010-04-12 8:26 ` David Edmondson
2010-04-12 8:38 ` Sebastian Spaeth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wrwd95tl.fsf@nar.taruti.net \
--to=taruti@taruti.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).