[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp files.el
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] emacs/lisp files.el |
Date: |
Sun, 19 Jul 2009 16:55:16 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 09/07/19 16:55:16
Modified files:
lisp : files.el
Log message:
(ignored-local-variables): Add `dir-local-variables-alist'.
(dir-local-variables-alist): New buffer-local variable.
(hack-local-variables-filter): If variable is not dir-local,
i.e. `dir-name' is nil, then remove it from `dir-local-variables-alist',
because file-local overrides dir-local.
(c-postprocess-file-styles)<declare-function>:
Remove obsolete declaration.
(hack-dir-local-variables): Add dir-local variable/value pair to
`dir-local-variables-alist' and remove duplicates. Doc fix.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/files.el?cvsroot=emacs&r1=1.1058&r2=1.1059
Patches:
Index: files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.1058
retrieving revision 1.1059
diff -u -b -r1.1058 -r1.1059
--- files.el 19 Jul 2009 01:05:21 -0000 1.1058
+++ files.el 19 Jul 2009 16:55:16 -0000 1.1059
@@ -2637,7 +2637,7 @@
(defvar ignored-local-variables
'(ignored-local-variables safe-local-variable-values
- file-local-variables-alist)
+ file-local-variables-alist dir-local-variables-alist)
"Variables to be ignored in a file's local variable spec.")
(defvar hack-local-variables-hook nil
@@ -2760,6 +2760,15 @@
if it is changed by the major or minor modes, or by the user.")
(make-variable-buffer-local 'file-local-variables-alist)
+(defvar dir-local-variables-alist nil
+ "Alist of directory-local variable settings in the current buffer.
+Each element in this list has the form (VAR . VALUE), where VAR
+is a directory-local variable (a symbol) and VALUE is the value
+specified in .dir-locals.el. The actual value in the buffer
+may differ from VALUE, if it is changed by the major or minor modes,
+or by the user.")
+(make-variable-buffer-local 'dir-local-variables-alist)
+
(defvar before-hack-local-variables-hook nil
"Normal hook run before setting file-local variables.
It is called after checking for unsafe/risky variables and
@@ -2969,6 +2978,9 @@
risky-vars dir-name))
(dolist (elt all-vars)
(unless (eq (car elt) 'eval)
+ (unless dir-name
+ (setq dir-local-variables-alist
+ (assq-delete-all (car elt) dir-local-variables-alist)))
(setq file-local-variables-alist
(assq-delete-all (car elt) file-local-variables-alist)))
(push elt file-local-variables-alist)))))
@@ -3364,12 +3376,10 @@
(nth 5 (file-attributes file)))
class-name)))
-(declare-function c-postprocess-file-styles "cc-mode" ())
-
(defun hack-dir-local-variables ()
"Read per-directory local variables for the current buffer.
-Store the directory-local variables in `file-local-variables-alist',
-without applying them."
+Store the directory-local variables in `dir-local-variables-alist'
+and `file-local-variables-alist', without applying them."
(when (and enable-local-variables
(buffer-file-name)
(not (file-remote-p (buffer-file-name))))
@@ -3389,6 +3399,11 @@
(dir-locals-collect-variables
(dir-locals-get-class-variables class) dir-name nil)))
(when variables
+ (dolist (elt variables)
+ (unless (eq (car elt) 'eval)
+ (setq dir-local-variables-alist
+ (assq-delete-all (car elt) dir-local-variables-alist)))
+ (push elt dir-local-variables-alist))
(hack-local-variables-filter variables dir-name)))))))