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

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*
This commit is contained in:
Charles Celerier 2014-12-27 10:18:27 +01:00 committed by David Bremner
parent b271763152
commit 1896ad9714

View file

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