unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: add mimetype completions to searches
Date: Tue, 27 Sep 2016 10:26:56 +0100	[thread overview]
Message-ID: <1474968416-3572-1-git-send-email-markwalters1009@gmail.com> (raw)

---

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

             reply	other threads:[~2016-09-27  9:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27  9:26 Mark Walters [this message]
2016-09-27 11:31 ` [PATCH] emacs: add mimetype completions to searches 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474968416-3572-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).