]> git.eshelyaron.com Git - emacs.git/commitdiff
New helper function project-read-project
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 16 Oct 2024 22:57:40 +0000 (01:57 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 17 Oct 2024 18:51:20 +0000 (20:51 +0200)
* lisp/progmodes/project.el (project-read-project): New helper.

(cherry picked from commit 561ab9829dd000a8078c6c66f7e8c29056adf31c)

lisp/progmodes/project.el

index 7c5de25f4a75df58d8aa6132c206773fc9f82450..15363c1db42d3e1093101645385571eca9b91760 100644 (file)
@@ -1968,6 +1968,12 @@ When PROMPT is non-nil, use it as the prompt string."
   (project--ensure-read-project-list)
   (mapcar #'car project--list))
 
+(defun project-read-project ()
+  "Read a project with completion from the known list.
+Returns an object that the API methods can be used with."
+  ;; Will prompt again if the entered directory is not a project anymore.
+  (project-current t (funcall project-prompter)))
+
 ;;;###autoload
 (defun project-execute-extended-command ()
   "Execute an extended command in project root."