[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unhelpful menu keybinding notes

From: Stefan Monnier
Subject: Re: unhelpful menu keybinding notes
Date: Mon, 17 Apr 2006 12:29:57 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     Alternatively, one could put explicit keyboard help strings into the
>     menus (or have some property for that purpose on the function?).  One
>     might assume that the people with actual "<cut>", "<paste>", "<copy>"
>     keys would still try using them without being prompted for them.

> Yes, this is a general problem with `substitute-command-keys', which we have
> discussed before. Whenever there is more than one key sequence bound to a
> command, the problem surfaces.

> No matter what algorithm is used to choose (ASCII, non-ASCII, shortest,
> longest, chords, non-chords, whatever), people will want to be able to
> specify the binding to use in the result, and there is no way to do that
> now. I hope we will address this after the release and find a good solution.

> In my own libraries I sometimes hard-code explicit bindings and sometimes
> rely upon \\[...]. The advantage of the former is that you can control what
> gets communicated; the disadvantage is that that can be incorrect if the
> user has changed the bindings.

In some pars of Emacs we use another trick: make and use an alias, like
`advertised-undo'.  I think this is a bad solution because C-h f undo RET
then lists all bindings except for the "advertised" one C-x u.

Maybe a better solution is to add a `advertised-binding' property to the
function's symbol:

  (put 'undo 'advertised-binding [?\C-x ?u])

which could be used similarly to the :key-sequence property in menus
(i.e. it's used if the key seuqnece is indeed bound to the specified


reply via email to

[Prev in Thread] Current Thread [Next in Thread]