branch: externals/consult
commit cf9b877095d1b5524de8efc3b467dd4341ab97e8
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
consult--directory-prompt: Ensure that this-command is preserved (See #368)
---
consult.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/consult.el b/consult.el
index 7f32a55..5955092 100644
--- a/consult.el
+++ b/consult.el
@@ -711,7 +711,13 @@ Then the `consult-project-root-function' is tried.
Otherwise the `default-directory' is returned."
(cond
((stringp dir) (consult--directory-prompt-1 prompt dir))
- (dir (consult--directory-prompt-1 prompt (read-directory-name "Directory: "
nil nil t)))
+ (dir (consult--directory-prompt-1
+ prompt
+ ;; HACK Preserve this-command across `read-directory-name' call,
+ ;; such that `consult-customize' continues to work.
+ ;; TODO Find a better and more general solution which preserves
`this-command'.
+ (let ((this-command this-command))
+ (read-directory-name "Directory: " nil nil t))))
((when-let (root (consult--project-root))
(cons (format "%s in project %s: " prompt (consult--project-name root))
root)))