From 489e58e6628de453fd243b40cac3fc700f8b6ecb Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Mon, 1 Dec 2014 06:38:29 +0000 Subject: [PATCH] Re: [PATCH v2] emacs: Added "is:" style completion to notmuch-read-query. --- d2/d17db0f73152160698b1d7c354595e0d08cdad | 136 ++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 d2/d17db0f73152160698b1d7c354595e0d08cdad diff --git a/d2/d17db0f73152160698b1d7c354595e0d08cdad b/d2/d17db0f73152160698b1d7c354595e0d08cdad new file mode 100644 index 000000000..43a6a02ca --- /dev/null +++ b/d2/d17db0f73152160698b1d7c354595e0d08cdad @@ -0,0 +1,136 @@ +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 55E17431FC0 + for ; Sun, 30 Nov 2014 22:38:45 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.699 +X-Spam-Level: +X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001] + 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 Q3NXG8yylOlu for ; + Sun, 30 Nov 2014 22:38:35 -0800 (PST) +Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com + [209.85.212.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5724E431FBC + for ; Sun, 30 Nov 2014 22:38:33 -0800 (PST) +Received: by mail-wi0-f177.google.com with SMTP id l15so16191918wiw.16 + for ; Sun, 30 Nov 2014 22:38:32 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:to:subject:in-reply-to:references:user-agent + :from:date:message-id:mime-version:content-type; + bh=k0jTyZDV08fyvTWPzhoIG/icGar9Ve6sdXwO34t96gA=; + b=CXk2gH0Oijcs6rp5EdiLdO3tQ64PldB7TEREJt0fsqLWgT66VOL4kuyBxtxgudTSXy + rQNBX9M1+2qCnl6aP+Alht9C3OduC0J5NqLnjtbC3U1jKhHMGPMyzMUYIbNNUjLFUc+R + ZNeo6ZbEWTH0mz5cLFDURAaJwYtT1lX0y2K3EHKZbs8Ea5bpO8WI4PjTgF2a8Q2BrqPj + Dds1LrxAK9kbJVUUqGeVx0ILIlq1oNAJSHy6b4VtHaUHcrBn5r4NBH3K1JQjP8WazXby + FCVmuCbAFbDO4VtmwOi5AxNL+A3vaRKOpvLqxLdiRhCOqq8VgqVWD4t+GnL+SpEDwSZA + MNKw== +X-Gm-Message-State: + ALoCoQlRLPAZuho/2q5q6rLy99PbjWF1AO0W2p8imrHpGgkneLtao6qpa3o0q5d8v298xoBl+n1u +X-Received: by 10.194.24.103 with SMTP id t7mr71227796wjf.15.1417415912418; + Sun, 30 Nov 2014 22:38:32 -0800 (PST) +Received: from disaster-area.hh.sledj.net + ([2a01:348:1a2:1:ea39:35ff:fe2c:a227]) + by mx.google.com with ESMTPSA id h2sm27083163wix.5.2014.11.30.22.38.30 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sun, 30 Nov 2014 22:38:31 -0800 (PST) +Received: from localhost (30000@localhost [local]); + by localhost (OpenSMTPD) with ESMTPA id 50b41cdf; + Mon, 1 Dec 2014 06:38:29 +0000 (UTC) +To: Charles Celerier , + Notmuch Mail +Subject: Re: [PATCH v2] emacs: Added "is:" style completion + to notmuch-read-query. +In-Reply-To: <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu> +References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu> + <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu> +User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +From: David Edmondson +Date: Mon, 01 Dec 2014 06:38:29 +0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain +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: Mon, 01 Dec 2014 06:38:46 -0000 + +On Sat, Nov 29 2014, Charles Celerier wrote: +> 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 + +I think that David's suggestion was that you would have only one `let' +form, so something like: + + (lexical-let* + ((all-tags (mapcar ...)) + (completions (append ...)) + (keymap (copy-keymap ...)) + (current-query ...)) + ...) + +> ((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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2