unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* sup-like label listings (elisp)
@ 2010-04-11 18:56 Taru Karttunen
  2010-04-12  8:14 ` David Edmondson
  0 siblings, 1 reply; 4+ messages in thread
From: Taru Karttunen @ 2010-04-11 18:56 UTC (permalink / raw)
  To: notmuch


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-12  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-11 18:56 sup-like label listings (elisp) Taru Karttunen
2010-04-12  8:14 ` David Edmondson
2010-04-12  8:26   ` David Edmondson
2010-04-12  8:38   ` Sebastian Spaeth

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).