branch: externals/consult
commit df465dfb01eb3a457b564b843f940fd9470fd4e8
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
consult--command-split: Use `split-string-shell-command' instead
---
consult.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/consult.el b/consult.el
index 244fe9da03..e3c1a487fc 100644
--- a/consult.el
+++ b/consult.el
@@ -673,8 +673,11 @@ Turn ARG into a list, and for each element either:
(let ((opts (when (string-match " +--\\( +\\|\\'\\)" str)
(prog1 (substring str (match-end 0))
(setq str (substring str 0 (match-beginning 0)))))))
- ;; split-string-and-unquote fails if the quotes are invalid. Ignore it.
- (cons str (and opts (ignore-errors (split-string-and-unquote opts)))))))
+ ;; Use `split-string-shell-command' here instead of
+ ;; `split-string-and-unquote' since it handles more flexible input -
+ ;; double quoted strings, single quoted strings and spaces escaped with
+ ;; backslash.
+ (cons str (and opts (split-string-shell-command opts))))))
(defmacro consult--keep! (list form)
"Evaluate FORM for every element of LIST and keep the non-nil results."