]> git.eshelyaron.com Git - emacs.git/commitdiff
(dir-locals-collect-variables): Avoid spurious safety warnings
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Mar 2024 17:44:38 +0000 (12:44 -0500)
committerEshel Yaron <me@eshelyaron.com>
Mon, 11 Mar 2024 09:21:53 +0000 (10:21 +0100)
* lisp/files.el (dir-locals-collect-variables): Silence warnings for
extra parents' variables.

(cherry picked from commit 454a55dbd963d4b07c0dc0f6d540cc5fd4b4faa7)

lisp/files.el

index 02c9241541429a45d192bf5b7f766abf9d3ac878..4dd591574f88c197e3cbce7f2ed02b5de4ae1cc9 100644 (file)
@@ -4469,6 +4469,12 @@ to see whether it should be considered."
                   (funcall predicate key)
                 (or (not key)
                     (derived-mode-p key)))
+              ;; If KEY is an extra parent it may remain not loaded
+              ;; (hence with some of its mode-specific vars missing their
+              ;; `safe-local-variable' property), leading to spurious
+              ;; prompts about unsafe vars (bug#68246).
+              (if (and (symbolp key) (autoloadp (indirect-function key)))
+                  (ignore-errors (autoload-do-load (indirect-function key))))
               (let* ((alist (cdr entry))
                      (subdirs (assq 'subdirs alist)))
                 (if (or (not subdirs)