Re: [PATCH v2] emacs: Added "is:<tag>" style completion to notmuch-read-query.
authorDavid Edmondson <dme@dme.org>
Mon, 1 Dec 2014 06:38:29 +0000 (06:38 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:53 +0000 (14:46 -0700)
d2/d17db0f73152160698b1d7c354595e0d08cdad [new file with mode: 0644]

diff --git a/d2/d17db0f73152160698b1d7c354595e0d08cdad b/d2/d17db0f73152160698b1d7c354595e0d08cdad
new file mode 100644 (file)
index 0000000..43a6a02
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <dme@dme.org>\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 55E17431FC0\r
+       for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:45 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001]\r
+       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 Q3NXG8yylOlu for <notmuch@notmuchmail.org>;\r
+       Sun, 30 Nov 2014 22:38:35 -0800 (PST)\r
+Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com\r
+       [209.85.212.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5724E431FBC\r
+       for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:33 -0800 (PST)\r
+Received: by mail-wi0-f177.google.com with SMTP id l15so16191918wiw.16\r
+       for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:32 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
+       :from:date:message-id:mime-version:content-type;\r
+       bh=k0jTyZDV08fyvTWPzhoIG/icGar9Ve6sdXwO34t96gA=;\r
+       b=CXk2gH0Oijcs6rp5EdiLdO3tQ64PldB7TEREJt0fsqLWgT66VOL4kuyBxtxgudTSXy\r
+       rQNBX9M1+2qCnl6aP+Alht9C3OduC0J5NqLnjtbC3U1jKhHMGPMyzMUYIbNNUjLFUc+R\r
+       ZNeo6ZbEWTH0mz5cLFDURAaJwYtT1lX0y2K3EHKZbs8Ea5bpO8WI4PjTgF2a8Q2BrqPj\r
+       Dds1LrxAK9kbJVUUqGeVx0ILIlq1oNAJSHy6b4VtHaUHcrBn5r4NBH3K1JQjP8WazXby\r
+       FCVmuCbAFbDO4VtmwOi5AxNL+A3vaRKOpvLqxLdiRhCOqq8VgqVWD4t+GnL+SpEDwSZA\r
+       MNKw==\r
+X-Gm-Message-State:\r
+ ALoCoQlRLPAZuho/2q5q6rLy99PbjWF1AO0W2p8imrHpGgkneLtao6qpa3o0q5d8v298xoBl+n1u\r
+X-Received: by 10.194.24.103 with SMTP id t7mr71227796wjf.15.1417415912418;\r
+       Sun, 30 Nov 2014 22:38:32 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+       ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+       by mx.google.com with ESMTPSA id h2sm27083163wix.5.2014.11.30.22.38.30\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Sun, 30 Nov 2014 22:38:31 -0800 (PST)\r
+Received: from localhost (30000@localhost [local]);\r
+       by localhost (OpenSMTPD) with ESMTPA id 50b41cdf;\r
+       Mon, 1 Dec 2014 06:38:29 +0000 (UTC)\r
+To: Charles Celerier <cceleri@cs.stanford.edu>,\r
+       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: <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
+References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
+       <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
+User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1\r
+       (x86_64-pc-linux-gnu)\r
+From: David Edmondson <dme@dme.org>\r
+Date: Mon, 01 Dec 2014 06:38:29 +0000\r
+Message-ID: <cunh9xfg9i2.fsf@gargravarr.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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 06:38:46 -0000\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 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
+\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=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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r