From: Charles Celerier Date: Sat, 29 Nov 2014 16:39:57 +0000 (+1900) Subject: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a25fb99247a281a9ad7bb3d28cdbab87a4d3b8d;p=notmuch-archives.git [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query. --- diff --git a/41/41d95d38af89a4a98160f5d1182c27c1848f5e b/41/41d95d38af89a4a98160f5d1182c27c1848f5e new file mode 100644 index 000000000..7406888b1 --- /dev/null +++ b/41/41d95d38af89a4a98160f5d1182c27c1848f5e @@ -0,0 +1,94 @@ +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 1FF5F431FBF + for ; Sat, 29 Nov 2014 08:40:26 -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 Os+LTwPVzNvR for ; + Sat, 29 Nov 2014 08:40:18 -0800 (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 466CC431FAE + for ; Sat, 29 Nov 2014 08:40:18 -0800 (PST) +Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]:58810 + helo=Jane.lan) + by smtp1.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-SHA256:128) + (Exim 4.80.1) (envelope-from ) + id 1Xul4B-0007yP-QT; Sat, 29 Nov 2014 08:40:16 -0800 +From: Charles Celerier +To: Notmuch Mail +Subject: [PATCH v2] emacs: Added "is:" style completion to + notmuch-read-query. +Date: Sat, 29 Nov 2014 11:39:57 -0500 +Message-Id: <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu> +X-Mailer: git-send-email 2.1.2 +In-Reply-To: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu> +References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu> +X-Scan-Signature: f9929892efd47015c544d6ca2fb551e9 +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 16:40:26 -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 | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 218486a..d29499c 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." + + PROMPT is the string to prompt with." + (lexical-let ++ (( all-tags ++ (mapcar (lambda (tag) (notmuch-escape-boolean-term tag)) ++ (process-lines notmuch-command "search" "--output=tags" "*")))) ++ (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)) +@@ -884,7 +887,7 @@ PROMPT is the string to prompt with." + (define-key keymap (kbd "TAB") 'minibuffer-complete) + (let ((history-delete-duplicates t)) + (read-from-minibuffer prompt nil keymap nil +- 'notmuch-search-history current-query nil))))) ++ 'notmuch-search-history current-query nil)))))) + + (defun notmuch-search-get-query () + "Return the current query in this search buffer" +-- +2.1.2 +