Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / 85 / f1173eb3b7c800d758ce4e3a75056dff2a3bba
1 Return-Path: <jani@nikula.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 896FE6DE1413\r
6  for <notmuch@notmuchmail.org>; Sun, 20 Dec 2015 04:51:05 -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.542\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.542 tagged_above=-999 required=5 tests=[AWL=0.178,\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] autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id NNd5K9bz1xOk for <notmuch@notmuchmail.org>;\r
17  Sun, 20 Dec 2015 04:51:02 -0800 (PST)\r
18 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com\r
19  [74.125.82.51]) by arlo.cworth.org (Postfix) with ESMTPS id 80D0B6DE025F for\r
20  <notmuch@notmuchmail.org>; Sun, 20 Dec 2015 04:51:02 -0800 (PST)\r
21 Received: by mail-wm0-f51.google.com with SMTP id p187so38049623wmp.0\r
22  for <notmuch@notmuchmail.org>; Sun, 20 Dec 2015 04:51:02 -0800 (PST)\r
23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
24  d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
25  h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
26  :mime-version:content-type;\r
27  bh=PciPELuS4mRCaky6uoONOvWakccilkPEFxYQEiGwlXQ=;\r
28  b=ePZ3ijwKNstT5pnyWvrriJTYWD1/wD/S3X4qCkAG4LmASBad0UqLYTGGFylRiZwiQU\r
29  hMOwJALDwLuRb1bnT1ZcCtCyNS0XuBu8Qdfq9+hTospYGKcl/XiWQmlQXF4o9CUg/nY2\r
30  NfKu0wyUO0UO+HSHWO9DwXukectsiAtRhj+M8BGPyrjuRx5dUGNkVaiEpIkPwlqnh07x\r
31  QC0+YH9dMcmuPtJmeQSSlkBL0BJsAafL0NLgoWZFo3mJ8mUgoUVQHdaY++UiMjRJBoy9\r
32  Y1e8+bCIQXW1ZUZ7ZAU9rIpWlbetECjDO5VhMS2QuEtINsckkBvPfs84A/udaodx+I9o\r
33  jEPA==\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
35  d=1e100.net; s=20130820;\r
36  h=x-gm-message-state:from:to:subject:in-reply-to:references\r
37  :user-agent:date:message-id:mime-version:content-type;\r
38  bh=PciPELuS4mRCaky6uoONOvWakccilkPEFxYQEiGwlXQ=;\r
39  b=ZbOSnhC1uAChQVaVki9ZequPCfMWktI1RRFDB+2pSaMQRex9iQJkQkQ5qjhSlSF0jD\r
40  rlAPybSWo2M4vBwglFgHEMIHu66//8rdfaH6N5EQr+X+9cd0TBU4S9aqX+c4bTiCkvSL\r
41  en3p+G2Dhf7BVDurNyiLzWOqaoEDKyAoZFMZ8TaDGL/gqae3b/ACecHmMtOZMdt9DARH\r
42  L5rFzympsG8KeHnlWwcyR2vP6fVYOLClH+ErGjbN+LfMH4gg2v+Q0mtCP+DMg6p0USwo\r
43  N8mIR0rBv44rsyrJmt6/Kcl1f0jHEmeKaY+cTmdUpKqmqU6DSctICEGx7YaMPKqyfo1j\r
44  Csng==\r
45 X-Gm-Message-State: ALoCoQnbMZSvHhdclRt0zRSZjoaSdKQhQWhNds1qTWWrg4+gmV9PVS6iLIRCs24Zv2VaJiZqVzxcHkALyOjsx15vvYcbb4Mzeg==\r
46 X-Received: by 10.28.46.87 with SMTP id u84mr2301486wmu.102.1450615859897;\r
47  Sun, 20 Dec 2015 04:50:59 -0800 (PST)\r
48 Received: from localhost (mobile-access-bceea3-137.dhcp.inet.fi.\r
49  [188.238.163.137])\r
50  by smtp.gmail.com with ESMTPSA id dl8sm23423471wjb.29.2015.12.20.04.50.58\r
51  (version=TLSv1/SSLv3 cipher=OTHER);\r
52  Sun, 20 Dec 2015 04:50:58 -0800 (PST)\r
53 From: Jani Nikula <jani@nikula.org>\r
54 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
55 Subject: Re: [PATCH] emacs: jump: show key shortcut\r
56 In-Reply-To: <1450603587-2950-1-git-send-email-markwalters1009@gmail.com>\r
57 References: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
58  <1450603587-2950-1-git-send-email-markwalters1009@gmail.com>\r
59 User-Agent: Notmuch/0.21+27~g2b12735 (http://notmuchmail.org) Emacs/24.4.1\r
60  (x86_64-pc-linux-gnu)\r
61 Date: Sun, 20 Dec 2015 14:50:11 +0200\r
62 Message-ID: <878u4pxp18.fsf@nikula.org>\r
63 MIME-Version: 1.0\r
64 Content-Type: text/plain\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.20\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69  <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
71  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
76  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Sun, 20 Dec 2015 12:51:05 -0000\r
78 \r
79 On Sun, 20 Dec 2015, Mark Walters <markwalters1009@gmail.com> wrote:\r
80 > This shows the jump key shortcut in the hello screen -- it underlines\r
81 > the letter, if it is present, in the search name.\r
82 > ---\r
83 >\r
84 > In id:1450031043-24038-1-git-send-email-jani@nikula.org Jani suggested\r
85 > showing jump key shortcuts in the hello screen. I like the idea but\r
86 > found the method a little cluttered.\r
87 \r
88 Yes; it was a proof-of-concept.\r
89 \r
90 > This is an alternative approach which underlines the relevant key in\r
91 > the search name (if it occurs).  This is relatively unintrusive\r
92 > (possibly even too hard to see) and is in line with how many other\r
93 > applications show shortcuts.\r
94 >\r
95 > I am guessing that most people choose a shortcut key with some\r
96 > relevance to the search name (eg i for inbox) so in most cases I think\r
97 > the shortcut will be shown. Of course multi-key shortcuts will not be shown.\r
98 \r
99 While I understand your thinking, this falls short for me in several\r
100 ways.\r
101 \r
102 First is that it's case sensitive. "i for Inbox" doesn't work. However\r
103 if you made it case insensitive, it might be silly for upper case\r
104 shortcuts.\r
105 \r
106 Second is that automatic selection of the letter to underline is not\r
107 necessarily the logical one. "n for Inbox (notmuch)" underlines n in\r
108 "Inbox" instead of "notmuch". Hard to do anything about this. But it can\r
109 be confusing UI wise.\r
110 \r
111 Third is that I do use characters not in the search name. For example "*\r
112 for flagged". I'm not happy that there is no fallback when the letter is\r
113 not present.\r
114 \r
115 > If people think the underlining is too discreet then we could change\r
116 > the 'underline below to '(:foreground "red") or similar.\r
117 \r
118 I don't think I would find the "fruit salad" visually pleasing. If\r
119 different colors were used, I'd prefer the letters were separate from\r
120 the name. Like in the jump search menu. I might like that the best.\r
121 \r
122 Talking of the jump search menu, is it intentional that you underline\r
123 the keys there now too?\r
124 \r
125 Finally, if this is supposed to be helpful to newcomers too, the user\r
126 won't know how to access these underlined shortcuts, as you have to hit\r
127 "j" first.\r
128 \r
129 \r
130 BR,\r
131 Jani.\r
132 \r
133 \r
134 \r
135 >\r
136 > Best wishes\r
137 >\r
138 > Mark\r
139 >\r
140 >\r
141 >\r
142 > emacs/notmuch-hello.el | 8 ++++++++\r
143 >  1 file changed, 8 insertions(+)\r
144 >\r
145 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
146 > index 8bde808..de77730 100644\r
147 > --- a/emacs/notmuch-hello.el\r
148 > +++ b/emacs/notmuch-hello.el\r
149 > @@ -572,7 +572,9 @@ with `notmuch-hello-query-counts'."\r
150 >             (if (> column-indent 0)\r
151 >                 (widget-insert (make-string column-indent ? )))\r
152 >             (let* ((name (plist-get elem :name))\r
153 > +                  (key (plist-get elem :key))\r
154 >                    (query (plist-get elem :query))\r
155 > +\r
156 >                    (oldest-first (case (plist-get elem :sort-order)\r
157 >                                    (newest-first nil)\r
158 >                                    (oldest-first t)\r
159 > @@ -581,6 +583,12 @@ with `notmuch-hello-query-counts'."\r
160 >                    (msg-count (plist-get elem :count)))\r
161 >               (widget-insert (format "%8s "\r
162 >                                      (notmuch-hello-nice-number msg-count)))\r
163 > +             (save-match-data\r
164 > +               (let ((case-fold-search nil))\r
165 > +                 (when (and key (string-match key name))\r
166 > +                   (add-face-text-property (match-beginning 0) (match-end 0)\r
167 > +                                           'underline\r
168 > +                                           nil name))))\r
169 >               (widget-create 'push-button\r
170 >                              :notify #'notmuch-hello-widget-search\r
171 >                              :notmuch-search-terms query\r
172 > -- \r
173 > 2.1.4\r
174 >\r
175 > _______________________________________________\r
176 > notmuch mailing list\r
177 > notmuch@notmuchmail.org\r
178 > https://notmuchmail.org/mailman/listinfo/notmuch\r