Function: so-long-mode-revert

so-long-mode-revert is an interactive and byte-compiled function defined in so-long.el.gz.

Signature

(so-long-mode-revert)

Documentation

Call the major-mode which was selected before so-long-mode replaced it.

Re-process local variables, and restore overridden variables and minor modes.

This is the so-long-revert-function(var)/so-long-revert-function(fun) for so-long-mode.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/so-long.el.gz
(defun so-long-mode-revert ()
  "Call the `major-mode' which was selected before `so-long-mode' replaced it.

Re-process local variables, and restore overridden variables and minor modes.

This is the `so-long-revert-function' for `so-long-mode'."
  (interactive)
  (let ((so-long-original-mode (so-long-original 'major-mode)))
    (unless so-long-original-mode
      (error "Original mode unknown"))
    (funcall so-long-original-mode)
    ;; Emacs 26+ has already called `hack-local-variables' (during
    ;; `run-mode-hooks'; provided there was a `buffer-file-name'), but for older
    ;; versions we need to call it here.  In Emacs 26+ the revised 'HANDLE-MODE'
    ;; argument is set to `no-mode' (being the non-nil-and-non-t behavior),
    ;; which we mimic here by binding `so-long--hack-local-variables-no-mode',
    ;; in order to prevent a local 'mode' variable from clobbering the major
    ;; mode we have just called.
    (when (< emacs-major-version 26)
      (let ((so-long--hack-local-variables-no-mode t))
        (hack-local-variables)))
    ;; Restore minor modes.
    (so-long-restore-minor-modes)
    ;; Restore overridden variables.
    ;; `kill-all-local-variables' was already called by the original mode
    ;; function, so we may be seeing global values.
    (so-long-restore-variables)
    ;; Check/set the state of 'preserved' variables and minor modes.
    ;; (Refer to `so-long-after-change-major-mode' regarding the sequence.)
    (so-long-mode-maintain-preserved-minor-modes)
    (so-long-mode-maintain-preserved-variables)
    ;; Restore the mode line construct.
    (unless (derived-mode-p 'so-long-mode)
      (setq so-long-mode-line-info (so-long-mode-line-info)))))