Commit 2be537e6 authored by Stephen Leake's avatar Stephen Leake

Minor updates to project.el

* lisp/progmodes/project.el (project-find-file): Add optional 'filename' arg.
(project--completing-read-strict): Ignore 'default' set to empty string.
parent e4eb8c85
Pipeline #1737 failed with stage
in 80 minutes and 30 seconds
......@@ -443,14 +443,14 @@ pattern to search for."
(read-regexp "Find regexp" (and id (regexp-quote id)))))
(defun project-find-file ()
(defun project-find-file (&optional filename)
"Visit a file (with completion) in the current project's roots.
The completion default is the filename at point, if one is
(let* ((pr (project-current t))
(dirs (project-roots pr)))
(project-find-file-in (thing-at-point 'filename) dirs pr)))
(project-find-file-in (or filename (thing-at-point 'filename)) dirs pr)))
(defun project-or-external-find-file ()
......@@ -522,7 +522,7 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in
;; removing it when it has no matches. Neither seems natural
;; enough. Removal is confusing; early expansion makes the prompt
;; too long.
(let* ((new-prompt (if default
(let* ((new-prompt (if (and default (not (string-equal default "")))
(format "%s (default %s): " prompt default)
(format "%s: " prompt)))
(res (completing-read new-prompt
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment