Function: override-global-mode
override-global-mode is an interactive and byte-compiled function
defined in bind-key.el.gz.
Signature
(override-global-mode &optional ARG)
Documentation
A minor mode for allowing keybindings to override other modes.
The main purpose of this mode is to simplify bindings keys in such a way that they take precedence over other modes.
To achieve this, the keymap override-global-map is added to
emulation-mode-map-alists, which makes it take precedence over
keymaps in minor-mode-map-alist. Thereby, key bindings get an
even higher precedence than global key bindings defined with
keymap-global-set (or, in Emacs 28 or older, global-set-key).
The macro bind-key* (which see) provides a convenient way to
add keys to that keymap.
This is a minor mode. If called interactively, toggle the
Override-Global mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable override-global-mode(var)/override-global-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/bind-key.el.gz
(define-minor-mode override-global-mode
"A minor mode for allowing keybindings to override other modes.
The main purpose of this mode is to simplify bindings keys in
such a way that they take precedence over other modes.
To achieve this, the keymap `override-global-map' is added to
`emulation-mode-map-alists', which makes it take precedence over
keymaps in `minor-mode-map-alist'. Thereby, key bindings get an
even higher precedence than global key bindings defined with
`keymap-global-set' (or, in Emacs 28 or older, `global-set-key').
The macro `bind-key*' (which see) provides a convenient way to
add keys to that keymap."
:init-value t
:lighter "")