emacs: add mimetype completions to searches
authorMark Walters <markwalters1009@gmail.com>
Tue, 27 Sep 2016 09:26:56 +0000 (10:26 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 9 Oct 2016 11:50:02 +0000 (08:50 -0300)
emacs/notmuch.el

index 888672b5af3e210f7e3290b635735f4d790f10a2..6c36ad8a9e4045182cda6a92b76fae2c4db52055 100644 (file)
@@ -892,9 +892,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))