emacs-devel
[Top][All Lists]
Advanced

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

RE: Qs on key-description, substitute-command-keys


From: Drew Adams
Subject: RE: Qs on key-description, substitute-command-keys
Date: Fri, 14 Oct 2005 15:53:00 -0700

I never got any feedback on this question:

    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'?

The workaround I mentioned works only when you can control all of the
`define-key's. It does not work, for instance, if you do a
`substitute-key-definition' or, presumably, a (define-key [remap...]...).

For example:

(substitute-key-definition 'scroll-left 'my-cmd
                           'minibuffer-local-completion-map)

`scroll-left' is globally bound to `C-next' and `C-x <'. I would like the
former binding to show via `substitute-command-keys', but the latter shows.
I have several bindings like this, all closely related, and all simple
bindings using prefix `C-'. But the resulting doc string shows bindings that
are all seemingly unrelated (all over the map, so to speak ;-)).

If there is no way to control this, could Emacs itself be configured to
prefer a binding that does not use a prefix key whenever there is one?  That
is, could it be designed so that `substitute-command-keys' prefers to show
`C-next' instead of `C-x <' for `scroll-left'?  (Somehow, I anticipate
people saying that some terminals don't have [next] keys, so `C-x <' is
better...)

Thx.





reply via email to

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