unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: add mimetype completions to searches
@ 2016-09-27  9:26 Mark Walters
  2016-09-27 11:31 ` David Bremner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mark Walters @ 2016-09-27  9:26 UTC (permalink / raw)
  To: notmuch

---

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-22 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27  9:26 [PATCH] emacs: add mimetype completions to searches Mark Walters
2016-09-27 11:31 ` David Bremner
2016-09-28 12:52   ` David Bremner
2016-10-09 12:09 ` David Bremner
2016-10-22  9:55 ` Jani Nikula
2016-10-22 18:08   ` Keith Amidon
2016-10-22 18:58     ` Jani Nikula

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).