emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/with-simulated-input abe9c855a8 075/134: `with-simulated-i


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input abe9c855a8 075/134: `with-simulated-input' support `list' KEYS
Date: Mon, 10 Jan 2022 23:00:06 -0500 (EST)

branch: elpa/with-simulated-input
commit abe9c855a811d9cc61b977b4349be273942fe0ae
Author: Nikita Bloshchanevich <nikblos@outlook.com>
Commit: Nikita Bloshchanevich <nikblos@outlook.com>

    `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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]