From: Dmitry Gutov Date: Sat, 5 Mar 2022 02:28:31 +0000 (+0200) Subject: Drop project--value-in-dir X-Git-Tag: emacs-29.0.90~1502 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2389158a31b4a126a328146399fe7ef304c97fef;p=emacs.git Drop project--value-in-dir Drop the project--value-in-dir mechanics, where the user could edit the value in .dir-locals.el and have it applied instantly without reverting the current buffer. It made working in remote buffers with enable-remote-dir-locals non-nil slower, which doesn't seem worth it for a minor improvement of an infrequent operation. Also less compexity overall. * lisp/progmodes/project.el (project-try-vc, project-files) (project--vc-list-files, project-ignores, project-buffers): Use the user options directly. (project--vc-merge-submodules-p, project--value-in-dir): Delete functions. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0e08dae154b..71061e6139d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -460,7 +460,7 @@ backend implementation of `project-external-roots'.") (if (and ;; FIXME: Invalidate the cache when the value ;; of this variable changes. - (project--vc-merge-submodules-p root) + project-vc-merge-submodules (project--submodule-p root)) (let* ((parent (file-name-directory (directory-file-name root)))) @@ -512,7 +512,7 @@ backend implementation of `project-external-roots'.") (cl-defmethod project-files ((project (head vc)) &optional dirs) (mapcan (lambda (dir) - (let ((ignores (project--value-in-dir 'project-vc-ignores dir)) + (let ((ignores project-vc-ignores) backend) (if (and (file-equal-p dir (nth 2 project)) (setq backend (cadr project)) @@ -576,7 +576,7 @@ backend implementation of `project-external-roots'.") (split-string (apply #'vc-git--run-command-string nil "ls-files" args) "\0" t))) - (when (project--vc-merge-submodules-p default-directory) + (when project-vc-merge-submodules ;; Unfortunately, 'ls-files --recurse-submodules' conflicts with '-o'. (let* ((submodules (project--git-submodules)) (sub-files @@ -610,11 +610,6 @@ backend implementation of `project-external-roots'.") (lambda (s) (concat default-directory s)) (split-string (buffer-string) "\0" t))))))) -(defun project--vc-merge-submodules-p (dir) - (project--value-in-dir - 'project-vc-merge-submodules - dir)) - (defun project--git-submodules () ;; 'git submodule foreach' is much slower. (condition-case nil @@ -655,7 +650,7 @@ backend implementation of `project-external-roots'.") (condition-case nil (vc-call-backend backend 'ignore-completion-table root) (vc-not-supported () nil))))) - (project--value-in-dir 'project-vc-ignores root) + project-vc-ignores (mapcar (lambda (dir) (concat dir "/")) @@ -686,16 +681,9 @@ DIRS must contain directory names." ;; Sidestep the issue of expanded/abbreviated file names here. (cl-set-difference files dirs :test #'file-in-directory-p)) -(defun project--value-in-dir (var dir) - (with-temp-buffer - (setq default-directory dir) - (let ((enable-local-variables :all)) - (hack-dir-local-variables-non-file-buffer)) - (symbol-value var))) - (cl-defmethod project-buffers ((project (head vc))) (let* ((root (expand-file-name (file-name-as-directory (project-root project)))) - (modules (unless (or (project--vc-merge-submodules-p root) + (modules (unless (or project-vc-merge-submodules (project--submodule-p root)) (mapcar (lambda (m) (format "%s%s/" root m))