> Also, is there a good way to control which of several key bindings for a > command is output by `substitute-command-keys'? The only way > I've found is to make sure that the one I want is the last of the key > sequences for that command defined in the map - and that's not always > feasible. I found nothing in the manual about which binding is displayed > or how to control that. > > Does anyone know how to control which of several bindings for a command is > displayed by `substitute-command-keys'?
There is the same problem for the key suggestion feature activated by `suggest-key-bindings' displaying in the echo area only the "first" key binding which is not always better than other key bindings. A good solution is to suggest all key bindings in the echo area just like `where-is' (`C-h w') does. Perhaps it is not a good solution for `substitute-command-keys' to replace key descriptions with all key bindings since the resulting string might be too long. However, how about introducing a new convention that all strings on which `substitute-command-keys' is used should be designed to reserve enough space for the case when the command is not on any keys, and so `M-x COMMAND' is printed. The size of the command name plus 4 characters of the "M-x " string should define the maximum length of allowed substitutions, and if the command is bound to several key, then to print as many keys as many of them fits into this limit. For example: M-x scroll-left -> defines the maximum 15 characters C-next, C-x < -> both keys fit into 15-characters limit, so replace \[scroll-left] with both keys -- Juri Linkov http://www.jurta.org/emacs/ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel