From: Jani Nikula Date: Sun, 20 Dec 2015 12:50:11 +0000 (+0200) Subject: Re: [PATCH] emacs: jump: show key shortcut X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=44b2f6d93b98ffd87b3eed86540c7ac2eb6d780b;p=notmuch-archives.git Re: [PATCH] emacs: jump: show key shortcut --- diff --git a/85/f1173eb3b7c800d758ce4e3a75056dff2a3bba b/85/f1173eb3b7c800d758ce4e3a75056dff2a3bba new file mode 100644 index 000000000..d93718a45 --- /dev/null +++ b/85/f1173eb3b7c800d758ce4e3a75056dff2a3bba @@ -0,0 +1,178 @@ +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 896FE6DE1413 + for ; Sun, 20 Dec 2015 04:51:05 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.542 +X-Spam-Level: +X-Spam-Status: No, score=-0.542 tagged_above=-999 required=5 tests=[AWL=0.178, + 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 NNd5K9bz1xOk for ; + Sun, 20 Dec 2015 04:51:02 -0800 (PST) +Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com + [74.125.82.51]) by arlo.cworth.org (Postfix) with ESMTPS id 80D0B6DE025F for + ; Sun, 20 Dec 2015 04:51:02 -0800 (PST) +Received: by mail-wm0-f51.google.com with SMTP id p187so38049623wmp.0 + for ; Sun, 20 Dec 2015 04:51:02 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=nikula-org.20150623.gappssmtp.com; s=20150623; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=PciPELuS4mRCaky6uoONOvWakccilkPEFxYQEiGwlXQ=; + b=ePZ3ijwKNstT5pnyWvrriJTYWD1/wD/S3X4qCkAG4LmASBad0UqLYTGGFylRiZwiQU + hMOwJALDwLuRb1bnT1ZcCtCyNS0XuBu8Qdfq9+hTospYGKcl/XiWQmlQXF4o9CUg/nY2 + NfKu0wyUO0UO+HSHWO9DwXukectsiAtRhj+M8BGPyrjuRx5dUGNkVaiEpIkPwlqnh07x + QC0+YH9dMcmuPtJmeQSSlkBL0BJsAafL0NLgoWZFo3mJ8mUgoUVQHdaY++UiMjRJBoy9 + Y1e8+bCIQXW1ZUZ7ZAU9rIpWlbetECjDO5VhMS2QuEtINsckkBvPfs84A/udaodx+I9o + jEPA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=PciPELuS4mRCaky6uoONOvWakccilkPEFxYQEiGwlXQ=; + b=ZbOSnhC1uAChQVaVki9ZequPCfMWktI1RRFDB+2pSaMQRex9iQJkQkQ5qjhSlSF0jD + rlAPybSWo2M4vBwglFgHEMIHu66//8rdfaH6N5EQr+X+9cd0TBU4S9aqX+c4bTiCkvSL + en3p+G2Dhf7BVDurNyiLzWOqaoEDKyAoZFMZ8TaDGL/gqae3b/ACecHmMtOZMdt9DARH + L5rFzympsG8KeHnlWwcyR2vP6fVYOLClH+ErGjbN+LfMH4gg2v+Q0mtCP+DMg6p0USwo + N8mIR0rBv44rsyrJmt6/Kcl1f0jHEmeKaY+cTmdUpKqmqU6DSctICEGx7YaMPKqyfo1j + Csng== +X-Gm-Message-State: ALoCoQnbMZSvHhdclRt0zRSZjoaSdKQhQWhNds1qTWWrg4+gmV9PVS6iLIRCs24Zv2VaJiZqVzxcHkALyOjsx15vvYcbb4Mzeg== +X-Received: by 10.28.46.87 with SMTP id u84mr2301486wmu.102.1450615859897; + Sun, 20 Dec 2015 04:50:59 -0800 (PST) +Received: from localhost (mobile-access-bceea3-137.dhcp.inet.fi. + [188.238.163.137]) + by smtp.gmail.com with ESMTPSA id dl8sm23423471wjb.29.2015.12.20.04.50.58 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 20 Dec 2015 04:50:58 -0800 (PST) +From: Jani Nikula +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: jump: show key shortcut +In-Reply-To: <1450603587-2950-1-git-send-email-markwalters1009@gmail.com> +References: <1450031043-24038-1-git-send-email-jani@nikula.org> + <1450603587-2950-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.21+27~g2b12735 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 20 Dec 2015 14:50:11 +0200 +Message-ID: <878u4pxp18.fsf@nikula.org> +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, 20 Dec 2015 12:51:05 -0000 + +On Sun, 20 Dec 2015, Mark Walters wrote: +> This shows the jump key shortcut in the hello screen -- it underlines +> the letter, if it is present, in the search name. +> --- +> +> In id:1450031043-24038-1-git-send-email-jani@nikula.org Jani suggested +> showing jump key shortcuts in the hello screen. I like the idea but +> found the method a little cluttered. + +Yes; it was a proof-of-concept. + +> This is an alternative approach which underlines the relevant key in +> the search name (if it occurs). This is relatively unintrusive +> (possibly even too hard to see) and is in line with how many other +> applications show shortcuts. +> +> I am guessing that most people choose a shortcut key with some +> relevance to the search name (eg i for inbox) so in most cases I think +> the shortcut will be shown. Of course multi-key shortcuts will not be shown. + +While I understand your thinking, this falls short for me in several +ways. + +First is that it's case sensitive. "i for Inbox" doesn't work. However +if you made it case insensitive, it might be silly for upper case +shortcuts. + +Second is that automatic selection of the letter to underline is not +necessarily the logical one. "n for Inbox (notmuch)" underlines n in +"Inbox" instead of "notmuch". Hard to do anything about this. But it can +be confusing UI wise. + +Third is that I do use characters not in the search name. For example "* +for flagged". I'm not happy that there is no fallback when the letter is +not present. + +> If people think the underlining is too discreet then we could change +> the 'underline below to '(:foreground "red") or similar. + +I don't think I would find the "fruit salad" visually pleasing. If +different colors were used, I'd prefer the letters were separate from +the name. Like in the jump search menu. I might like that the best. + +Talking of the jump search menu, is it intentional that you underline +the keys there now too? + +Finally, if this is supposed to be helpful to newcomers too, the user +won't know how to access these underlined shortcuts, as you have to hit +"j" first. + + +BR, +Jani. + + + +> +> Best wishes +> +> Mark +> +> +> +> emacs/notmuch-hello.el | 8 ++++++++ +> 1 file changed, 8 insertions(+) +> +> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +> index 8bde808..de77730 100644 +> --- a/emacs/notmuch-hello.el +> +++ b/emacs/notmuch-hello.el +> @@ -572,7 +572,9 @@ with `notmuch-hello-query-counts'." +> (if (> column-indent 0) +> (widget-insert (make-string column-indent ? ))) +> (let* ((name (plist-get elem :name)) +> + (key (plist-get elem :key)) +> (query (plist-get elem :query)) +> + +> (oldest-first (case (plist-get elem :sort-order) +> (newest-first nil) +> (oldest-first t) +> @@ -581,6 +583,12 @@ with `notmuch-hello-query-counts'." +> (msg-count (plist-get elem :count))) +> (widget-insert (format "%8s " +> (notmuch-hello-nice-number msg-count))) +> + (save-match-data +> + (let ((case-fold-search nil)) +> + (when (and key (string-match key name)) +> + (add-face-text-property (match-beginning 0) (match-end 0) +> + 'underline +> + nil name)))) +> (widget-create 'push-button +> :notify #'notmuch-hello-widget-search +> :notmuch-search-terms query +> -- +> 2.1.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> https://notmuchmail.org/mailman/listinfo/notmuch