Function: so-long-after-change-major-mode

so-long-after-change-major-mode is a byte-compiled function defined in so-long.el.gz.

Signature

(so-long-after-change-major-mode)

Documentation

Run by so-long-mode in after-change-major-mode-hook.

Calls so-long-disable-minor-modes and so-long-override-variables.

Source Code

;; Defined in /usr/src/emacs/lisp/so-long.el.gz
(defun so-long-after-change-major-mode ()
  "Run by `so-long-mode' in `after-change-major-mode-hook'.

Calls `so-long-disable-minor-modes' and `so-long-override-variables'."
  ;; Check/set the state of 'preserved' variables and minor modes.
  ;; (See also `so-long-mode-revert'.)
  ;; The "modes before variables" sequence is important for the default
  ;; preserved mode `view-mode' which remembers the `buffer-read-only' state
  ;; (which is also permanent-local).  That causes problems unless we restore
  ;; the original value of `view-old-buffer-read-only' after; otherwise the
  ;; sequence `view-mode' -> `so-long' -> `so-long-revert' -> `view-mode'
  ;; results in `view-mode' being disabled but the buffer still read-only.
  (so-long-mode-maintain-preserved-minor-modes)
  (so-long-mode-maintain-preserved-variables)
  ;; Disable minor modes.
  (so-long-disable-minor-modes)
  ;; Override variables (again).  We already did this in `so-long-mode' in
  ;; order that variables which affect global/globalized minor modes can have
  ;; that effect; however it's feasible that one of the minor modes disabled
  ;; above might have reverted one of these variables, so we re-enforce them.
  ;; (For example, disabling `visual-line-mode' sets `line-move-visual' to
  ;; nil, when for our purposes it is preferable for it to be non-nil).
  (so-long-override-variables))