From: Dmitry Gutov Date: Wed, 1 Nov 2023 02:01:53 +0000 (+0200) Subject: Only override the current project buffer-locally X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ffe894d0f358b94999e642b5167a3e43de7e0bc7;p=emacs.git Only override the current project buffer-locally * 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). --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 76c5144b484..5129dc98b82 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -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)