unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: Added "is:<tag>" style completion to notmuch-read-query.
Date: Sat, 27 Dec 2014 10:18:27 +0100	[thread overview]
Message-ID: <1419671907-27170-1-git-send-email-david@tethera.net> (raw)
In-Reply-To: <m2tx1fry0s.fsf@Jane.lan>

From: Charles Celerier <cceleri@cs.stanford.edu>

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.

Amended by David Bremner: combine lexical-let and let into
lexical-let*
---
 emacs/notmuch.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 218486a..1b6971e 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."
-  (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" "*")))))
+  (lexical-let*
+      ((all-tags
+        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+                (process-lines notmuch-command "search" "--output=tags" "*")))
+       (completions
+	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
+		       "subject:" "attachment:")
+		 (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.3

  reply	other threads:[~2014-12-27 15:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29  0:10 [PATCH] emacs: Added "is:<tag>" style completion to notmuch-read-query Charles Celerier
2014-11-29  7:53 ` David Edmondson
2014-11-29  8:06   ` David Bremner
2014-11-29 16:40     ` Charles Celerier
2014-11-29 16:39 ` [PATCH v2] " Charles Celerier
2014-12-01  6:38   ` David Edmondson
2014-12-01 17:01     ` Charles Celerier
2014-12-01 17:58       ` Lele Gaifax
2014-12-01 18:04       ` David Bremner
2014-12-01 19:05         ` Charles Celerier
2014-12-27  9:18           ` David Bremner [this message]
2015-04-05 15:48             ` [PATCH] " Mark Walters
2015-05-31 17:14             ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419671907-27170-1-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).