[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e000ff3 3/6: Fix dir-locals handling for non-file b
From: |
Ivan Shmakov |
Subject: |
[Emacs-diffs] master e000ff3 3/6: Fix dir-locals handling for non-file buffers. |
Date: |
Sat, 17 Jan 2015 20:04:26 +0000 |
branch: master
commit e000ff30b4354064ca7f9ed07e58903d7c44033f
Author: Ivan Shmakov <address@hidden>
Commit: Ivan Shmakov <address@hidden>
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
---
lisp/ChangeLog | 4 ++++
lisp/files.el | 4 +++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f5ad8de..55c7a36 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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 <address@hidden>
* emacs-lisp/eieio-core.el (eieio--class-constructor): Rename from
diff --git a/lisp/files.el b/lisp/files.el
index e6d80a9..e9632ed 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)))))
- [Emacs-diffs] master updated (ca80ebc -> 0aaa5d6), Ivan Shmakov, 2015/01/17
- [Emacs-diffs] master e000ff3 3/6: Fix dir-locals handling for non-file buffers.,
Ivan Shmakov <=
- [Emacs-diffs] master 3e824b0 2/6: Avoid mapcar in two cases in files.el., Ivan Shmakov, 2015/01/17
- [Emacs-diffs] master 22441b6 1/6: Ignore print-length and print-level while formatting url-cookie data., Ivan Shmakov, 2015/01/17
- [Emacs-diffs] master e391d88 5/6: Do not clear the session when trying to read a non-existent desktop file., Ivan Shmakov, 2015/01/17
- [Emacs-diffs] master 1728544 4/6: Fix: inhibit point motion hooks when encoding an enriched document., Ivan Shmakov, 2015/01/17
- [Emacs-diffs] master 0aaa5d6 6/6: Unloading support for misearch., Ivan Shmakov, 2015/01/17