]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp error in project-find-file
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 27 Dec 2023 00:20:39 +0000 (02:20 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Wed, 27 Dec 2023 00:20:39 +0000 (02:20 +0200)
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Avoid new Tramp connections (bug#68041).

lisp/progmodes/project.el

index 0082f12666a0d81e95ec284cf3b79f5621253259..79bb3173d3d2106da6b17f8afbeaa050c183f02e 100644 (file)
@@ -1147,14 +1147,15 @@ by the user at will."
          (new-collection (project--file-completion-table substrings))
          (abs-cpd (expand-file-name common-parent-directory))
          (abs-cpd-length (length abs-cpd))
-         (relname (cl-letf (((symbol-value hist)
-                             (mapcan
-                              (lambda (s)
-                                (setq s (expand-file-name s))
-                                (and (string-prefix-p abs-cpd s)
-                                     (not (eq abs-cpd-length (length s)))
-                                     (list (substring s abs-cpd-length))))
-                              (symbol-value hist))))
+         (relname (cl-letf* ((non-essential t) ;Avoid new Tramp connections.
+                             ((symbol-value hist)
+                              (mapcan
+                               (lambda (s)
+                                 (setq s (expand-file-name s))
+                                 (and (string-prefix-p abs-cpd s)
+                                      (not (eq abs-cpd-length (length s)))
+                                      (list (substring s abs-cpd-length))))
+                               (symbol-value hist))))
                     (project--completing-read-strict prompt
                                                      new-collection
                                                      predicate