Re: [PATCH] emacs: Added "is:<tag>" style completion to notmuch-read-query.
authorDavid Edmondson <dme@dme.org>
Sat, 29 Nov 2014 07:53:30 +0000 (07:53 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:51 +0000 (14:46 -0700)
bf/8775ddbcf7cad95065e65f4f129551709c19aa [new file with mode: 0644]

diff --git a/bf/8775ddbcf7cad95065e65f4f129551709c19aa b/bf/8775ddbcf7cad95065e65f4f129551709c19aa
new file mode 100644 (file)
index 0000000..298c246
--- /dev/null
@@ -0,0 +1,118 @@
+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 4FF98431FBF\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Nov 2014 23:53:49 -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 PlTk86p7-tFH for <notmuch@notmuchmail.org>;\r
+       Fri, 28 Nov 2014 23:53:36 -0800 (PST)\r
+Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
+       [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6824D431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Nov 2014 23:53:34 -0800 (PST)\r
+Received: by mail-wi0-f173.google.com with SMTP id r20so20282508wiv.0\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Nov 2014 23:53:33 -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=aHyD7ci8CJVuqQ/P36yGz1Vxkw8jXKN95bFUX4rEGBs=;\r
+       b=ZKTeyKt9J4tFs75bIBHsDoHqADXHB9n51KU5sRlzugQC24pxcoAIS8DBacRyZDkLcF\r
+       Tluz5wHNz1aw1zulfDuNAv7H2uO6FcGQ8fpnzdbL5i5GWQMoXqkWPMC+FparWkE20w4s\r
+       YaScjIBg9BO4sghBjQMIORrcIc76OulAQVMzK/SvFdlp5YZEjEcG1HE+KLcO6p+wRi4H\r
+       Ew8vF8N1e6kAofv7aGYQnBRoxoveOmycbR2CIIZ92olyCKAjj2L/WYhbY1+X5F80Jed4\r
+       s56ePRXsMcknhinRAcEPVfZoYt9bj8WP6ytvCUt1mINzZnQr1r1nOWSIH3ZrxPPTuCU6\r
+       +rqw==\r
+X-Gm-Message-State:\r
+ ALoCoQl6d4/1Qkfb5BoI6lHht37VDi/d5Nj0ebNN5TZ58xd2Z1APnDmuSwACQCAKXhqvkCzGWyW9\r
+X-Received: by 10.194.248.195 with SMTP id yo3mr30029629wjc.60.1417247613126; \r
+       Fri, 28 Nov 2014 23:53:33 -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 j2sm18052059wjs.28.2014.11.28.23.53.31\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Fri, 28 Nov 2014 23:53:32 -0800 (PST)\r
+Received: from localhost (30000@localhost [local]);\r
+       by localhost (OpenSMTPD) with ESMTPA id 9ab8c14c;\r
+       Sat, 29 Nov 2014 07:53:30 +0000 (UTC)\r
+To: Charles Celerier <cceleri@cs.stanford.edu>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: Added "is:<tag>" style completion\r
+       to      notmuch-read-query.\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
+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: Sat, 29 Nov 2014 07:53:30 +0000\r
+Message-ID: <cunk32efnnp.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: Sat, 29 Nov 2014 07:53:49 -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 | 8 +++++---\r
+>  1 file changed, 5 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index 218486a..e4b77c7 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+>    "Read a notmuch-query from the minibuffer with completion.\r
+>  \r
+>  PROMPT is the string to prompt with."\r
+> +  (setq all-tags\r
+> +        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))\r
+> +                (process-lines notmuch-command "search"\r
+>                  "--output=tags" "*")))\r
+\r
+Should use a `let' binding rather than `setq'. Otherwise, looks good.\r
+\r
+>    (lexical-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
+> -- \r
+> 2.1.2\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r