Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / cc / dfb63a9c0853c1422160b3ed8ae63d14c81253
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 172E5431FBF\r
6         for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 04:15:09 -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 hdCSfxjzEakX for <notmuch@notmuchmail.org>;\r
17         Fri, 12 Dec 2014 04:14:41 -0800 (PST)\r
18 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com\r
19         [209.85.212.174]) (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 92B3E431FBC\r
22         for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 04:14:41 -0800 (PST)\r
23 Received: by mail-wi0-f174.google.com with SMTP id h11so2278313wiw.13\r
24         for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 04:14:40 -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:user-agent:to:subject:in-reply-to:references\r
28         :from:date:message-id:mime-version:content-type\r
29         :content-transfer-encoding;\r
30         bh=JOGb0u413mLYj9cnvbUtG3S8Aa9y1N3MK9JOXgF9QdY=;\r
31         b=ZyHrqtH0HysXE+J5g/TpR5BXWuWhKIpxar5WTz3fY2LWCB+ZV4Qis9L94piV+C3Vn8\r
32         UYfXeOaqYq2zitO7wv9cP03QFa4RSAEXgxR6VSnxmRed2msqA+SJO/xUsHbwBx1FbvzQ\r
33         6bDboguM0+IBWsttN70c5hIVwSEBWDTqNzOn32J6nyuKvN594B/FCpEYWu+u7CWnFsfK\r
34         NMZY0HYPPIz7+R/MxYZFgLsYrjiEjA2DKIccszO+OvoLNHZwiuUcGqpwmEtgB1sAvRui\r
35         wLY3Mk7JaKMFhCDtGbWUvI9LiLKfBXyIp/OURouuE62D4l+0t0M40FLS1SgDk4FauTtO\r
36         DICQ==\r
37 X-Gm-Message-State:\r
38  ALoCoQkAiXrmgFTM8znagNDIk3lRgjnA36KGjTEfu28ldWhmjFh0olHuBX4TSYp/gvDP2yltNNC0\r
39 X-Received: by 10.180.104.197 with SMTP id gg5mr7176768wib.7.1418386479203;\r
40         Fri, 12 Dec 2014 04:14:39 -0800 (PST)\r
41 Received: from disaster-area.hh.sledj.net\r
42         ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
43         by mx.google.com with ESMTPSA id ef1sm1748684wic.0.2014.12.12.04.14.38\r
44         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
45         Fri, 12 Dec 2014 04:14:38 -0800 (PST)\r
46 Received: from localhost (30000@localhost [local]);\r
47         by localhost (OpenSMTPD) with ESMTPA id e15c7be9;\r
48         Fri, 12 Dec 2014 12:14:37 +0000 (UTC)\r
49 User-Agent: OpenSMTPD enqueuer (Demoostik)\r
50 To: Lele Gaifax <lele@metapensiero.it>, notmuch@notmuchmail.org\r
51 Subject: Re: Address completion in Emacs\r
52 In-Reply-To: <87d27p9t0f.fsf@nautilus.nautilus>\r
53 References: <87d27p9t0f.fsf@nautilus.nautilus>\r
54 From: David Edmondson <dme@dme.org>\r
55 Date: Fri, 12 Dec 2014 12:14:37 +0000\r
56 Message-ID: <m24mt1hxoy.fsf@heart-of-gold.hh.sledj.net>\r
57 MIME-Version: 1.0\r
58 Content-Type: text/plain; charset=utf-8\r
59 Content-Transfer-Encoding: quoted-printable\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Fri, 12 Dec 2014 12:15:09 -0000\r
73 \r
74 On Fri, Dec 12 2014, Lele Gaifax wrote:\r
75 > Hi all,\r
76 >\r
77 > Yesterday I tweaked my Emacs configuration to use "ido-completing-read"\r
78 > to select the right address in the minibuffer, and noticed what seems a\r
79 > glitch in the related code.\r
80 >\r
81 > To accomplish the goal, I implemented my own selection function\r
82 >\r
83 >   (defun esk-notmuch-address-selection-function (prompt addresses first)\r
84 >     "Use `ido-completing-read' to select one of the addresses."\r
85 >     (ido-completing-read prompt (cons first addresses)\r
86 >                          nil nil nil 'notmuch-address-history))\r
87 >\r
88 > and then assigned it to `notmuch-address-selection-function':\r
89 >\r
90 >   (setq notmuch-address-selection-function 'esk-notmuch-address-selection=\r
91 -function)\r
92 >\r
93 > As you can see, I had to `cons' the two arguments, because the caller of\r
94 > that function does something similar to the following (where `orig' is\r
95 > the text entered before TAB-completion):\r
96 >\r
97 >   (options (notmuch-address-options orig))\r
98 >   (num-options (length options))\r
99 >   (chosen (funcall notmuch-address-selection-function\r
100 >               (format "Address (%s matches): " num-options)\r
101 >               (cdr options) (car options)))\r
102 >\r
103 > and the standard `notmuch-address-selection-function' is defined like:\r
104 >\r
105 >   (defun notmuch-address-selection-function (prompt collection initial-in=\r
106 put)\r
107 >     "Call (`completing-read'\r
108 >         PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"\r
109 >     (completing-read\r
110 >      prompt collection nil nil initial-input 'notmuch-address-history))\r
111 >\r
112 > where that `initial-input' is not what I initially thought, the text\r
113 > entered by the user, but rather the first completion candidate.\r
114 >\r
115 > Wouldn't it be more "correct" to pass the unchanged `options' list and\r
116 > the "real" `orig' text as `initial-input' to the customizable function\r
117 > instead?\r
118 \r
119 Would I then have to press TAB twice to get the first result?\r
120 \r
121 > I understand that it may be undesiderable to break existing\r
122 > configurations by rectifying the arguments in that way, and in such case\r
123 > could we change the `initial-input' argument name to better reflect the\r
124 > fact that it actually contains one possible candidate instead?\r
125 \r
126 >From the perspective of `notmuch-address-selection-function', it _is_\r
127 the `initial-input', as that is what is presented to the user.\r
128 \r
129 > Thanks in advance for any clarification,\r
130 > ciao, lele.\r
131 > --=20\r
132 > nickname: Lele Gaifax | Quando vivr=C3=B2 di quello che ho pensato ieri\r
133 > real: Emanuele Gaifas | comincer=C3=B2 ad aver paura di chi mi copia.\r
134 > lele@metapensiero.it  |                 -- Fortunato Depero, 1929.\r
135 >\r
136 > _______________________________________________\r
137 > notmuch mailing list\r
138 > notmuch@notmuchmail.org\r
139 > http://notmuchmail.org/mailman/listinfo/notmuch\r