From: David Bremner Date: Sat, 27 Dec 2014 09:18:27 +0000 (+0100) Subject: [PATCH] emacs: Added "is:" style completion to notmuch-read-query. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=82f0abf8ba9fb269140e0761ae0fa981926517bd;p=notmuch-archives.git [PATCH] emacs: Added "is:" style completion to notmuch-read-query. --- diff --git a/b7/554dbcb00b8349d31c31bb06190755e82333f5 b/b7/554dbcb00b8349d31c31bb06190755e82333f5 new file mode 100644 index 000000000..203322fe0 --- /dev/null +++ b/b7/554dbcb00b8349d31c31bb06190755e82333f5 @@ -0,0 +1,91 @@ +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 388AD431FAF + for ; Sat, 27 Dec 2014 07:12:14 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 0JuB9cQSEh4t for ; + Sat, 27 Dec 2014 07:12:11 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0BF55431FAE + for ; Sat, 27 Dec 2014 07:12:11 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1Y4t2E-0006Ct-MZ; Sat, 27 Dec 2014 11:12:06 -0400 +Received: (nullmailer pid 27218 invoked by uid 1000); Sat, 27 Dec 2014 + 09:18:37 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: Added "is:" style completion to + notmuch-read-query. +Date: Sat, 27 Dec 2014 10:18:27 +0100 +Message-Id: <1419671907-27170-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.3 +In-Reply-To: +References: +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, 27 Dec 2014 15:12:14 -0000 + +From: Charles Celerier + +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. + +Amended by David Bremner: combine lexical-let and let into +lexical-let* +--- + emacs/notmuch.el | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 218486a..1b6971e 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." +- (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" "*"))))) ++ (lexical-let* ++ ((all-tags ++ (mapcar (lambda (tag) (notmuch-escape-boolean-term tag)) ++ (process-lines notmuch-command "search" "--output=tags" "*"))) ++ (completions ++ (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:" ++ "subject:" "attachment:") ++ (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.3 +