all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 39035@debbugs.gnu.org, Stefan Kangas <stefan@marxist.se>
Subject: bug#39035: Show key bindings on M-x completion
Date: Thu, 30 Jan 2020 01:42:55 +0200	[thread overview]
Message-ID: <87o8ulj0cg.fsf@mail.linkov.net> (raw)
In-Reply-To: <jwvftfzx958.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 28 Jan 2020 22:02:55 -0500")

tags 39035 fixed
close 39035 28.1
quit

>> +       (if (and suggest-key-bindings (eq action 'metadata))
>> +	   '(metadata
>> +	     (annotation-function . read-extended-command--annotation)
>> +	     (category . suggest-key-bindings))
>
> The `category` should describe the things that are being completed,
> i.e. `command` rather than `suggest-key-bindings`.

Fixed.

>> +(defun read-extended-command--annotation (command-name)
>> +  (let* ((function (and (stringp command-name) (intern-soft command-name)))
>> +         (binding (where-is-internal function overriding-local-map t)))
>> +    (when binding
>> +      (format " (%s)" (if (stringp binding)
>> +                          (concat "M-x " binding " RET")
>> +                        (key-description binding))))))
>
> Since we're in the middle of a `M-x`, I think a `M-x foo RET` annotation
> would not be useful at all: better not put anything when a command has
> no corresponding key binding (one could argue that it could be useful to
> put the `M-x <shortenedname> RET` like `M-x re-u RET` for
> `rename-uniquely`, but it would be too costly to compute and still
> wouldn't be terribly useful).

Thanks for suggestions, the fixed patch was pushed to master.





      reply	other threads:[~2020-01-29 23:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 10:17 bug#39035: Show key bindings on M-x completion Stefan Kangas
2020-01-28 21:39 ` Juri Linkov
2020-01-29  3:02   ` Stefan Monnier
2020-01-29 23:42     ` Juri Linkov [this message]

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

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

  git send-email \
    --in-reply-to=87o8ulj0cg.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=39035@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.