]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/project.el: Don't run modes from .dir-locals.el.
authorJuri Linkov <juri@linkov.net>
Thu, 14 Mar 2024 17:37:44 +0000 (19:37 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Mar 2024 09:04:58 +0000 (10:04 +0100)
(project--value-in-dir): Use 'alist-get' on 'file-local-variables-alist'
to avoid calling 'hack-local-variables-apply' via
'hack-dir-local-variables-non-file-buffer' because it might enable
undesirable modes such as flyspell-mode in a temporary buffer (bug#69740).

(cherry picked from commit bd6b64e0a8856a735b484f0482af0e937eb585d3)

lisp/progmodes/project.el

index 40ad10457ca090e939048aea496ddaa4fa82d80a..b92d326fbf5a830e036aa16242e636e1aaba9d88 100644 (file)
@@ -803,8 +803,9 @@ DIRS must contain directory names."
   (with-temp-buffer
     (setq default-directory dir)
     (let ((enable-local-variables :all))
-      (hack-dir-local-variables-non-file-buffer))
-    (symbol-value var)))
+      (hack-dir-local-variables))
+    ;; Don't use `hack-local-variables-apply' to avoid setting modes.
+    (alist-get var file-local-variables-alist)))
 
 (cl-defmethod project-buffers ((project (head vc)))
   (let* ((root (expand-file-name (file-name-as-directory (project-root project))))