From: Andrew Burgess Date: Sun, 13 Dec 2015 19:09:46 +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=0396096d976a93feb372f9169cd3a733a65a640a;p=notmuch-archives.git Re: [PATCH] emacs: hello: display jump key next to saved search when available --- diff --git a/b9/c613269d888e142b188378db19dfbcbaf3e54d b/b9/c613269d888e142b188378db19dfbcbaf3e54d new file mode 100644 index 000000000..6e9c6d5b6 --- /dev/null +++ b/b9/c613269d888e142b188378db19dfbcbaf3e54d @@ -0,0 +1,124 @@ +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 527E06DE02CE + for ; Sun, 13 Dec 2015 11:09:53 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.668 +X-Spam-Level: +X-Spam-Status: No, score=-0.668 tagged_above=-999 required=5 tests=[AWL=0.052, + 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] 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 buBqO9UrCsb2 for ; + Sun, 13 Dec 2015 11:09:51 -0800 (PST) +Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com + [74.125.82.52]) by arlo.cworth.org (Postfix) with ESMTPS id 885406DE0231 for + ; Sun, 13 Dec 2015 11:09:50 -0800 (PST) +Received: by mail-wm0-f52.google.com with SMTP id n186so18751779wmn.0 + for ; Sun, 13 Dec 2015 11:09:50 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=embecosm-com.20150623.gappssmtp.com; s=20150623; + h=date:from:to:cc:subject:message-id:references:mime-version + :content-type:content-disposition:in-reply-to:user-agent; + bh=gDMLVVlPt6KuoNCZMsgKeBfrmMyVNcZQeqEd/1bU744=; + b=hAYWRl1pEnHQN6KOVLPcSj+eJqB8SSGiDdztCtiN0jeQ6V2zdnIVqBarUqdIKYAIvP + dvvuP7lkUzWDTY2u2XV5j4pelGD3GmJsUJ/+qJB2fiYdeNV2qS3ot4Zc+qzUpmLcNPK8 + HdtyoTI7bNUjbvY7Gs6ehNicKKOScLm4GXIDeRyjpx4QqTCPp9rKPc62PNp1jYiQrPE2 + q9ASjTUZ8X1fl/Azs1OsxRjw9Byw8KViO/h/4lU7OovMLdLMTQMgh1uhfjJ3P1Ak6R57 + e1zfkLe2D3auKUOyi7Bbbz6FBZ0c1BFGrRvn8Tp0q1BYHWJ3CFiQI3r1GojQa7LqknSb + hUeA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:date:from:to:cc:subject:message-id:references + :mime-version:content-type:content-disposition:in-reply-to + :user-agent; + bh=gDMLVVlPt6KuoNCZMsgKeBfrmMyVNcZQeqEd/1bU744=; + b=IBrYmMlKcxGSfTz50eohekwpFuyQ3EoSjFV1q638uH7C8KsgW76Aszz95/8wq7G4Z+ + JyK7fvuVmfAfzcA6feeiqfmMC4YbKLt1yLiWpSVcHdOvNmCSjO5OCPjA8r9OpI4hSk+7 + ha2mytOBSTBBqxpNEABP3geniHOauth6iPZQOJxhQMfcLky0v9QLVb3r7amQTNzugGdM + jpOlVk6N3JLsaZuqGp2jXXt/DtSx3V2uVGnZbOlil+UBI2xSCbOK7tFfK5VrIrTRNAY6 + t5ODb/lkAueN5iTZGtPQGvv/6x1m2uySSK0HMGLGheSKp6ARrcAIsU6h7uUezG/eoOkA + MaqA== +X-Gm-Message-State: ALoCoQkEWmDbUbbmbAa8rI7hiGWY3TMT3BhiPhPdLd+i9kcaG8tm+8TU1flTbmkTvT5w3NbPRWFV0G14wQCsW89Bz2CZErYPgA== +X-Received: by 10.28.64.131 with SMTP id n125mr20117708wma.103.1450033788732; + Sun, 13 Dec 2015 11:09:48 -0800 (PST) +Received: from localhost (host86-138-95-213.range86-138.btcentralplus.com. + [86.138.95.213]) + by smtp.gmail.com with ESMTPSA id t64sm12712583wmf.23.2015.12.13.11.09.47 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sun, 13 Dec 2015 11:09:48 -0800 (PST) +Date: Sun, 13 Dec 2015 19:09:46 +0000 +From: Andrew Burgess +To: Jani Nikula +Cc: notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: hello: display jump key next to saved search when + available +Message-ID: <20151213190946.GA4520@embecosm.com> +References: <1450031043-24038-1-git-send-email-jani@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1450031043-24038-1-git-send-email-jani@nikula.org> +X-Operating-System: Linux/4.2.6-201.fc22.x86_64 (x86_64) +X-Uptime: 19:06:44 up 1 day, 22:02, +X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] +User-Agent: Mutt/1.5.24 (2015-08-30) +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, 13 Dec 2015 19:09:53 -0000 + +* Jani Nikula [2015-12-13 20:24:03 +0200]: + +> Display the shortcut jump key next to the saved search name in notmuch +> hello, if one is defined for the saved search. +> +> --- +> +> 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))) + +You should probably make use of `substitute-command-key' instead of +hard-coding the "j", something like (untested): + + (format (substitute-command-key " [\[notmuch-jump-search] %s]") key) + +Thanks, +Andrew