branch: externals/consult commit ec93a8a787bc0420838e4f201a996958fa3b9557 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
consult--directory-prompt: Don't use initial input --- CHANGELOG.org | 5 +++++ consult.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 669e787ade..4a9a62df6b 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -2,6 +2,11 @@ #+author: Daniel Mendler #+language: en +* Development + +- ~consult--directory-prompt~: Use current directory as default, no initial input + such that multiple files or directories can be selected more easily. + * Version 2.4 (2025-05-21) - ~consult-register-store~: Add =M-b= action to store the buffer in a register. diff --git a/consult.el b/consult.el index 1fc74e3098..2c06eb4ad1 100644 --- a/consult.el +++ b/consult.el @@ -829,7 +829,6 @@ asked for the directories or files to search via ;; Preserve this-command across `completing-read-multiple' call, ;; such that `consult-customize' continues to work. (let ((this-command this-command) - (def (abbreviate-file-name default-directory)) ;; bug#75910: category instead of `minibuffer-completing-file-name' (minibuffer-completing-file-name t) (ignore-case read-file-name-completion-ignore-case)) @@ -837,9 +836,9 @@ asked for the directories or files to search via (lambda () (setq-local completion-ignore-case ignore-case) (set-syntax-table minibuffer-local-filename-syntax)) - (completing-read-multiple "Directories or files: " + (completing-read-multiple (format-prompt "Dirs or files" "./") #'completion-file-name-table - nil t def 'consult--path-history def)))) + nil t nil 'consult--path-history "")))) ((and `(,p) (guard (file-directory-p p))) p) (ps (setq paths (mapcar (lambda (p) (file-relative-name (expand-file-name p)))