emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103414: More dir-locals fixes for fi


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103414: More dir-locals fixes for files.el.
Date: Thu, 24 Feb 2011 00:02:45 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103414
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2011-02-24 00:02:45 -0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-24 07:47:06 +0000
+++ b/lisp/ChangeLog    2011-02-24 08:02:45 +0000
@@ -1,5 +1,8 @@
 2011-02-24  Glenn Morris  <address@hidden>
 
+       * files.el (hack-dir-local-variables): Fix setting of `dir-name'.
+       (hack-local-variables-confirm, hack-local-variables-filter): Doc fix.
+
        * files.el (dir-locals-find-file): Doc fix.
        Fix the check for cache elements that have no associated file,
        and the mtime check for those that do.

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-02-24 07:47:06 +0000
+++ b/lisp/files.el     2011-02-24 08:02:45 +0000
@@ -2919,8 +2919,8 @@
 ALL-VARS is the list of all variables to be set up.
 UNSAFE-VARS is the list of those that aren't marked as safe or risky.
 RISKY-VARS is the list of those that are marked as risky.
-DIR-NAME is a directory name if these settings come from
-directory-local variables, or nil otherwise."
+If these settings come from directory-local variables, then
+DIR-NAME is the name of the associated directory.  Otherwise it is nil."
   (if noninteractive
       nil
     (save-window-excursion
@@ -3062,8 +3062,8 @@
  `enable-local-eval', `enable-local-variables', and (if necessary)
  user interaction.  The results are added to
  `file-local-variables-alist', without applying them.
-DIR-NAME is a directory name if these settings come from
- directory-local variables, or nil otherwise."
+If these settings come from directory-local variables, then
+DIR-NAME is the name of the associated directory.  Otherwise it is nil."
   ;; Find those variables that we may want to save to
   ;; `safe-local-variable-values'.
   (let (all-vars risky-vars unsafe-vars)
@@ -3547,11 +3547,8 @@
          (dir-name nil))
       (cond
        ((stringp variables-file)
-       ;; FIXME seems like the wrong dir-name.
-       (setq dir-name (if (buffer-file-name)
-                           (file-name-directory (buffer-file-name))
-                         default-directory))
-       (setq class (dir-locals-read-from-file variables-file)))
+       (setq dir-name (file-name-directory variables-file)
+             class (dir-locals-read-from-file variables-file)))
        ((consp variables-file)
        (setq dir-name (nth 0 variables-file))
        (setq class (nth 1 variables-file))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]