GNU bug report logs -
#19140
dir-locals-collect-variables discrepancy in handling non-file buffers
Previous Next
Reported by: Ivan Shmakov <ivan <at> siamics.net>
Date: Fri, 21 Nov 2014 16:14:02 UTC
Severity: minor
Tags: patch
Fixed in version 25.1
Done: Ivan Shmakov <ivan <at> siamics.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Please consider the revised patch MIMEd.
* lisp/files.el (dir-locals-collect-variables): Use
default-directory in place of the file name while working on
non-file buffers (as hack-dir-local-variables already does.)
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
--- a/lisp/files.el
+++ b/lisp/files.el 2014-12-28 19:20:59+00:00
@@ -3628,7 +3628,9 @@ defun dir-locals-collect-variables (class-variables root variables)
"Collect entries from CLASS-VARIABLES into VARIABLES.
ROOT is the root directory of the project.
Return the new variables list."
- (let* ((file-name (buffer-file-name))
+ (let* ((file-name (or (buffer-file-name)
+ ;; handle non-file buffers, too
+ (expand-file-name default-directory)))
(sub-file-name (if file-name
;; FIXME: Why not use file-relative-name?
(substring file-name (length root)))))
This bug report was last modified 10 years and 100 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.