]> git.eshelyaron.com Git - emacs.git/commitdiff
project-switch-project: Avoid altering default-directory in cb
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 1 Nov 2022 23:30:08 +0000 (01:30 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 1 Nov 2022 23:30:08 +0000 (01:30 +0200)
* lisp/progmodes/project.el (project-switch-project):
Avoid altering default-directory in the current buffer, even
temporarily (bug#58784).

lisp/progmodes/project.el

index ac278edd409623a3f33a46be52a6dfbc5e38eeda..0aa7955c65eda83c92dfeb15dc459b0727bde307 100644 (file)
@@ -1667,9 +1667,10 @@ to directory DIR."
   (let ((command (if (symbolp project-switch-commands)
                      project-switch-commands
                    (project--switch-project-command))))
-    (let ((default-directory dir)
-          (project-current-inhibit-prompt t))
-      (call-interactively command))))
+    (with-temp-buffer
+      (let ((default-directory dir)
+            (project-current-inhibit-prompt t))
+        (call-interactively command)))))
 
 (provide 'project)
 ;;; project.el ends here