Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 8d / 41e83a2fa7cc54b817808a916699cdd6d4cee7
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 4DB266DE02CE\r
6  for <notmuch@notmuchmail.org>; Sun, 13 Dec 2015 10:24:53 -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.541\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.541 tagged_above=-999 required=5 tests=[AWL=0.179,\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 p16AULXVrfdI for <notmuch@notmuchmail.org>;\r
17  Sun, 13 Dec 2015 10:24:51 -0800 (PST)\r
18 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com\r
19  [74.125.82.41]) by arlo.cworth.org (Postfix) with ESMTPS id 58FCE6DE0231 for\r
20  <notmuch@notmuchmail.org>; Sun, 13 Dec 2015 10:24:51 -0800 (PST)\r
21 Received: by mail-wm0-f41.google.com with SMTP id p66so17128577wmp.0\r
22  for <notmuch@notmuchmail.org>; Sun, 13 Dec 2015 10:24:51 -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:cc:subject:date:message-id;\r
26  bh=cjrBHFkHaXV9uT60Dj0Zkr0yLctbkWT16ZM6XZdqChI=;\r
27  b=ETGAHlDrHJaXWU+X/8i6NQtGWFslVvFA7rI+oJKQFm+aeBdkTXATYOVkb6BjzYvLrl\r
28  QlfR/hN9IMfxSZPDqLwS5MQTtB+1njqVn6AZX2sbfdnGaqJP+oYJJnX42wVxDJye4GAm\r
29  NuMWtj5W9MDEp75hC9JxGXhktLKOA9OBfd/FnHLbcOL7hmM8VFbkNCotFCBBa8TARwXW\r
30  zzkrp3NgmSmIeop3tVA9w8o74xe0FyAjS7QRVC8zfax+DdCR5GOZB9PzP3Rfe7/22Wux\r
31  J7sIyot7TV+dHwiP8UPeiXM914hYc8HdqNQIgfdGjNE6eu9u99klfC6Y5hymr3QwEWhx\r
32  1Q1Q==\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
34  d=1e100.net; s=20130820;\r
35  h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
36  bh=cjrBHFkHaXV9uT60Dj0Zkr0yLctbkWT16ZM6XZdqChI=;\r
37  b=klngbPUvI2ozRSqEG3rgzF0e8fY1uaM9dYcrRudSFzXoxRauT2dh6qW+R/Ln2aWWFr\r
38  nBwXqVBVzDB5NGq37JGEqzpaHCj+Ly590E+8afYkIqY4aR1auN6egeeKLl86Wch3gaO3\r
39  jNIq+rptdf1WsXM319nOiQCnZLCNH+hOfIHSo3UDCM9eyXx/0WE7xxfV8ApjAEVgD8b0\r
40  ziXR2nlYwAB0J7YO6/XqKjKjjHgkLwGJGd0WiqqvT9r+c11u4c7quDED0ltPxKkZiKpy\r
41  iR6jlniPbdMwUXtJN7LnC6YeCaSp0yYabobcymf6hlxAVtcY8EHQx6qW5sb04PJY0nBO\r
42  eVHA==\r
43 X-Gm-Message-State: ALoCoQmU58cet9STzH5KWDAaW9bWu1pR7xEYz1shh4OXIQjwsftvrotiHWzXX/JR4Sqm5HIbqFPjLKXdVrsQHhWKSaYm17B3Mw==\r
44 X-Received: by 10.194.71.104 with SMTP id t8mr32008017wju.177.1450031089668;\r
45  Sun, 13 Dec 2015 10:24:49 -0800 (PST)\r
46 Received: from localhost (mobile-access-bcee05-14.dhcp.inet.fi.\r
47  [188.238.5.14]) by smtp.gmail.com with ESMTPSA id\r
48  67sm12752524wmm.6.2015.12.13.10.24.48 (version=TLSv1/SSLv3 cipher=OTHER);\r
49  Sun, 13 Dec 2015 10:24:49 -0800 (PST)\r
50 From: Jani Nikula <jani@nikula.org>\r
51 To: notmuch@notmuchmail.org\r
52 Subject: [PATCH] emacs: hello: display jump key next to saved search when\r
53  available\r
54 Date: Sun, 13 Dec 2015 20:24:03 +0200\r
55 Message-Id: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
56 X-Mailer: git-send-email 2.1.4\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.20\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61  <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
63  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
68  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sun, 13 Dec 2015 18:24:53 -0000\r
70 \r
71 Display the shortcut jump key next to the saved search name in notmuch\r
72 hello, if one is defined for the saved search.\r
73 \r
74 ---\r
75 \r
76 This is probably something with infinite bikeshedding\r
77 potential. Therefore I just quickly hacked something together as a\r
78 proof of concept. This displays the jump keys like this:\r
79 \r
80         154 Inbox [j i]\r
81 \r
82 Maybe the space between "j" and the key is unnecessary? Maybe the "j"\r
83 itself is unnecessary? Maybe the brackets are unnecessary? Maybe it\r
84 could use some color? Does displaying these need to be customizable?\r
85 Etc?\r
86 ---\r
87  emacs/notmuch-hello.el | 8 ++++++--\r
88  1 file changed, 6 insertions(+), 2 deletions(-)\r
89 \r
90 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
91 index 738baad23b20..3c5440331669 100644\r
92 --- a/emacs/notmuch-hello.el\r
93 +++ b/emacs/notmuch-hello.el\r
94 @@ -578,7 +578,9 @@ with `notmuch-hello-query-counts'."\r
95                                      (oldest-first t)\r
96                                      (otherwise notmuch-search-oldest-first)))\r
97                      (search-type (eq (plist-get elem :search-type) 'tree))\r
98 -                    (msg-count (plist-get elem :count)))\r
99 +                    (msg-count (plist-get elem :count))\r
100 +                    (key (plist-get elem :key))\r
101 +                    (shortcut (if key (format " [j %s]" key) nil)))\r
102                 (widget-insert (format "%8s "\r
103                                        (notmuch-hello-nice-number msg-count)))\r
104                 (widget-create 'push-button\r
105 @@ -587,8 +589,10 @@ with `notmuch-hello-query-counts'."\r
106                                :notmuch-search-oldest-first oldest-first\r
107                                :notmuch-search-type search-type\r
108                                name)\r
109 +               (when shortcut\r
110 +                 (widget-insert shortcut))\r
111                 (setq column-indent\r
112 -                     (1+ (max 0 (- column-width (length name)))))))\r
113 +                     (1+ (max 0 (- column-width (length name) (length shortcut)))))))\r
114             (setq count (1+ count))\r
115             (when (eq (% count tags-per-line) 0)\r
116               (setq column-indent 0)\r
117 -- \r
118 2.1.4\r
119 \r