[PATCH v2] emacs: Added "is:<tag>" style completion to notmuch-read-query.
authorCharles Celerier <cceleri@cs.stanford.edu>
Sat, 29 Nov 2014 16:39:57 +0000 (11:39 +1900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:52 +0000 (14:46 -0700)
41/41d95d38af89a4a98160f5d1182c27c1848f5e [new file with mode: 0644]

diff --git a/41/41d95d38af89a4a98160f5d1182c27c1848f5e b/41/41d95d38af89a4a98160f5d1182c27c1848f5e
new file mode 100644 (file)
index 0000000..7406888
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <cceleri@cs.stanford.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1FF5F431FBF\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Nov 2014 08:40:26 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Os+LTwPVzNvR for <notmuch@notmuchmail.org>;\r
+       Sat, 29 Nov 2014 08:40:18 -0800 (PST)\r
+Received: from smtp1.cs.Stanford.EDU (smtp1.cs.stanford.edu [171.64.64.25])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 466CC431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 29 Nov 2014 08:40:18 -0800 (PST)\r
+Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]:58810\r
+       helo=Jane.lan)\r
+       by smtp1.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-SHA256:128)\r
+       (Exim 4.80.1) (envelope-from <cceleri@cs.stanford.edu>)\r
+       id 1Xul4B-0007yP-QT; Sat, 29 Nov 2014 08:40:16 -0800\r
+From: Charles Celerier <cceleri@cs.stanford.edu>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH v2] emacs: Added "is:<tag>" style completion to\r
+       notmuch-read-query.\r
+Date: Sat, 29 Nov 2014 11:39:57 -0500\r
+Message-Id: <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
+X-Mailer: git-send-email 2.1.2\r
+In-Reply-To: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
+References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
+X-Scan-Signature: f9929892efd47015c544d6ca2fb551e9\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 29 Nov 2014 16:40:26 -0000\r
+\r
+The notmuch-search-terms man page states that "tag:<tag>" is equivalent\r
+to "is:<tag>". Completion for "is:<tag>" style searches is now supported\r
+in the Emacs interface.\r
+\r
+Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>\r
+---\r
+ emacs/notmuch.el | 11 +++++++----\r
+ 1 file changed, 7 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 218486a..d29499c 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
\r
+ PROMPT is the string to prompt with."\r
+   (lexical-let\r
++    (( all-tags\r
++        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))\r
++                (process-lines notmuch-command "search" "--output=tags" "*"))))\r
++  (let\r
+       ((completions\r
+       (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"\r
+                     "subject:" "attachment:")\r
+-              (mapcar (lambda (tag)\r
+-                        (concat "tag:" (notmuch-escape-boolean-term tag)))\r
+-                      (process-lines notmuch-command "search" "--output=tags" "*")))))\r
++              (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)\r
++              (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))\r
+     (let ((keymap (copy-keymap minibuffer-local-map))\r
+         (current-query (case major-mode\r
+                          (notmuch-search-mode (notmuch-search-get-query))\r
+@@ -884,7 +887,7 @@ PROMPT is the string to prompt with."\r
+       (define-key keymap (kbd "TAB") 'minibuffer-complete)\r
+       (let ((history-delete-duplicates t))\r
+       (read-from-minibuffer prompt nil keymap nil\r
+-                            'notmuch-search-history current-query nil)))))\r
++                            'notmuch-search-history current-query nil))))))\r
\r
+ (defun notmuch-search-get-query ()\r
+   "Return the current query in this search buffer"\r
+-- \r
+2.1.2\r
+\r