This command lets you interactively remove an entry from the list of projects
in 'project-list-file'.
+*** 'project-find-file' now accepts non-existent file names (to
+facilitate creating a file inside some nested sub-directory easily).
+
+*** 'project-find-file' doesn't use the string at point as default
+input, now it's only suggested as part of "future history".
+
** xref
---
(defun project--completing-read-strict (prompt
collection &optional predicate
hist default)
- ;; Tried both expanding the default before showing the prompt, and
- ;; 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 (and default (not (string-equal default "")))
- (format "%s (default %s): " prompt default)
- (format "%s: " prompt)))
- (res (completing-read new-prompt
- collection predicate t
- nil ;; initial-input
- hist default)))
- (when (and (equal res default)
- (not (test-completion res collection predicate)))
- (setq res
- (completing-read (format "%s: " prompt)
- collection predicate t res hist nil)))
- res))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (setq-local minibuffer-default-add-function
+ (lambda ()
+ (let ((minibuffer-default default))
+ (minibuffer-default-add-completions)))))
+ (completing-read prompt
+ collection predicate 'confirm
+ nil
+ hist)))
;;;###autoload
(defun project-dired ()