Function: project-switch-project

project-switch-project is an autoloaded, interactive and byte-compiled function defined in project.el.gz.

Signature

(project-switch-project DIR)

Documentation

"Switch" to another project by running an Emacs command.

The available commands are presented as a dispatch menu made from project-switch-commands.

When called in a program, it will use the project corresponding to directory DIR.

View in manual

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
;;;###autoload
(defun project-switch-project (dir)
  "\"Switch\" to another project by running an Emacs command.
The available commands are presented as a dispatch menu
made from `project-switch-commands'.

When called in a program, it will use the project corresponding
to directory DIR."
  (interactive (list (funcall project-prompter)))
  (project--remember-dir dir)
  (let ((command (if (symbolp project-switch-commands)
                     project-switch-commands
                   (project--switch-project-command)))
        (buffer (current-buffer)))
    (unwind-protect
        (progn
          (setq-local project-current-directory-override dir)
          (call-interactively command))
      (with-current-buffer buffer
        (kill-local-variable 'project-current-directory-override)))))