diff options
| author | Stephen Leake | 2019-05-19 10:28:46 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-05-19 10:28:46 -0700 |
| commit | 2be537e6433b9b2a8d9dcb9c23493755d35d6ecc (patch) | |
| tree | b7ca668055ab7f3d3fed44c4cdfa3f6da94e8d37 /lisp | |
| parent | e4eb8c850145248c1f3c4235cdd8d11b1c05bb1e (diff) | |
| download | emacs-2be537e6433b9b2a8d9dcb9c23493755d35d6ecc.tar.gz emacs-2be537e6433b9b2a8d9dcb9c23493755d35d6ecc.zip | |
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/project.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index cc45a71f576..e44cee2133f 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -443,14 +443,14 @@ pattern to search for." | |||
| 443 | (read-regexp "Find regexp" (and id (regexp-quote id))))) | 443 | (read-regexp "Find regexp" (and id (regexp-quote id))))) |
| 444 | 444 | ||
| 445 | ;;;###autoload | 445 | ;;;###autoload |
| 446 | (defun project-find-file () | 446 | (defun project-find-file (&optional filename) |
| 447 | "Visit a file (with completion) in the current project's roots. | 447 | "Visit a file (with completion) in the current project's roots. |
| 448 | The completion default is the filename at point, if one is | 448 | The completion default is the filename at point, if one is |
| 449 | recognized." | 449 | recognized." |
| 450 | (interactive) | 450 | (interactive) |
| 451 | (let* ((pr (project-current t)) | 451 | (let* ((pr (project-current t)) |
| 452 | (dirs (project-roots pr))) | 452 | (dirs (project-roots pr))) |
| 453 | (project-find-file-in (thing-at-point 'filename) dirs pr))) | 453 | (project-find-file-in (or filename (thing-at-point 'filename)) dirs pr))) |
| 454 | 454 | ||
| 455 | ;;;###autoload | 455 | ;;;###autoload |
| 456 | (defun project-or-external-find-file () | 456 | (defun project-or-external-find-file () |
| @@ -522,7 +522,7 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in | |||
| 522 | ;; removing it when it has no matches. Neither seems natural | 522 | ;; removing it when it has no matches. Neither seems natural |
| 523 | ;; enough. Removal is confusing; early expansion makes the prompt | 523 | ;; enough. Removal is confusing; early expansion makes the prompt |
| 524 | ;; too long. | 524 | ;; too long. |
| 525 | (let* ((new-prompt (if default | 525 | (let* ((new-prompt (if (and default (not (string-equal default ""))) |
| 526 | (format "%s (default %s): " prompt default) | 526 | (format "%s (default %s): " prompt default) |
| 527 | (format "%s: " prompt))) | 527 | (format "%s: " prompt))) |
| 528 | (res (completing-read new-prompt | 528 | (res (completing-read new-prompt |