From: Dmitry Gutov Date: Mon, 13 Sep 2021 21:53:05 +0000 (+0300) Subject: Make sure to return some valid project root X-Git-Tag: emacs-28.0.90~993 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9000aeaed446a02aaf0684e02f40312b3a2e0b59;p=emacs.git Make sure to return some valid project root * lisp/progmodes/project.el (project-prompt-project-dir): If the user just pressed RET on prompt, prompt again. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ba95ed094ed..d034443907d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1308,7 +1308,10 @@ It's also possible to enter an arbitrary directory not in the list." ;; completion style). (project--file-completion-table (append project--list `(,dir-choice)))) - (pr-dir (completing-read "Select project: " choices nil t))) + (pr-dir "")) + (while (equal pr-dir "") + ;; If the user simply pressed RET, do this again until they don't. + (setq pr-dir (completing-read "Select project: " choices nil t))) (if (equal pr-dir dir-choice) (read-directory-name "Select directory: " default-directory nil t) pr-dir)))