Skip to content

Instantly share code, notes, and snippets.

@jamescherti
Last active May 3, 2024 15:13
Show Gist options
  • Save jamescherti/bf74fb911d17583e7f4b57946f1ea775 to your computer and use it in GitHub Desktop.
Save jamescherti/bf74fb911d17583e7f4b57946f1ea775 to your computer and use it in GitHub Desktop.
Emacs: Switch to another project using (find-file)
;; Description:
;; Emacs: Switch to another project using (find-file)
;; Gits URL: https://gist.github.com/jamescherti/bf74fb911d17583e7f4b57946f1ea775
;; License: MIT
;; Author: James Cherti
(defun my-project-prompt-project-dir ()
"Prompt the user for a directory that is one of the known project roots."
(project--ensure-read-project-list)
(setq pr-dir (completing-read "Select project: " project--list nil t)))
(defun my-project-switch-project-find-file (dir)
"Switch to another project using (find-file)."
(interactive (list (my-project-prompt-project-dir)))
(find-file dir))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment