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