Re: [PATCH] emacs: hello: display jump key next to saved search when available
authorDavid Edmondson <dme@dme.org>
Sun, 7 Feb 2016 09:20:25 +0000 (09:20 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:00 +0000 (16:21 -0700)
38/e20395cfae7d9bbe0d880b85f3cb176927b128 [new file with mode: 0644]

diff --git a/38/e20395cfae7d9bbe0d880b85f3cb176927b128 b/38/e20395cfae7d9bbe0d880b85f3cb176927b128
new file mode 100644 (file)
index 0000000..915e5cf
--- /dev/null
@@ -0,0 +1,142 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 101E46DE0B25\r
+ for <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 01:20:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.067\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.067 tagged_above=-999 required=5 tests=[AWL=0.134, \r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652,\r
+ UNPARSEABLE_RELAY=0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id dt6V47Ljb7MP for <notmuch@notmuchmail.org>;\r
+ Sun,  7 Feb 2016 01:20:29 -0800 (PST)\r
+Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com\r
+ [74.125.82.54]) by arlo.cworth.org (Postfix) with ESMTPS id 4EA546DE0261 for\r
+ <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 01:20:29 -0800 (PST)\r
+Received: by mail-wm0-f54.google.com with SMTP id g62so98054270wme.0\r
+ for <notmuch@notmuchmail.org>; Sun, 07 Feb 2016 01:20:29 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=dme-org.20150623.gappssmtp.com; s=20150623;\r
+ h=to:subject:in-reply-to:references:user-agent:from:date:message-id\r
+ :mime-version:content-type;\r
+ bh=YIuyeL1ohP1bugCZwtCJjwELWFIanQCyIQ2KKImO0Fc=;\r
+ b=WLi141mlnjRxGtuCdv+8bNSuJMKdXyUj+br8azErBghbwcOYwwndq0e73kaEJddV20\r
+ PCyL8M0w/mCZQoGxY+mpOzhToFifW4TaFXwyps+xDYHvlJTxWboB4UhjlcpfDEnJdXGz\r
+ wRjhmkgTB7Y/vCYxeePwPX8lPs72fYg8sBzzNjdosKn6FdyQlTtNEff8i0prJG9znHvo\r
+ ORquc0zV/Z7h/B29E5PbN9246kKM60N6A5+Jez5fmSvuDr+xkqbQrzuuNpmY0mT9dgRf\r
+ Lmoay2kwk+1bQ3MPSYJXjTedqKVvhsKVy2mm81YtRUV7QTwswrd8fuybGrPveJ1ctLlt\r
+ nzoQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
+ :from:date:message-id:mime-version:content-type;\r
+ bh=YIuyeL1ohP1bugCZwtCJjwELWFIanQCyIQ2KKImO0Fc=;\r
+ b=ZkdPEe7fBzLdJp1PAOaNJHr3XkpxgDKHUMj0pYAqN0zfdsQhic+ZuOSk/YGEf2Ub8m\r
+ exF1bH8qj0Ru/jUSZJyPjxFTxffSjqg/w4+a84LKYuafFGIHrBoJrv/+4ul7rYZosqsl\r
+ GtyPzahnUUAxm6gyX7AG7eNHkILdYrK64hNZ2FD+II0xpFpBdpk1CYdzQBQaUu16HQkR\r
+ B40xhJEdTSG9pXhJM1EcKjXKEBsTApXOdXk0iDmQ5GrXtijc66/QU7YsKIgooSCvCeai\r
+ SWicfw0glmjQgZIXbG4q209+ij/RjwOicUNxtyrAadOHD/+QXzHF1d5+rrdBqZFWfoLx\r
+ Vy8A==\r
+X-Gm-Message-State:\r
+ AG10YOSLk5BCKYzv3GaUSMErDOeqC3N4Yra8dcGNycaivdI7HDxcb5HU8U0fyy0T3WT1Jw==\r
+X-Received: by 10.28.134.147 with SMTP id i141mr26128714wmd.87.1454836827772; \r
+ Sun, 07 Feb 2016 01:20:27 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+ ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by smtp.gmail.com with ESMTPSA id b203sm6924285wmh.8.2016.02.07.01.20.26\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 07 Feb 2016 01:20:26 -0800 (PST)\r
+Received: from localhost (disaster-area.hh.sledj.net [local])\r
+ by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 8dc70c74;\r
+ Sun, 7 Feb 2016 09:20:25 +0000 (UTC)\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: hello: display jump key next to saved search when\r
+ available\r
+In-Reply-To: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
+References: <1450031043-24038-1-git-send-email-jani@nikula.org>\r
+User-Agent: none\r
+From: David Edmondson <dme@dme.org>\r
+Date: Sun, 07 Feb 2016 09:20:25 +0000\r
+Message-ID: <cunwpqgop0m.fsf@disaster-area.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 07 Feb 2016 09:20:32 -0000\r
+\r
+On Sun, Dec 13 2015, Jani Nikula <jani@nikula.org> wrote:\r
+> Display the shortcut jump key next to the saved search name in notmuch\r
+> hello, if one is defined for the saved search.\r
+\r
+I quite like the idea of this (and Mark's followup), but I wonder about\r
+the utility. With notmuch-jump, as soon as I hit `j' a list of the\r
+possible keystrokes and the corresponding search is presented, so I\r
+don't need to refer to the list in the hello buffer to know what to do.\r
+\r
+>\r
+> ---\r
+>\r
+> This is probably something with infinite bikeshedding\r
+> potential. Therefore I just quickly hacked something together as a\r
+> proof of concept. This displays the jump keys like this:\r
+>\r
+>      154 Inbox [j i]\r
+>\r
+> Maybe the space between "j" and the key is unnecessary? Maybe the "j"\r
+> itself is unnecessary? Maybe the brackets are unnecessary? Maybe it\r
+> could use some color? Does displaying these need to be customizable?\r
+> Etc?\r
+> ---\r
+>  emacs/notmuch-hello.el | 8 ++++++--\r
+>  1 file changed, 6 insertions(+), 2 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+> index 738baad23b20..3c5440331669 100644\r
+> --- a/emacs/notmuch-hello.el\r
+> +++ b/emacs/notmuch-hello.el\r
+> @@ -578,7 +578,9 @@ with `notmuch-hello-query-counts'."\r
+>                                   (oldest-first t)\r
+>                                   (otherwise notmuch-search-oldest-first)))\r
+>                   (search-type (eq (plist-get elem :search-type) 'tree))\r
+> -                 (msg-count (plist-get elem :count)))\r
+> +                 (msg-count (plist-get elem :count))\r
+> +                 (key (plist-get elem :key))\r
+> +                 (shortcut (if key (format " [j %s]" key) nil)))\r
+>              (widget-insert (format "%8s "\r
+>                                     (notmuch-hello-nice-number msg-count)))\r
+>              (widget-create 'push-button\r
+> @@ -587,8 +589,10 @@ with `notmuch-hello-query-counts'."\r
+>                             :notmuch-search-oldest-first oldest-first\r
+>                             :notmuch-search-type search-type\r
+>                             name)\r
+> +            (when shortcut\r
+> +              (widget-insert shortcut))\r
+>              (setq column-indent\r
+> -                  (1+ (max 0 (- column-width (length name)))))))\r
+> +                  (1+ (max 0 (- column-width (length name) (length shortcut)))))))\r
+>          (setq count (1+ count))\r
+>          (when (eq (% count tags-per-line) 0)\r
+>            (setq column-indent 0)\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r