Re: [PATCH v2] emacs: Added "is:<tag>" style completion to notmuch-read-query.
authorCharles Celerier <cceleri@cs.stanford.edu>
Mon, 1 Dec 2014 17:01:52 +0000 (12:01 +1900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:54 +0000 (14:46 -0700)
e0/c0ffc00d389201fe2c46701969838badccc699 [new file with mode: 0644]

diff --git a/e0/c0ffc00d389201fe2c46701969838badccc699 b/e0/c0ffc00d389201fe2c46701969838badccc699
new file mode 100644 (file)
index 0000000..ef841e7
--- /dev/null
@@ -0,0 +1,146 @@
+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 E622B431FC3\r
+       for <notmuch@notmuchmail.org>; Mon,  1 Dec 2014 09:02:15 -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 bGX68a2NkfGs for <notmuch@notmuchmail.org>;\r
+       Mon,  1 Dec 2014 09:02:09 -0800 (PST)\r
+Received: from smtp2.cs.Stanford.EDU (smtp2.cs.stanford.edu [171.64.64.26])\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 05D98431FC0\r
+       for <notmuch@notmuchmail.org>; Mon,  1 Dec 2014 09:02:08 -0800 (PST)\r
+Received: from tor-exit.de ([195.37.190.67]:44480 helo=Jane.lan)\r
+       by smtp2.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-GCM-SHA256:128)\r
+       (Exim 4.80.1) (envelope-from <cceleri@cs.stanford.edu>)\r
+       id 1XvUMN-0004Ym-4l; Mon, 01 Dec 2014 09:02:06 -0800\r
+From: Charles Celerier <cceleri@cs.stanford.edu>\r
+To: David Edmondson <dme@dme.org>, Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2] emacs: Added "is:<tag>" style completion\r
+       to      notmuch-read-query.\r
+In-Reply-To: <cunh9xfg9i2.fsf@gargravarr.hh.sledj.net>\r
+References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
+       <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
+       <cunh9xfg9i2.fsf@gargravarr.hh.sledj.net>\r
+User-Agent: Notmuch/0.18.1+208~g93eda7e (http://notmuchmail.org) Emacs/24.4.1\r
+       (x86_64-apple-darwin14.0.0)\r
+Date: Mon, 01 Dec 2014 12:01:52 -0500\r
+Message-ID: <m2wq6bs3r3.fsf@Jane.lan>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-Scan-Signature: 1a99e790efc5595ebc7b409aae77a077\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: Mon, 01 Dec 2014 17:02:16 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Can the variables in the varlist depend on the definition of variables\r
+that precede them in the list? I believe I tried your suggestion, but\r
+quickly gave up as Emacs gave me an error claiming that all-tags was\r
+void.\r
+\r
+charles\r
+\r
+David Edmondson <dme@dme.org> writes:\r
+\r
+> On Sat, Nov 29 2014, Charles Celerier wrote:\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=\r
+ TAG-CHANGES."\r
+>>=20=20\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=3Dtag=\r
+s" "*"))))\r
+>> +  (let\r
+>\r
+> I think that David's suggestion was that you would have only one `let'\r
+> form, so something like:\r
+>\r
+>  (lexical-let*\r
+>    ((all-tags (mapcar ...))\r
+>     (completions (append ...))\r
+>     (keymap (copy-keymap ...))\r
+>     (current-query ...))\r
+>      ...)\r
+>\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=3Dtags" "*")))))\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
+>>=20=20\r
+>>  (defun notmuch-search-get-query ()\r
+>>    "Return the current query in this search buffer"\r
+>> --=20\r
+>> 2.1.2\r
+>>\r
+>> _______________________________________________\r
+>> notmuch mailing list\r
+>> notmuch@notmuchmail.org\r
+>> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG/MacGPG2 v2\r
+\r
+iQEcBAEBAgAGBQJUfJ8BAAoJEOjk698fDjuAZMcH/j3DCPbML4Mg4F3SvsDhSDmj\r
+zVQ+m2jiOXGkrpgxf9zJugwutt5PlULMmQkOKB8gxzAAvLFO3WC89zeEm453z12Z\r
+jlKpHJY/DnMF3Y34Sj9UYbUXdIWZEzMqJRv7F6UrWL32xcnOIbV45v1oikUNiRdE\r
+ivhYjU5CiSa8HU1TrbKxidkr3SXfBcD0A6re48zEcCD32Wi86at6a0ZRPANEa5Xa\r
+tGqiyt2AClbIUvJ3o7ozPeVFCFuVi+R3jy1fOM4ynKz2AWCpjEpvMyIDMSztkT9K\r
+xvqpw81x0no9a8Rhq3GkxxxKJBHPKYmoKGVOTxXN4vSEQFsyNP3tyhSgnAyZdus=\r
+=A8/Y\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r