[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / d2 / d17db0f73152160698b1d7c354595e0d08cdad
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 55E17431FC0\r
6         for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:45 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id Q3NXG8yylOlu for <notmuch@notmuchmail.org>;\r
17         Sun, 30 Nov 2014 22:38:35 -0800 (PST)\r
18 Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com\r
19         [209.85.212.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 5724E431FBC\r
22         for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:33 -0800 (PST)\r
23 Received: by mail-wi0-f177.google.com with SMTP id l15so16191918wiw.16\r
24         for <notmuch@notmuchmail.org>; Sun, 30 Nov 2014 22:38:32 -0800 (PST)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=1e100.net; s=20130820;\r
27         h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
28         :from:date:message-id:mime-version:content-type;\r
29         bh=k0jTyZDV08fyvTWPzhoIG/icGar9Ve6sdXwO34t96gA=;\r
30         b=CXk2gH0Oijcs6rp5EdiLdO3tQ64PldB7TEREJt0fsqLWgT66VOL4kuyBxtxgudTSXy\r
31         rQNBX9M1+2qCnl6aP+Alht9C3OduC0J5NqLnjtbC3U1jKhHMGPMyzMUYIbNNUjLFUc+R\r
32         ZNeo6ZbEWTH0mz5cLFDURAaJwYtT1lX0y2K3EHKZbs8Ea5bpO8WI4PjTgF2a8Q2BrqPj\r
33         Dds1LrxAK9kbJVUUqGeVx0ILIlq1oNAJSHy6b4VtHaUHcrBn5r4NBH3K1JQjP8WazXby\r
34         FCVmuCbAFbDO4VtmwOi5AxNL+A3vaRKOpvLqxLdiRhCOqq8VgqVWD4t+GnL+SpEDwSZA\r
35         MNKw==\r
36 X-Gm-Message-State:\r
37  ALoCoQlRLPAZuho/2q5q6rLy99PbjWF1AO0W2p8imrHpGgkneLtao6qpa3o0q5d8v298xoBl+n1u\r
38 X-Received: by 10.194.24.103 with SMTP id t7mr71227796wjf.15.1417415912418;\r
39         Sun, 30 Nov 2014 22:38:32 -0800 (PST)\r
40 Received: from disaster-area.hh.sledj.net\r
41         ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
42         by mx.google.com with ESMTPSA id h2sm27083163wix.5.2014.11.30.22.38.30\r
43         for <multiple recipients>\r
44         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
45         Sun, 30 Nov 2014 22:38:31 -0800 (PST)\r
46 Received: from localhost (30000@localhost [local]);\r
47         by localhost (OpenSMTPD) with ESMTPA id 50b41cdf;\r
48         Mon, 1 Dec 2014 06:38:29 +0000 (UTC)\r
49 To: Charles Celerier <cceleri@cs.stanford.edu>,\r
50         Notmuch Mail <notmuch@notmuchmail.org>\r
51 Subject: Re: [PATCH v2] emacs: Added "is:<tag>" style completion\r
52         to      notmuch-read-query.\r
53 In-Reply-To: <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
54 References: <1417219835-92141-1-git-send-email-cceleri@cs.stanford.edu>\r
55         <1417279197-90877-1-git-send-email-cceleri@cs.stanford.edu>\r
56 User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1\r
57         (x86_64-pc-linux-gnu)\r
58 From: David Edmondson <dme@dme.org>\r
59 Date: Mon, 01 Dec 2014 06:38:29 +0000\r
60 Message-ID: <cunh9xfg9i2.fsf@gargravarr.hh.sledj.net>\r
61 MIME-Version: 1.0\r
62 Content-Type: text/plain\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Mon, 01 Dec 2014 06:38:46 -0000\r
76 \r
77 On Sat, Nov 29 2014, Charles Celerier wrote:\r
78 > The notmuch-search-terms man page states that "tag:<tag>" is equivalent\r
79 > to "is:<tag>". Completion for "is:<tag>" style searches is now supported\r
80 > in the Emacs interface.\r
81 >\r
82 > Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>\r
83 > ---\r
84 >  emacs/notmuch.el | 11 +++++++----\r
85 >  1 file changed, 7 insertions(+), 4 deletions(-)\r
86 >\r
87 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
88 > index 218486a..d29499c 100644\r
89 > --- a/emacs/notmuch.el\r
90 > +++ b/emacs/notmuch.el\r
91 > @@ -856,12 +856,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
92 >  \r
93 >  PROMPT is the string to prompt with."\r
94 >    (lexical-let\r
95 > +    (( all-tags\r
96 > +        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))\r
97 > +                (process-lines notmuch-command "search" "--output=tags" "*"))))\r
98 > +  (let\r
99 \r
100 I think that David's suggestion was that you would have only one `let'\r
101 form, so something like:\r
102 \r
103  (lexical-let*\r
104    ((all-tags (mapcar ...))\r
105     (completions (append ...))\r
106     (keymap (copy-keymap ...))\r
107     (current-query ...))\r
108      ...)\r
109 \r
110 >        ((completions\r
111 >       (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"\r
112 >                     "subject:" "attachment:")\r
113 > -             (mapcar (lambda (tag)\r
114 > -                       (concat "tag:" (notmuch-escape-boolean-term tag)))\r
115 > -                     (process-lines notmuch-command "search" "--output=tags" "*")))))\r
116 > +             (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)\r
117 > +             (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))\r
118 >      (let ((keymap (copy-keymap minibuffer-local-map))\r
119 >         (current-query (case major-mode\r
120 >                          (notmuch-search-mode (notmuch-search-get-query))\r
121 > @@ -884,7 +887,7 @@ PROMPT is the string to prompt with."\r
122 >        (define-key keymap (kbd "TAB") 'minibuffer-complete)\r
123 >        (let ((history-delete-duplicates t))\r
124 >       (read-from-minibuffer prompt nil keymap nil\r
125 > -                           'notmuch-search-history current-query nil)))))\r
126 > +                           'notmuch-search-history current-query nil))))))\r
127 >  \r
128 >  (defun notmuch-search-get-query ()\r
129 >    "Return the current query in this search buffer"\r
130 > -- \r
131 > 2.1.2\r
132 >\r
133 > _______________________________________________\r
134 > notmuch mailing list\r
135 > notmuch@notmuchmail.org\r
136 > http://notmuchmail.org/mailman/listinfo/notmuch\r