[PATCH] emacs: add mimetype completions to searches

David Bremner david at tethera.net
Tue Sep 27 04:31:33 PDT 2016


Mark Walters <markwalters1009 at gmail.com> writes:

> ---
>
> When doing the patch for commit
> f94921520778ae4005500f5d1b943e2d4ddd3b2a emacs: show: let the user
> override the mime-type of an attachment, I discovered how to do
> mimetype completion (in particular where to get a list of mimetypes),
> so we may as well add this completion for searches too.
>
> Best wishes
>
> Mark

Did you mean to have an empty commit message?

> emacs/notmuch.el | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 8e14692..29afd45 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -891,9 +891,10 @@ PROMPT is the string to prompt with."
>                  (process-lines notmuch-command "search" "--output=tags" "*")))
>         (completions
>  	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> -		       "subject:" "attachment:" "mimetype:")
> +		       "subject:" "attachment:")
>  		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> -		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))
> +		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
> +		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
>      (let ((keymap (copy-keymap minibuffer-local-map))
>  	  (current-query (case major-mode
>  			   (notmuch-search-mode (notmuch-search-get-query))

I don't seem to have the variable mailcap-mime-types in this emacs
session, with notmuch loaded.


More information about the notmuch mailing list