* lisp/progmodes/project.el (project-switch-project):
Avoid altering default-directory in the current buffer, even
temporarily (bug#58784).
(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