* 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).
(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)