From 71b20b31c8ee25bcd0de1a954c9ca7b49140b3b2 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 30 Jan 2016 16:14:52 +0000 Subject: 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. --- lisp/help-fns.el | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'lisp/help-fns.el') diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 2021885e996..547bc7ee63a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -911,35 +911,29 @@ if it is given a local binding.\n")))) (buffer-file-name buffer))) (dir-locals-find-file (buffer-file-name buffer)))) - (is-directory nil)) + (dir-file t)) (princ (substitute-command-keys " This variable's value is directory-local")) - (when (consp file) ; result from cache - ;; If the cache element has an mtime, we - ;; assume it came from a file. - (if (nth 2 file) - ;; (car file) is a directory. - (setq file (dir-locals--all-files (car file))) - ;; Otherwise, assume it was set directly. - (setq file (car file) - is-directory t))) - (if (null file) - (princ ".\n") - (princ ", set ") - (princ (substitute-command-keys - (cond - (is-directory "for the directory\n `") - ;; Many files matched. - ((and (consp file) (cdr file)) - (setq file (file-name-directory (car file))) - (format "by one of the\n %s files in the directory\n `" - dir-locals-file)) - (t (setq file (car file)) - "by the file\n `")))) + (if (null file) + (princ ".\n") + (princ ", set ") + (if (consp file) ; result from cache + ;; If the cache element has an mtime, we + ;; assume it came from a file. + (if (nth 2 file) + (setq file (expand-file-name + dir-locals-file (car file))) + ;; Otherwise, assume it was set directly. + (setq file (car file) + dir-file nil))) + (princ (substitute-command-keys + (if dir-file + "by the file\n `" + "for the directory\n `"))) (with-current-buffer standard-output (insert-text-button file 'type 'help-dir-local-var-def - 'help-args (list variable file))) + 'help-args (list variable file))) (princ (substitute-command-keys "'.\n")))) (princ (substitute-command-keys " This variable's value is file-local.\n")))) -- cgit v1.2.1