]> git.eshelyaron.com Git - emacs.git/commitdiff
Only override the current project buffer-locally
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 1 Nov 2023 02:01:53 +0000 (04:01 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Wed, 1 Nov 2023 02:01:53 +0000 (04:01 +0200)
* lisp/progmodes/project.el (project-switch-project): Only
override the current project buffer-locally.  This is mostly for
the the mode-line indicator (https://debbugs.gnu.org/66317#53).

lisp/progmodes/project.el

index 76c5144b4848c577a94d1beb57e3d6519fe82af3..5129dc98b82a26ce1623bd3d6496e79881add21b 100644 (file)
@@ -2030,8 +2030,11 @@ to directory DIR."
   (let ((command (if (symbolp project-switch-commands)
                      project-switch-commands
                    (project--switch-project-command))))
-    (let ((project-current-directory-override dir))
-      (call-interactively command))))
+    (unwind-protect
+        (progn
+          (setq-local project-current-directory-override dir)
+          (call-interactively command))
+      (kill-local-variable 'project-current-directory-override))))
 
 ;;;###autoload
 (defun project-uniquify-dirname-transform (dirname)