Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EE9444196F2 for ; Sun, 11 Apr 2010 12:01:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.5 X-Spam-Level: X-Spam-Status: No, score=-1.5 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qDk6cvHmR7wx for ; Sun, 11 Apr 2010 12:01:09 -0700 (PDT) X-Greylist: delayed 301 seconds by postgrey-1.32 at olra; Sun, 11 Apr 2010 12:01:09 PDT Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1]) by olra.theworths.org (Postfix) with ESMTP id 3B3BB431FC1 for ; Sun, 11 Apr 2010 12:01:09 -0700 (PDT) Received: from nar.taruti.net (melkki.cs.helsinki.fi [128.214.9.98]) by mail.cs.helsinki.fi with esmtp; Sun, 11 Apr 2010 21:56:07 +0300 id 00093EA6.4BC21B47.000002DF From: Taru Karttunen To: notmuch@notmuchmail.org Subject: sup-like label listings (elisp) Date: Sun, 11 Apr 2010 21:56:06 +0300 Message-ID: <87wrwd95tl.fsf@nar.taruti.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 19:01:10 -0000 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