diff options
| author | Glenn Morris | 2011-02-24 00:02:45 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-02-24 00:02:45 -0800 |
| commit | 07915ed93c1a21776f7371e615b43d0d79eaebfd (patch) | |
| tree | 4418dab401b93bc491fb70b899931c1454751f04 | |
| parent | ebe401f69718e17144fc7f7a8ab36f7c12452f2a (diff) | |
| download | emacs-07915ed93c1a21776f7371e615b43d0d79eaebfd.tar.gz emacs-07915ed93c1a21776f7371e615b43d0d79eaebfd.zip | |
More dir-locals fixes for files.el.
* lisp/files.el (hack-local-variables-confirm, hack-local-variables-filter):
Doc fix (say _which_ directory `dir-name' is).
(hack-dir-local-variables): Fix setting of `dir-name'.
Previous value seems clearly wrong. Eg put a risky variable in a
dir-locals file, visit a file in a subdirectory, see which directory
it says the risky variables come from. It should be the one with the
associated directory variables, not the one containing the visited file.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/files.el | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d77e6b7ccd8..cb0708aa0fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-02-24 Glenn Morris <rgm@gnu.org> | 1 | 2011-02-24 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (hack-dir-local-variables): Fix setting of `dir-name'. | ||
| 4 | (hack-local-variables-confirm, hack-local-variables-filter): Doc fix. | ||
| 5 | |||
| 3 | * files.el (dir-locals-find-file): Doc fix. | 6 | * files.el (dir-locals-find-file): Doc fix. |
| 4 | Fix the check for cache elements that have no associated file, | 7 | Fix the check for cache elements that have no associated file, |
| 5 | and the mtime check for those that do. | 8 | and the mtime check for those that do. |
diff --git a/lisp/files.el b/lisp/files.el index e4cc782b1d1..5890bf9b8c9 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2919,8 +2919,8 @@ variable to set.") | |||
| 2919 | ALL-VARS is the list of all variables to be set up. | 2919 | ALL-VARS is the list of all variables to be set up. |
| 2920 | UNSAFE-VARS is the list of those that aren't marked as safe or risky. | 2920 | UNSAFE-VARS is the list of those that aren't marked as safe or risky. |
| 2921 | RISKY-VARS is the list of those that are marked as risky. | 2921 | RISKY-VARS is the list of those that are marked as risky. |
| 2922 | DIR-NAME is a directory name if these settings come from | 2922 | If these settings come from directory-local variables, then |
| 2923 | directory-local variables, or nil otherwise." | 2923 | DIR-NAME is the name of the associated directory. Otherwise it is nil." |
| 2924 | (if noninteractive | 2924 | (if noninteractive |
| 2925 | nil | 2925 | nil |
| 2926 | (save-window-excursion | 2926 | (save-window-excursion |
| @@ -3062,8 +3062,8 @@ VARIABLES is the alist of variable-value settings. This alist is | |||
| 3062 | `enable-local-eval', `enable-local-variables', and (if necessary) | 3062 | `enable-local-eval', `enable-local-variables', and (if necessary) |
| 3063 | user interaction. The results are added to | 3063 | user interaction. The results are added to |
| 3064 | `file-local-variables-alist', without applying them. | 3064 | `file-local-variables-alist', without applying them. |
| 3065 | DIR-NAME is a directory name if these settings come from | 3065 | If these settings come from directory-local variables, then |
| 3066 | directory-local variables, or nil otherwise." | 3066 | DIR-NAME is the name of the associated directory. Otherwise it is nil." |
| 3067 | ;; Find those variables that we may want to save to | 3067 | ;; Find those variables that we may want to save to |
| 3068 | ;; `safe-local-variable-values'. | 3068 | ;; `safe-local-variable-values'. |
| 3069 | (let (all-vars risky-vars unsafe-vars) | 3069 | (let (all-vars risky-vars unsafe-vars) |
| @@ -3547,11 +3547,8 @@ and `file-local-variables-alist', without applying them." | |||
| 3547 | (dir-name nil)) | 3547 | (dir-name nil)) |
| 3548 | (cond | 3548 | (cond |
| 3549 | ((stringp variables-file) | 3549 | ((stringp variables-file) |
| 3550 | ;; FIXME seems like the wrong dir-name. | 3550 | (setq dir-name (file-name-directory variables-file) |
| 3551 | (setq dir-name (if (buffer-file-name) | 3551 | class (dir-locals-read-from-file variables-file))) |
| 3552 | (file-name-directory (buffer-file-name)) | ||
| 3553 | default-directory)) | ||
| 3554 | (setq class (dir-locals-read-from-file variables-file))) | ||
| 3555 | ((consp variables-file) | 3552 | ((consp variables-file) |
| 3556 | (setq dir-name (nth 0 variables-file)) | 3553 | (setq dir-name (nth 0 variables-file)) |
| 3557 | (setq class (nth 1 variables-file)))) | 3554 | (setq class (nth 1 variables-file)))) |