Re: [PATCH] add has: query prefix to search for specific properties
[notmuch-archives.git] / 38 / e20395cfae7d9bbe0d880b85f3cb176927b128
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 arlo.cworth.org (Postfix) with ESMTP id 101E46DE0B25\r
6  for <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 01:20:32 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.067\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.067 tagged_above=-999 required=5 tests=[AWL=0.134, \r
12  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
13  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652,\r
14  UNPARSEABLE_RELAY=0.001] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id dt6V47Ljb7MP for <notmuch@notmuchmail.org>;\r
18  Sun,  7 Feb 2016 01:20:29 -0800 (PST)\r
19 Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com\r
20  [74.125.82.54]) by arlo.cworth.org (Postfix) with ESMTPS id 4EA546DE0261 for\r
21  <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 01:20:29 -0800 (PST)\r
22 Received: by mail-wm0-f54.google.com with SMTP id g62so98054270wme.0\r
23  for <notmuch@notmuchmail.org>; Sun, 07 Feb 2016 01:20:29 -0800 (PST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25  d=dme-org.20150623.gappssmtp.com; s=20150623;\r
26  h=to:subject:in-reply-to:references:user-agent:from:date:message-id\r
27  :mime-version:content-type;\r
28  bh=YIuyeL1ohP1bugCZwtCJjwELWFIanQCyIQ2KKImO0Fc=;\r
29  b=WLi141mlnjRxGtuCdv+8bNSuJMKdXyUj+br8azErBghbwcOYwwndq0e73kaEJddV20\r
30  PCyL8M0w/mCZQoGxY+mpOzhToFifW4TaFXwyps+xDYHvlJTxWboB4UhjlcpfDEnJdXGz\r
31  wRjhmkgTB7Y/vCYxeePwPX8lPs72fYg8sBzzNjdosKn6FdyQlTtNEff8i0prJG9znHvo\r
32  ORquc0zV/Z7h/B29E5PbN9246kKM60N6A5+Jez5fmSvuDr+xkqbQrzuuNpmY0mT9dgRf\r
33  Lmoay2kwk+1bQ3MPSYJXjTedqKVvhsKVy2mm81YtRUV7QTwswrd8fuybGrPveJ1ctLlt\r
34  nzoQ==\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
36  d=1e100.net; s=20130820;\r
37  h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
38  :from:date:message-id:mime-version:content-type;\r
39  bh=YIuyeL1ohP1bugCZwtCJjwELWFIanQCyIQ2KKImO0Fc=;\r
40  b=ZkdPEe7fBzLdJp1PAOaNJHr3XkpxgDKHUMj0pYAqN0zfdsQhic+ZuOSk/YGEf2Ub8m\r
41  exF1bH8qj0Ru/jUSZJyPjxFTxffSjqg/w4+a84LKYuafFGIHrBoJrv/+4ul7rYZosqsl\r
42  GtyPzahnUUAxm6gyX7AG7eNHkILdYrK64hNZ2FD+II0xpFpBdpk1CYdzQBQaUu16HQkR\r
43  B40xhJEdTSG9pXhJM1EcKjXKEBsTApXOdXk0iDmQ5GrXtijc66/QU7YsKIgooSCvCeai\r
44  SWicfw0glmjQgZIXbG4q209+ij/RjwOicUNxtyrAadOHD/+QXzHF1d5+rrdBqZFWfoLx\r
45  Vy8A==\r
46 X-Gm-Message-State:\r
47  AG10YOSLk5BCKYzv3GaUSMErDOeqC3N4Yra8dcGNycaivdI7HDxcb5HU8U0fyy0T3WT1Jw==\r
48 X-Received: by 10.28.134.147 with SMTP id i141mr26128714wmd.87.1454836827772; \r
49  Sun, 07 Feb 2016 01:20:27 -0800 (PST)\r
50 Received: from disaster-area.hh.sledj.net\r
51  ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
52  by smtp.gmail.com with ESMTPSA id b203sm6924285wmh.8.2016.02.07.01.20.26\r
53  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
54  Sun, 07 Feb 2016 01:20:26 -0800 (PST)\r
55 Received: from localhost (disaster-area.hh.sledj.net [local])\r
56  by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 8dc70c74;\r
57  Sun, 7 Feb 2016 09:20:25 +0000 (UTC)\r
58 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
59 Subject: Re: [PATCH] emacs: hello: display jump key next to saved search when\r
60  available\r
61 In-Reply-To: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
62 References: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
63 User-Agent: none\r
64 From: David Edmondson <dme@dme.org>\r
65 Date: Sun, 07 Feb 2016 09:20:25 +0000\r
66 Message-ID: <cunwpqgop0m.fsf@disaster-area.hh.sledj.net>\r
67 MIME-Version: 1.0\r
68 Content-Type: text/plain\r
69 X-BeenThere: notmuch@notmuchmail.org\r
70 X-Mailman-Version: 2.1.20\r
71 Precedence: list\r
72 List-Id: "Use and development of the notmuch mail system."\r
73  <notmuch.notmuchmail.org>\r
74 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
75  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
76 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
77 List-Post: <mailto:notmuch@notmuchmail.org>\r
78 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
79 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
80  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
81 X-List-Received-Date: Sun, 07 Feb 2016 09:20:32 -0000\r
82 \r
83 On Sun, Dec 13 2015, Jani Nikula <jani@nikula.org> wrote:\r
84 > Display the shortcut jump key next to the saved search name in notmuch\r
85 > hello, if one is defined for the saved search.\r
86 \r
87 I quite like the idea of this (and Mark's followup), but I wonder about\r
88 the utility. With notmuch-jump, as soon as I hit `j' a list of the\r
89 possible keystrokes and the corresponding search is presented, so I\r
90 don't need to refer to the list in the hello buffer to know what to do.\r
91 \r
92 >\r
93 > ---\r
94 >\r
95 > This is probably something with infinite bikeshedding\r
96 > potential. Therefore I just quickly hacked something together as a\r
97 > proof of concept. This displays the jump keys like this:\r
98 >\r
99 >       154 Inbox [j i]\r
100 >\r
101 > Maybe the space between "j" and the key is unnecessary? Maybe the "j"\r
102 > itself is unnecessary? Maybe the brackets are unnecessary? Maybe it\r
103 > could use some color? Does displaying these need to be customizable?\r
104 > Etc?\r
105 > ---\r
106 >  emacs/notmuch-hello.el | 8 ++++++--\r
107 >  1 file changed, 6 insertions(+), 2 deletions(-)\r
108 >\r
109 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
110 > index 738baad23b20..3c5440331669 100644\r
111 > --- a/emacs/notmuch-hello.el\r
112 > +++ b/emacs/notmuch-hello.el\r
113 > @@ -578,7 +578,9 @@ with `notmuch-hello-query-counts'."\r
114 >                                    (oldest-first t)\r
115 >                                    (otherwise notmuch-search-oldest-first)))\r
116 >                    (search-type (eq (plist-get elem :search-type) 'tree))\r
117 > -                  (msg-count (plist-get elem :count)))\r
118 > +                  (msg-count (plist-get elem :count))\r
119 > +                  (key (plist-get elem :key))\r
120 > +                  (shortcut (if key (format " [j %s]" key) nil)))\r
121 >               (widget-insert (format "%8s "\r
122 >                                      (notmuch-hello-nice-number msg-count)))\r
123 >               (widget-create 'push-button\r
124 > @@ -587,8 +589,10 @@ with `notmuch-hello-query-counts'."\r
125 >                              :notmuch-search-oldest-first oldest-first\r
126 >                              :notmuch-search-type search-type\r
127 >                              name)\r
128 > +             (when shortcut\r
129 > +               (widget-insert shortcut))\r
130 >               (setq column-indent\r
131 > -                   (1+ (max 0 (- column-width (length name)))))))\r
132 > +                   (1+ (max 0 (- column-width (length name) (length shortcut)))))))\r
133 >           (setq count (1+ count))\r
134 >           (when (eq (% count tags-per-line) 0)\r
135 >             (setq column-indent 0)\r
136 > -- \r
137 > 2.1.4\r
138 >\r
139 > _______________________________________________\r
140 > notmuch mailing list\r
141 > notmuch@notmuchmail.org\r
142 > https://notmuchmail.org/mailman/listinfo/notmuch\r