Re: sup-like label listings (elisp)
authorDavid Edmondson <dme@dme.org>
Mon, 12 Apr 2010 08:26:03 +0000 (09:26 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:35 +0000 (09:36 -0800)
ed/1021bf84e603d3d0a3129d29f8784951e4ac2a [new file with mode: 0644]

diff --git a/ed/1021bf84e603d3d0a3129d29f8784951e4ac2a b/ed/1021bf84e603d3d0a3129d29f8784951e4ac2a
new file mode 100644 (file)
index 0000000..424f9a0
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C29D04196F2\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:10 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Fc40xPmcUvkm for <notmuch@notmuchmail.org>;\r
+       Mon, 12 Apr 2010 01:26:10 -0700 (PDT)\r
+Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com\r
+       [209.85.218.210])\r
+       by olra.theworths.org (Postfix) with ESMTP id CF714431FC1\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:09 -0700 (PDT)\r
+Received: by bwz2 with SMTP id 2so3959561bwz.30\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Apr 2010 01:26:08 -0700 (PDT)\r
+Received: by 10.204.4.211 with SMTP id 19mr4267027bks.166.1271060768355;\r
+       Mon, 12 Apr 2010 01:26:08 -0700 (PDT)\r
+Received: from ut.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])\r
+       by mx.google.com with ESMTPS id x16sm36105693bku.5.2010.04.12.01.26.06\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Mon, 12 Apr 2010 01:26:07 -0700 (PDT)\r
+Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
+       id A1FDE5941E1; Mon, 12 Apr 2010 09:26:03 +0100 (BST)\r
+To: Taru Karttunen <taruti@taruti.net>, notmuch@notmuchmail.org\r
+Subject: Re: sup-like label listings (elisp)\r
+In-Reply-To: <87ljctjdek.fsf@ut.hh.sledj.net>\r
+References: <87wrwd95tl.fsf@nar.taruti.net> <87ljctjdek.fsf@ut.hh.sledj.net>\r
+From: David Edmondson <dme@dme.org>\r
+Date: Mon, 12 Apr 2010 09:26:03 +0100\r
+Message-ID: <87k4sdjcv8.fsf@ut.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 12 Apr 2010 08:26:10 -0000\r
+\r
+Oops. That one wasn't complete. Try:\r
+\r
+commit 0c55967141e7685b0ba23b45a74c1e48a5964f6c\r
+Author: David Edmondson <dme@dme.org>\r
+Date:   Mon Apr 12 09:24:44 2010 +0100\r
+\r
+    emacs: More flexible folder mode construction\r
+    \r
+    Allow callers to `notmuch-folder' to optionally specify the alist of\r
+    folders to be shown and a title for the buffer.\r
+    \r
+    Add `notmuch-folder-all-tags' and `notmuch-folder-all-tags-unread'\r
+    based on the above.\r
+\r
+       Modified emacs/notmuch.el\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 6d44249..b6a5e5f 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -888,16 +888,43 @@ Currently available key bindings:\r
+     (if search\r
+       (notmuch-search (cdr search) notmuch-search-oldest-first))))\r
\r
++(defun notmuch-folder-all-tags-unread ()\r
++  "Show the notmuch folder view for messages tagged `unread' for\r
++all tags."\r
++  (interactive)\r
++  (notmuch-folder-all-tags "tag:unread"))\r
++\r
++(defun notmuch-folder-all-tags (&optional search-restriction)\r
++  "Show the notmuch folder view for all tags. The optional\r
++parameter `search-restriction' allows the tag based search to be\r
++refined."\r
++  (interactive)\r
++  (notmuch-folder\r
++   (mapcar '(lambda (tag)\r
++            (cons tag (concat "tag:" tag\r
++                              (if search-restriction\r
++                                  (concat " AND ( " search-restriction " )")\r
++                                ""))))\r
++         (process-lines notmuch-command "search-tags"))\r
++   search-restriction))\r
++\r
+ ;;;###autoload\r
+-(defun notmuch-folder ()\r
++(defun notmuch-folder (&optional folders title)\r
+   "Show the notmuch folder view and update the displayed counts."\r
+   (interactive)\r
+-  (let ((buffer (get-buffer-create "*notmuch-folders*")))\r
++  (let ((buffer (get-buffer-create\r
++               (concat "*notmuch-folders"\r
++                       (if title (concat "-" title) "")\r
++                       "*")))\r
++      (folders (or folders notmuch-folders)))\r
+     (switch-to-buffer buffer)\r
+     (let ((inhibit-read-only t)\r
+         (n (line-number-at-pos)))\r
+       (erase-buffer)\r
+       (notmuch-folder-mode)\r
++      ;; Must come after `notmuch-folder-mode', as that kills all\r
++      ;; local variables.\r
++      (set (make-local-variable 'notmuch-folders) folders)\r
+       (notmuch-folder-add notmuch-folders)\r
+       (goto-char (point-min))\r
+       (goto-line n))))\r
+\r
+\r
+dme.\r
+-- \r
+David Edmondson, http://dme.org\r