branch: elpa/with-simulated-input
commit abe9c855a811d9cc61b977b4349be273942fe0ae
Author: Nikita Bloshchanevich <[email protected]>
Commit: Nikita Bloshchanevich <[email protected]>
`with-simulated-input' support `list' KEYS
(list KEYS...) is like '(KEYS...), except that forms must be quoted as well.
---
with-simulated-input.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/with-simulated-input.el b/with-simulated-input.el
index 30a5fcb977..03ae246429 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -173,12 +173,19 @@ are propagated normally.
The return value is the last form in BODY, as if it was wrapped
in `progn'."
(declare (indent 1) (debug ([&or ("quote" (&rest &or stringp def-form))
+ ("list" [&rest &or stringp ("quote"
def-form)])
(&rest &or stringp def-form)
stringp]
def-body)))
(pcase keys
(`(quote ,x) (setq keys x))
- ((guard (not (listp keys))) (cl-callf list keys)))
+ ((guard (not (listp keys))) (cl-callf list keys))
+ ((guard (eq 'list (car keys)))
+ (cl-loop for key in (cdr keys) collect
+ (pcase key
+ (`(quote ,x) x)
+ (_ key))
+ into new-keys finally do (setq keys new-keys))))
`(with-simulated-input--1
(lambda ()
,@body)