[PATCH] emacs: Added "is:<tag>" style completion to notmuch-read-query.
authorCharles Celerier <cceleri@cs.stanford.edu>
Sat, 29 Nov 2014 00:10:35 +0000 (19:10 +1900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:51 +0000 (14:46 -0700)
8c/9b8e37a223f33504bfeda994ad67f147bc8d0f [new file with mode: 0644]

diff --git a/8c/9b8e37a223f33504bfeda994ad67f147bc8d0f b/8c/9b8e37a223f33504bfeda994ad67f147bc8d0f
new file mode 100644 (file)
index 0000000..e9afeb3
--- /dev/null
@@ -0,0 +1,85 @@
+Return-Path: <cceleri@cs.stanford.edu>\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 17955431FBD\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Nov 2014 16:44:28 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\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 sl3EPXv7v7Mj for <notmuch@notmuchmail.org>;\r
+       Fri, 28 Nov 2014 16:44:20 -0800 (PST)\r
+X-Greylist: delayed 2017 seconds by postgrey-1.32 at olra;\r
+       Fri, 28 Nov 2014 16:44:20 PST\r
+Received: from smtp1.cs.Stanford.EDU (smtp1.cs.stanford.edu [171.64.64.25])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 969E7431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Nov 2014 16:44:20 -0800 (PST)\r
+Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]:55913\r
+       helo=Jane.lan)\r
+       by smtp1.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-SHA256:128)\r
+       (Exim 4.80.1) (envelope-from <cceleri@cs.stanford.edu>)\r
+       id 1XuVcU-0005T5-MY; Fri, 28 Nov 2014 16:10:39 -0800\r
+From: Charles Celerier <cceleri@cs.stanford.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Added "is:<tag>" style completion to\r
+       notmuch-read-query.\r
+Date: Fri, 28 Nov 2014 19:10:35 -0500\r
+Message-Id: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
+X-Mailer: git-send-email 2.1.2\r
+X-Scan-Signature: 67f4a389e065da33eb5969ecb4726704\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: Sat, 29 Nov 2014 00:44:28 -0000\r
+\r
+The notmuch-search-terms man page states that "tag:<tag>" is equivalent\r
+to "is:<tag>". Completion for "is:<tag>" style searches is now supported\r
+in the Emacs interface.\r
+\r
+Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>\r
+---\r
+ emacs/notmuch.el | 8 +++++---\r
+ 1 file changed, 5 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 218486a..e4b77c7 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+   "Read a notmuch-query from the minibuffer with completion.\r
\r
+ PROMPT is the string to prompt with."\r
++  (setq all-tags\r
++        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))\r
++                (process-lines notmuch-command "search" "--output=tags" "*")))\r
+   (lexical-let\r
+       ((completions\r
+       (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"\r
+                     "subject:" "attachment:")\r
+-              (mapcar (lambda (tag)\r
+-                        (concat "tag:" (notmuch-escape-boolean-term tag)))\r
+-                      (process-lines notmuch-command "search" "--output=tags" "*")))))\r
++              (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)\r
++              (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))\r
+     (let ((keymap (copy-keymap minibuffer-local-map))\r
+         (current-query (case major-mode\r
+                          (notmuch-search-mode (notmuch-search-get-query))\r
+-- \r
+2.1.2\r
+\r