Emacs Keys: Minor Modes Key Priority
This page shows you how to change minor modes's key priority. 〔see Emacs: Minor Mode〕
minor-mode-map-alist
Minor mode's keys priority depends on the variable minor-mode-map-alist .
minor-mode-map-alist is a Association List .
Each element of minor-mode-map-alist is a cons pair, of the form
(cons 'minor_mode_x_var minor_mode_x_keymap)
The minor_mode_x_var is a variable of the same name of the command to toggle the minor mode, and has value of t or nil. (all minor modes have this variable)
The minor_mode_x_keymap is a keymap for that minor mode. (keymap is basically a list, used for keybinding. Format of Keymaps (ELISP Manual) )
Each minor_mode_x_var may have value true or false. When true, it means the corresponding keymap is active.
Emacs goes thru the active one in minor-mode-map-alist, the front ones has priority.
Note: emacs has other mechanisms about priority of keys.
- keymap embedded as text properties has priority. 〔see Elisp: Text Properties〕
- emulation-mode-map-alists
- minor-mode-map-alist
Show Minor Mode Key Priority
You can use this command to show minor mode key priority.
(defun xah-display-minor-mode-key-priority () "Print out minor mode's key priority. URL `http://xahlee.info/emacs/emacs/minor_mode_key_priority.html' Version 2017-01-27" (interactive) (mapc (lambda (x) (prin1 (car x)) (terpri)) minor-mode-map-alist))
Emacs, Change Keys
- Emacs Keys: Define Key
- Emacs Keys: Syntax
- Emacs Keys: Keybinding Functions (emacs 29)
- Emacs Keys: Good and Bad Key Choices
- Emacs Keys: Swap CapsLock Control
- Emacs Keys: Meta Key
- Emacs Keys: Change Major Mode Keys
- Emacs Keys: Change Minor Mode Keys
- Emacs Keys: Minor Modes Key Priority
- Emacs Keys: Change Minibuffer Keys