[PATCH] emacs: add mimetype completions to searches

Mark Walters markwalters1009 at gmail.com
Tue Sep 27 02:26:56 PDT 2016


---

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



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))
-- 
2.1.4



More information about the notmuch mailing list