2

I tried to bind a key using a prefix-key of C-z, but Emacs told me: Key sequence C-z c starts with non-prefix key C-z. I guess this means that C-z is already bound to something.

So I tried to do M-x describe-key RET C-z, but when I do that it doesn't describe that key, it just waits for the next key press (by adding a hyphen after C-z).

How can I tell describe-key that I just want to know what C-z is?

2 Answers 2

2

Use C-z C-h.

That shows you a list of all the keys, and their commands, that have C-z as a prefix key.

5
  • When I press C-z C-h I'm told that the following are bound: C-z C-b, C-z b, C-z o, C-z p, C-z q, C-z r, C-z s, C-z t. But emacs was complaining when I tried to set: ; (("C-z c" . avy-goto-char-timer) ; ("C-z l" . avy-goto-line) ; ("C-C j" . avy-resume)) I'm sorry, but I cannot figure out how to put newlines here, every time I hit enter, it saves the comment.
    – basedrum1
    Commented Jan 8, 2020 at 16:08
  • Sounds like a different question. Your question here is about telling "describe-key that I just want to know what C-z is?". In any case, please put all info about a question in the question itself - comments can be deleted at any time.
    – Drew
    Commented Jan 8, 2020 at 16:21
  • For your second question (but please pose it as a separate question): Specify what keymap(s) you're talking about. An answer as to how to bind a key is specific to the map you want to define it for.
    – Drew
    Commented Jan 8, 2020 at 16:23
  • Thanks, I indeed did open a new question about this!
    – basedrum1
    Commented Jan 8, 2020 at 16:37
  • 1
    What keymap are you trying to bind to? What you've shown us in your comment is just data, and insufficient to indicate how the data is being used. I would guess that you're trying to bind to the global map, and therefore need to (global-set-key (kbd "C-z") nil) to remove the standard global binding.
    – phils
    Commented Jan 8, 2020 at 21:45
1

You can call the function describe-key directly, either by evaluating it in a scratch buffer, or by using the eval-expression command (bound to M-:).

For example: M-: (describe-key "\C-z") RET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.