[PATCH] emacs: Added "is:<tag>" style completion to notmuch-read-query.

Charles Celerier cceleri at cs.stanford.edu
Fri Nov 28 16:10:35 PST 2014


The notmuch-search-terms man page states that "tag:<tag>" is equivalent
to "is:<tag>". Completion for "is:<tag>" style searches is now supported
in the Emacs interface.

Signed-off-by: Charles Celerier <cceleri at cs.stanford.edu>
---
 emacs/notmuch.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 218486a..e4b77c7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
   "Read a notmuch-query from the minibuffer with completion.
 
 PROMPT is the string to prompt with."
+  (setq all-tags
+        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+                (process-lines notmuch-command "search" "--output=tags" "*")))
   (lexical-let
       ((completions
 	(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
 		      "subject:" "attachment:")
-		(mapcar (lambda (tag)
-			  (concat "tag:" (notmuch-escape-boolean-term tag)))
-			(process-lines notmuch-command "search" "--output=tags" "*")))))
+		(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+		(mapcar (lambda (tag) (concat "is:" tag)) all-tags))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
-- 
2.1.2



More information about the notmuch mailing list