From: Charles Celerier Date: Sat, 29 Nov 2014 00:10:35 +0000 (+1900) Subject: [PATCH] emacs: Added "is:" style completion to notmuch-read-query. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c7d4f881e17e6a42d6d3d325469bbf5bd5c872c4;p=notmuch-archives.git [PATCH] emacs: Added "is:" style completion to notmuch-read-query. --- diff --git a/8c/9b8e37a223f33504bfeda994ad67f147bc8d0f b/8c/9b8e37a223f33504bfeda994ad67f147bc8d0f new file mode 100644 index 000000000..e9afeb39c --- /dev/null +++ b/8c/9b8e37a223f33504bfeda994ad67f147bc8d0f @@ -0,0 +1,85 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 17955431FBD + for ; Fri, 28 Nov 2014 16:44:28 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id sl3EPXv7v7Mj for ; + Fri, 28 Nov 2014 16:44:20 -0800 (PST) +X-Greylist: delayed 2017 seconds by postgrey-1.32 at olra; + Fri, 28 Nov 2014 16:44:20 PST +Received: from smtp1.cs.Stanford.EDU (smtp1.cs.stanford.edu [171.64.64.25]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 969E7431FAE + for ; Fri, 28 Nov 2014 16:44:20 -0800 (PST) +Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]:55913 + helo=Jane.lan) + by smtp1.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-SHA256:128) + (Exim 4.80.1) (envelope-from ) + id 1XuVcU-0005T5-MY; Fri, 28 Nov 2014 16:10:39 -0800 +From: Charles Celerier +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: Added "is:" style completion to + notmuch-read-query. +Date: Fri, 28 Nov 2014 19:10:35 -0500 +Message-Id: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu> +X-Mailer: git-send-email 2.1.2 +X-Scan-Signature: 67f4a389e065da33eb5969ecb4726704 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Sat, 29 Nov 2014 00:44:28 -0000 + +The notmuch-search-terms man page states that "tag:" is equivalent +to "is:". Completion for "is:" style searches is now supported +in the Emacs interface. + +Signed-off-by: Charles Celerier +--- + emacs/notmuch.el | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 218486a..e4b77c7 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." + "Read a notmuch-query from the minibuffer with completion. + + PROMPT is the string to prompt with." ++ (setq all-tags ++ (mapcar (lambda (tag) (notmuch-escape-boolean-term tag)) ++ (process-lines notmuch-command "search" "--output=tags" "*"))) + (lexical-let + ((completions + (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:" + "subject:" "attachment:") +- (mapcar (lambda (tag) +- (concat "tag:" (notmuch-escape-boolean-term tag))) +- (process-lines notmuch-command "search" "--output=tags" "*"))))) ++ (mapcar (lambda (tag) (concat "tag:" tag)) all-tags) ++ (mapcar (lambda (tag) (concat "is:" tag)) all-tags)))) + (let ((keymap (copy-keymap minibuffer-local-map)) + (current-query (case major-mode + (notmuch-search-mode (notmuch-search-get-query)) +-- +2.1.2 +