; Revise new command 'project-find-file-in-root'
* lisp/progmodes/project.el (project-find-file-in-root): Call 'find-file' directly, not via 'call-interactively'. Move interactive behavior to 'interactive' spec.
This commit is contained in:
parent
7d7aa65f63
commit
466db35877
1 changed files with 9 additions and 10 deletions
|
@ -1070,17 +1070,16 @@ using a command like `project-find-file'."
|
|||
filename))
|
||||
|
||||
;;;###autoload
|
||||
(defun project-find-file-in-root ()
|
||||
"Call `find-file' with the current project root as `default-directory'.
|
||||
(defun project-find-file-in-root (filename)
|
||||
"Edit file FILENAME.
|
||||
|
||||
Unlike `project-find-file', this doesn't provide completion over the
|
||||
entire file tree.
|
||||
|
||||
This is equivalent to running `project-any-command' with `find-file'."
|
||||
(interactive)
|
||||
(let* ((pr (project-current t))
|
||||
(default-directory (project-root pr)))
|
||||
(call-interactively #'find-file)))
|
||||
Interactively, prompt for FILENAME, defaulting to the root directory of
|
||||
the current project."
|
||||
(declare (interactive-only find-file))
|
||||
(interactive (list (read-file-name "Find file in root: "
|
||||
(project-root (project-current t)) nil
|
||||
(confirm-nonexistent-file-or-buffer))))
|
||||
(find-file filename t))
|
||||
|
||||
;;;###autoload
|
||||
(defun project-find-file (&optional include-all)
|
||||
|
|
Loading…
Add table
Reference in a new issue