From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D89B56DE01CE for ; Tue, 27 Sep 2016 02:27:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.01 X-Spam-Level: X-Spam-Status: No, score=-0.01 tagged_above=-999 required=5 tests=[AWL=-0.140, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pcr86zrqYAOQ for ; Tue, 27 Sep 2016 02:27:04 -0700 (PDT) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id 1B0F96DE0005 for ; Tue, 27 Sep 2016 02:27:03 -0700 (PDT) Received: by mail-wm0-f68.google.com with SMTP id b184so174727wma.3 for ; Tue, 27 Sep 2016 02:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZOG9N4INxLs8+4PcspozjGeq6EvmVUxntooCiRmbCMg=; b=v5ci7yJGoqC/FA6Q99ej9U+BvJcI+Yq0dZE/9+caDfpezISsXvX4GPcEv3/+GwPTrU JwrRcvANa/iOxjobrsMDPvysiI9tY5M0WMN3P3j7iw6Eo3q9xL8LBMXYg5tmn5O3PfmO BR3dPkUoLS+sh7xUzwdTd+DDgu/CaAAO/dzK2vY31rKBuwhrB/eUkkDObVJlFmm+TGG8 CLpU1/7rI86XZGL/jKOyz42Z5aqzC9V5OgfR4q9L9dOwT5ETFgZyCy6fdKUaQWzxaqEm OGazEacWJUYuox2TB+cd6DCBY4aAtGW3UN3NOnS+o7wLJgug7scD7d1CVR5VjqbQ23NM qS6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZOG9N4INxLs8+4PcspozjGeq6EvmVUxntooCiRmbCMg=; b=VKNHAMeLW1PFJbgpSFzayau6Oi3vV2O7IUS/LiIFqaoSISQEp4T56z6C2tdfYLNUBF /73OoRa/fwAvKjWUTn1mC2YkcQc5fpJ7I/gwPAV5lyWxTAEeeCsXT76gjloass0HCqAu woDYbTMAax8U7glB2aCaykaC5KeoE6QFLi7b1W0eun/oEAP9LDDst96/UkwyYHsLVANj agKj5Ce8R4aLnFgJsgi74TM8H09GTrA3lkhC962agQ9NVKbWFsHji6cyZdqvH7TkVd5e ndg2v7lBWfRPYqQ4q0DnZj+keMNv+MkUdLJP3pmughOI582qTceYXwpUl9LPpNxJm19S dzng== X-Gm-Message-State: AE9vXwP6607qRVjyDCBAzl0YGlwolB7ne7hqCpSbVi+ggyO4vBfVi6YehyjVQEa2x5Plbg== X-Received: by 10.194.178.65 with SMTP id cw1mr21653192wjc.215.1474968419096; Tue, 27 Sep 2016 02:26:59 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id u64sm15696811wmd.20.2016.09.27.02.26.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2016 02:26:58 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add mimetype completions to searches Date: Tue, 27 Sep 2016 10:26:56 +0100 Message-Id: <1474968416-3572-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 09:27:09 -0000 --- 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