]> code.delx.au - gnu-emacs/commitdiff
(hack-local-variables): Run hack-local-variables-hook.
authorRichard M. Stallman <rms@gnu.org>
Thu, 15 Dec 1994 12:36:03 +0000 (12:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 15 Dec 1994 12:36:03 +0000 (12:36 +0000)
(hack-local-variables-hook): New variable.

lisp/files.el

index 279dd29d2dd6ea38e1c0b37a7c51f0a3bbe4cb0b..2fc86bdd430f7abed3a7fe31dc7333f001a7d60c 100644 (file)
@@ -1077,6 +1077,11 @@ If `enable-local-variables' is nil, this function does not check for a
            (hack-one-local-variable (car (car result)) (cdr (car result)))
            (setq result (cdr result)))))))
 
+(defvar hack-local-variables-hook nil
+  "Normal hook run after processing a file's local variables specs.
+Major modes can use this to examine user-specified local variables
+in order to initialize other data structure based on them.")
+
 (defun hack-local-variables ()
   "Parse and put into effect this buffer's local variables spec."
   (hack-local-variables-prop-line)
@@ -1147,7 +1152,8 @@ If `enable-local-variables' is nil, this function does not check for a
                (or (if suffix (looking-at suffix) (eolp))
                    (error "Local variables entry is terminated incorrectly"))
                ;; Set the variable.  "Variables" mode and eval are funny.
-               (hack-one-local-variable var val))))))))
+               (hack-one-local-variable var val)))))))
+  (run-hooks 'hack-local-variables-hook))
 
 (defconst ignored-local-variables
   '(enable-local-eval)