Function: so-long--hack-local-variables

so-long--hack-local-variables is a byte-compiled function defined in so-long.el.gz.

Signature

(so-long--hack-local-variables ORIG-FUN &optional HANDLE-MODE &rest ARGS)

Documentation

Enable global-so-long-mode(var)/global-so-long-mode(fun) to defer to file-local mode declarations.

If a file-local mode is detected, then we call the function defined by so-long-file-local-mode-function.

This advice acts after the HANDLE-MODE:t call to hack-local-variables.
(MODE-ONLY in Emacs versions < 26).

File-local header comments are currently an exception, and are processed by so-long--check-header-modes (see which for details).

Source Code

;; Defined in /usr/src/emacs/lisp/so-long.el.gz
;; Lisp advice, Lisp advice
;; Every calling you greet me
;; Code of mine, redefined
;; You look happy to tweak me

(defun so-long--hack-local-variables (orig-fun &optional handle-mode &rest args)
  ;; Advice, enabled with:
  ;; (advice-add 'hack-local-variables :around #'so-long--hack-local-variables)
  ;;
  ;; See also "Files with a file-local 'mode'" in the Commentary.
  "Enable `global-so-long-mode' to defer to file-local mode declarations.

If a file-local mode is detected, then we call the function defined by
`so-long-file-local-mode-function'.

This advice acts after the HANDLE-MODE:t call to `hack-local-variables'.
\(MODE-ONLY in Emacs versions < 26).

File-local header comments are currently an exception, and are processed by
`so-long--check-header-modes' (see which for details)."
  ;; The first arg to `hack-local-variables' is HANDLE-MODE since Emacs 26.1,
  ;; and MODE-ONLY in earlier versions.  In either case we are interested in
  ;; whether it has the value t.
  (let ((retval (apply orig-fun handle-mode args)))
    (and (eq handle-mode t)
         retval ; A file-local mode was set.
         (so-long-handle-file-local-mode retval))
    retval))