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
macros; I'm not sure what they should be called) are defined. For example
I have unbound every function key in both
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)?
Why is it
(define-key input-decode-map [?\C-i] (kbd "<C-i>"))creates an abstraction that interprets the keys
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
keypress Control+Backspace ->
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>") ) (define-key local-function-key-map (kbd "<return>") ) (define-key local-function-key-map (kbd "<escape>") ) (define-key local-function-key-map (kbd "<backspace>") )
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