1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

project-switch-project: Avoid altering default-directory in cb

* lisp/progmodes/project.el (project-switch-project):
Avoid altering default-directory in the current buffer, even
temporarily (bug#58784).
This commit is contained in:
Dmitry Gutov 2022-11-02 01:30:08 +02:00
parent 0f5bf1dbb9
commit 835295381b

View 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