From 27b48e635a0abd153107846b834c24074b185815 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 26 May 2011 00:35:47 -0700 Subject: [PATCH] * lisp/files.el (hack-local-variables, hack-local-variables-apply): Doc fixes. --- lisp/ChangeLog | 1 + lisp/files.el | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20528d7c070..4750040bd75 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * files.el (hack-local-variables-prop-line, hack-local-variables): Downcase mode names, as seems to be traditional. + (hack-local-variables, hack-local-variables-apply): Doc fixes. * mail/emacsbug.el (report-emacs-bug): Mention checking From address. (report-emacs-bug-hook): Try to validate the From address. (Bug#8038) diff --git a/lisp/files.el b/lisp/files.el index 9749e9d75ef..4f037c2a997 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3147,6 +3147,8 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. +Uses `hack-local-variables-apply' to apply the variables. + If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" is specified, and return the corresponding mode symbol, or nil. In this case, we try to ignore minor-modes, and only return a @@ -3260,6 +3262,14 @@ major-mode." (hack-local-variables-apply))))) (defun hack-local-variables-apply () + "Apply the elements of `file-local-variables-alist'. +If there are any elements, runs `before-hack-local-variables-hook', +then calls `hack-one-local-variable' to apply the alist elements one by one. +Finishes by running `hack-local-variables-hook', regardless of whether +the alist is empty or not. + +Note that this function ignores a `mode' entry if it specifies the same +major mode as the buffer already has." (when file-local-variables-alist ;; Any 'evals must run in the Right sequence. (setq file-local-variables-alist -- 2.39.2