diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2016-01-30 16:14:52 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2016-01-30 19:54:41 +0000 |
commit | 71b20b31c8ee25bcd0de1a954c9ca7b49140b3b2 (patch) | |
tree | 687f518360ec65ff3d03639a33589720913d729c /lisp/files-x.el | |
parent | ae26c8a7a46ffa6266a4efce592827cf47e85170 (diff) | |
download | emacs-71b20b31c8ee25bcd0de1a954c9ca7b49140b3b2.tar.gz |
Backport: * lisp/files.el: Remove support for extra .dir-locals file
(dir-locals-file-2, dir-locals--all-files): Remove.
(dir-locals-collect-variables, dir-locals-file, dir-locals-find-file)
(dir-locals-read-from-file, hack-dir-local-variables): Revert changes.
* lisp/files-x.el (modify-dir-local-variable): Revert changes.
* lisp/help-fns.el (describe-variable): Revert changes.
* doc/emacs/custom.texi (Directory Variables): Revert changes.
* etc/NEWS: Revert changes.
Diffstat (limited to 'lisp/files-x.el')
-rw-r--r-- | lisp/files-x.el | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el index 05ad7f57c57..f0102fd83af 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -429,24 +429,18 @@ from the MODE alist ignoring the input argument VALUE." (catch 'exit (unless enable-local-variables (throw 'exit (message "Directory-local variables are disabled"))) - (let* ((dir-or-cache (and (buffer-file-name) - (not (file-remote-p (buffer-file-name))) - (dir-locals-find-file (buffer-file-name)))) - (variables-file - ;; If there are several .dir-locals, the user probably - ;; wants to edit the last one (the highest priority). - (cond ((stringp dir-or-cache) - (car (last (dir-locals--all-files dir-or-cache)))) - ((consp dir-or-cache) ; result from cache - ;; If cache element has an mtime, assume it came - ;; from a file. Otherwise, assume it was set - ;; directly. - (if (nth 2 dir-or-cache) - (car (last (dir-locals--all-files (car dir-or-cache)))) - (cadr dir-or-cache))) - ;; Try to make a proper file-name. - (t (expand-file-name dir-locals-file)))) - variables) + (let ((variables-file (or (and (buffer-file-name) + (not (file-remote-p (buffer-file-name))) + (dir-locals-find-file (buffer-file-name))) + dir-locals-file)) + variables) + (if (consp variables-file) ; result from cache + ;; If cache element has an mtime, assume it came from a file. + ;; Otherwise, assume it was set directly. + (setq variables-file (if (nth 2 variables-file) + (expand-file-name dir-locals-file + (car variables-file)) + (cadr variables-file)))) ;; I can't be bothered to handle this case right now. ;; Dir locals were set directly from a class. You need to ;; directly modify the class in dir-locals-class-alist. |