unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: jump: show key shortcut
Date: Sun, 20 Dec 2015 14:50:11 +0200	[thread overview]
Message-ID: <878u4pxp18.fsf@nikula.org> (raw)
In-Reply-To: <1450603587-2950-1-git-send-email-markwalters1009@gmail.com>

On Sun, 20 Dec 2015, Mark Walters <markwalters1009@gmail.com> 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

  reply	other threads:[~2015-12-20 12:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13 18:24 [PATCH] emacs: hello: display jump key next to saved search when available Jani Nikula
2015-12-13 19:09 ` Andrew Burgess
2015-12-20  9:26 ` [PATCH] emacs: jump: show key shortcut Mark Walters
2015-12-20 12:50   ` Jani Nikula [this message]
2016-02-07  9:20 ` [PATCH] emacs: hello: display jump key next to saved search when available David Edmondson
2016-02-07 10:58   ` Jani Nikula
2016-02-09 20:42     ` David Edmondson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878u4pxp18.fsf@nikula.org \
    --to=jani@nikula.org \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).