(@pxref{Dired}) listing the files in the current project's root
directory.
+@findex project-vc-dir
+ The command @code{project-vc-dir} opens a VC Directory buffer
+(@pxref{VC Directory Mode}) listing the version control statuses of
+the files in a directory tree under the current project's
+root directory.
+
+@findex project-shell
+ The command @code{project-shell} starts a shell session
+(@pxref{Shell}) in a new buffer with the current project's root as the
+working directory.
+
@findex project-eshell
The command @code{project-eshell} starts an Eshell session in a new
buffer with the current project's root as the working directory.
all commands that prompt for a project directory.
+++
-*** New commands 'project-dired' and 'project-eshell'.
-These commands run Dired and Eshell in a project's root directory,
+*** New commands 'project-dired', 'project-vc-dir', 'project-shell', 'project-eshell'.
+These commands run Dired/VC-Dir and Shell/Eshell in a project's root directory,
respectively.
+++
(interactive)
(dired (project-root (project-current t))))
+;;;###autoload
+(defun project-vc-dir ()
+ "Open VC-Dir in the current project."
+ (interactive)
+ (vc-dir (project-root (project-current t))))
+
+;;;###autoload
+(defun project-shell ()
+ "Open Shell in the current project."
+ (interactive)
+ (let ((default-directory (project-root (project-current t))))
+ ;; Use ‘create-file-buffer’ to uniquify shell buffer names.
+ (shell (create-file-buffer "*shell*"))))
+
;;;###autoload
(defun project-eshell ()
"Open Eshell in the current project."
from to (project-files (project-current t)) 'default)
(fileloop-continue))
+(defvar compilation-read-command)
+(declare-function compilation-read-command "compile")
+
;;;###autoload
-(defun project-compile ()
- "Run `compile' in the project root."
- (interactive)
+(defun project-compile (command &optional comint)
+ "Run `compile' in the project root.
+Arguments the same as in `compile'."
+ (interactive
+ (list
+ (let ((command (eval compile-command)))
+ (if (or compilation-read-command current-prefix-arg)
+ (compilation-read-command command)
+ command))
+ (consp current-prefix-arg)))
(let* ((pr (project-current t))
(default-directory (project-root pr)))
- (call-interactively 'compile)))
+ (compile command comint)))
\f
;;; Project list
;;;###autoload
(defvar project-switch-commands
'(("f" "Find file" project-find-file)
- ("s" "Find regexp" project-find-regexp)
+ ("r" "Find regexp" project-find-regexp)
("d" "Dired" project-dired)
+ ("v" "VC-Dir" project-vc-dir)
+ ("s" "Shell" project-shell)
("e" "Eshell" project-eshell))
"Alist mapping keys to project switching menu entries.
Used by `project-switch-project' to construct a dispatch menu of