Commit e000ff30 authored by Ivan Shmakov's avatar Ivan Shmakov
Browse files

Fix dir-locals handling for non-file buffers.

* lisp/files.el (dir-locals-collect-variables): Use default-directory
in place of the file name while working on non-file buffers, just
like hack-dir-local-variables already does.

Fixes: debbugs:19140
parent 3e824b05
......@@ -6,6 +6,10 @@
* files.el (find-file-other-window, find-file-other-frame):
Use mapc instead of mapcar. (Bug#18175)
* files.el (dir-locals-collect-variables): Use default-directory
in place of the file name while working on non-file buffers, just
like hack-dir-local-variables already does. (Bug#19140)
2015-01-17 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/eieio-core.el (eieio--class-constructor): Rename from
......
......@@ -3602,7 +3602,9 @@ Returns the new list."
"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)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment