0

I'd like to change the C-h prefix to C-SPC and so I added the following to my init.el, but it has no effect.

(define-key which-key-mode-map (kbd "<C-SPC>") 'which-key-C-h-dispatch)

Help understanding how to make this change would be appreciated. Thanks.

3
  • Does this answer your question? How do I describe C-z?
    – Drew
    Commented Mar 27, 2020 at 20:55
  • @Drew: it might be related but it seems like a fairly different circumstance (doesn't mention the same error, and it's specific to the which-key package).
    – Stefan
    Commented Mar 27, 2020 at 21:24
  • @Stefan: OK; I wasn't sure. Seemed to be about replacing one prefix key with another.
    – Drew
    Commented Mar 27, 2020 at 23:39

1 Answer 1

0

Ctrl is 2^26, SPC is 0x20, so C-SPC is 0x4000020.

Set variable help-char to C-SPC: (setq help-char #x4000020)

See elisp manual for more detail: https://www.gnu.org/software/emacs/manual/html_node/elisp/Keyboard-Events.html#Keyboard-Events

1
  • Or (aref (kbd "C-SPC") 0) if you want to do that in a way a human could read. (Not that it's not good background info, but I think that referring to keys in your init file with just the raw numbers would be slightly mad.)
    – phils
    Commented Aug 7 at 22:33

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.