Basically what I've been doing the past couple of weeks is trying to customize my keybinds one mode at a time; thus I've been going through each mode one-by-one and completely clearing its keymap individually. And then binding the functions that I find useful.
I'm also doing this for educational purposes to learn more about the inner-workings of keymaps, how they relate, how to manipulate them, etc.

But what has me stuck, is how some keys (or functions/macros; I'm not sure what they should be called) are defined. For example <backtab>, <C-return>, <C-tab>, <C-iso-lefttab>, etc.

I have unbound every function key in both function-key-map and local-function-map using the command: (setf (cdr <keymap>) nil)

But yet these keys still seem to persist in existence.

Perhaps I'm just confusing myself by trying to wrap my head around the multiple levels of abstraction all at the same time..

So how would I completely obliterate these keys, so that I can start from first principles and create them myself (with their own custom names and functionality)?
Bonus Question
Why is it (define-key input-decode-map [?\C-i] (kbd "<C-i>")) creates an abstraction that interprets the keys C-i and <C-i> differently?
Control+i == C-i == ^I == TAB
Control+i == <C-i> != TAB
Does this perhaps have something to do with the paradigm shift of my thinking that needs to happen in order to better understand keymaps?
I think it would really help me and people in the future if someone could make a trivial and complex example in a format like this (assuming current major mode is text-mode):

keypress Control+Backspace ->
local-function-keymap Control+Backspace=<C-backspace> ->
text-mode-map <C-backspace>=nil ->
global-map <C-backspace>=backward-kill-word

I found that you can (kind of) obliterate the functions and then rebind them to their corresponding ASCII keys like so:

(setf (cdr x-alternatives-map) nil)
(setf (cdr function-key-map) nil)
(setf (cdr local-function-key-map) nil)
(define-key local-function-key-map (kbd "<tab>") [9])
(define-key local-function-key-map (kbd "<return>") [13])
(define-key local-function-key-map (kbd "<escape>") [27])
(define-key local-function-key-map (kbd "<backspace>") [127])

But even if I never rebind the keys, for some reason unbeknownst to me, the modifiers of the keys still work. So is there a keymap that I'm just not aware of?

if <tab> = undefined
C-<tab>  = defined
  • It's a mystery to me. :( There's also x-alternatives-map and key-translation-map and input-decode-map but I can't figure out where backtab's definition comes from…
    – amitp
    Sep 12, 2018 at 4:14
  • I think I may have found out where they are defined. It appears that they are hard-coded into the keyboard.c source file. Therefore there is no way to completely obliterate them. Sep 12, 2018 at 4:52

1 Answer 1


Maybe I can answer part of your question(s). Others can probably help more here.

<backtab> is called a "function key", but it can be bound to a command in any keymap. (Forget about function-key-map in this context.)

Vanilla Emacs (emacs -Q, no init file) binds some function keys in various keymaps. And libraries you load can do so too.

If you really want to remove function-key bindings, I'd suggest that you work from the modes that are current at a given time, in any given context. Use C-h k to find out what such a key is bound to. Determine what keymap it is bound in (typically a mode keymap), and then unbind it from that map (in your init file, on the mode hook, for example). Rinse and repeat.

You can see the keys that are currently bound in a given keymap using C-h M-k (describe-keymap) followed by a variable bound to a keymap (or followed by an actual keymap, if there is no variable). You need library help-fns+.el if you want to use describe-keymap.

Some function keys (such as backtab and f1, or rather <backtab> and <f1> (but I prefer naked notation) are pretty standard. Others are specific to Emacs. You can think of a function key as a logical name for something that can have different physical implementations. backtab is typically essentially S-TAB, for example. This is what is behind the "translation" indication you sometimes see in *Help* for C-h k.

(But I do wonder why, other than for learning about keys and keymaps (which is a good thing), you are undertaking this exercise of removing key bindings. More typical is simply binding a different key to the command whose binding you don't like. Anyway, I don't need to understand why.)

  • I think I may have found out where they are defined. It appears that they are hard-coded into the keyboard.c source file. Therefore there is no way to completely obliterate them. Sep 12, 2018 at 4:52
  • I updated the question of what I got so far. I think I may be looking for an unknown-unknown missing keymap Sep 12, 2018 at 18:56
  • Someone care to explain the downvote today, 5 years later?
    – Drew
    Sep 15, 2023 at 0:37

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.