]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/files-x.el (connection-local-value): Fix Dired crash.
authorPo Lu <luangruo@yahoo.com>
Sun, 10 Dec 2023 14:05:09 +0000 (22:05 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 10 Dec 2023 14:05:51 +0000 (22:05 +0800)
lisp/files-x.el

index 467981f3f8f3e386eaf317e14d8ca68fbf483616..96d49427c81d0b45c8b36292ea43c21e15487f69 100644 (file)
@@ -935,8 +935,13 @@ value is the default binding of the variable."
   (unless (symbolp variable)
     (signal 'wrong-type-argument (list 'symbolp variable)))
   `(let (connection-local-variables-alist file-local-variables-alist)
-     (hack-connection-local-variables
-      (connection-local-criteria-for-default-directory ,application))
+     ;; This is a macro, so whether it is autoloaded doesn't influence
+     ;; whether its callers will induce the loading of files-x.el.
+     ;;
+     ;; Verify that h-c-l-v is autoloaded before calling it.
+     (when (fboundp 'hack-connection-local-variables)
+       (hack-connection-local-variables
+        (connection-local-criteria-for-default-directory ,application)))
      (if-let ((result (assq ',variable connection-local-variables-alist)))
          (cdr result)
        ,variable)))