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

David Edmondson dme at dme.org
Sun Nov 30 22:38:29 PST 2014


On Sat, Nov 29 2014, Charles Celerier wrote:
> 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 | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 218486a..d29499c 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
>  
>  PROMPT is the string to prompt with."
>    (lexical-let
> +    (( all-tags
> +        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
> +                (process-lines notmuch-command "search" "--output=tags" "*"))))
> +  (let

I think that David's suggestion was that you would have only one `let'
form, so something like:

 (lexical-let*
   ((all-tags (mapcar ...))
    (completions (append ...))
    (keymap (copy-keymap ...))
    (current-query ...))
     ...)

>        ((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))
> @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."
>        (define-key keymap (kbd "TAB") 'minibuffer-complete)
>        (let ((history-delete-duplicates t))
>  	(read-from-minibuffer prompt nil keymap nil
> -			      'notmuch-search-history current-query nil)))))
> +			      'notmuch-search-history current-query nil))))))
>  
>  (defun notmuch-search-get-query ()
>    "Return the current query in this search buffer"
> -- 
> 2.1.2
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list