emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2be537e: Minor updates to project.el


From: Stephen Leake
Subject: [Emacs-diffs] master 2be537e: Minor updates to project.el
Date: Sun, 19 May 2019 13:29:02 -0400 (EDT)

branch: master
commit 2be537e6433b9b2a8d9dcb9c23493755d35d6ecc
Author: Stephen Leake <address@hidden>
Commit: Stephen Leake <address@hidden>

    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.
---
 lisp/progmodes/project.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index cc45a71..e44cee2 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -443,14 +443,14 @@ pattern to search for."
     (read-regexp "Find regexp" (and id (regexp-quote id)))))
 
 ;;;###autoload
-(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
 recognized."
   (interactive)
   (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)))
 
 ;;;###autoload
 (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]