Function: mode-local--activate-bindings
mode-local--activate-bindings is a byte-compiled function defined in
mode-local.el.gz.
Signature
(mode-local--activate-bindings &optional MODE)
Documentation
Activate variables defined locally in MODE and its parents.
That is, copy mode local bindings into corresponding buffer local
variables.
If MODE is not specified it defaults to current major-mode.
Return the alist of buffer-local variables that have been changed.
Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable.
Aliases
activate-mode-local-bindings (obsolete since 27.1)
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/mode-local.el.gz
(defun mode-local--activate-bindings (&optional mode)
"Activate variables defined locally in MODE and its parents.
That is, copy mode local bindings into corresponding buffer local
variables.
If MODE is not specified it defaults to current `major-mode'.
Return the alist of buffer-local variables that have been changed.
Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable."
;; Hack -
;; do not do this if we are inside set-auto-mode as we may be in
;; an initialization race condition.
(if (boundp 'keep-mode-if-same)
;; We are inside set-auto-mode, as this is an argument that is
;; vaguely unique.
;; This will make sure that when everything is over, this will get
;; called and we won't be under set-auto-mode anymore.
(mode-local-on-major-mode-change)
;; Do the normal thing.
(let (table old-locals)
(unless mode
(setq-local mode-local--init-mode major-mode)
(setq mode major-mode))
;; Activate mode bindings following parent modes order.
(dolist (mode (derived-mode-all-parents mode))
(when (setq table (get mode 'mode-local-symbol-table))
(mapatoms
(lambda (var)
(when (get var 'mode-variable-flag)
(let ((v (intern (symbol-name var))))
;; Save the current buffer-local value of the
;; mode-local variable.
(and (local-variable-p v (current-buffer))
(push (cons v (symbol-value v)) old-locals))
(set (make-local-variable v) (symbol-value var)))))
table)))
old-locals)))