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

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

[nongnu] elpa/with-simulated-input 0a1b0dea0a 101/134: Clean up with-sim


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input 0a1b0dea0a 101/134: Clean up with-simulated-input-1
Date: Mon, 10 Jan 2022 23:00:09 -0500 (EST)

branch: elpa/with-simulated-input
commit 0a1b0dea0ae92961992e4534118ef42629199447
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>

    Clean up with-simulated-input-1
    
    There are no code changes, only reformatting and renaming of variables
    to match my coding style.
---
 with-simulated-input.el | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/with-simulated-input.el b/with-simulated-input.el
index 794f7d6a9a..0649d744a8 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -106,37 +106,39 @@ to check."
 KEYS is a keylist as can be passed to that function (except that
 only a list is allowed, and forms must be functions) and MAIN is
 the body form as a function."
-  (let* ((unbound-key (wsi-get-unbound-key))
+  (let* ((next-action-key (wsi-get-unbound-key))
          ;; Ensure we don't interfere with any outside catching.
-         (result-sym (make-symbol "result"))
-         (error-sym (make-symbol "error"))
+         (result-sym (make-symbol "with-simulated-input-result"))
+         (error-sym (make-symbol "with-simulated-input-error"))
          (orig-buf (current-buffer))
-         (actions (nconc (list (lambda ()
-                                 (switch-to-buffer orig-buf)
-                                 (throw result-sym (funcall main))))
-                         (cl-remove-if-not #'functionp keys)
-                         (list (lambda ()
-                                 (error "Reached end of simulated input while 
evaluating body")))))
+         (actions
+          (nconc
+           (list (lambda ()
+                   (switch-to-buffer orig-buf)
+                   (throw result-sym (funcall main))))
+           (cl-remove-if-not #'functionp keys)
+           (list (lambda ()
+                   (error "Reached end of simulated input while evaluating 
body")))))
          (overriding-terminal-local-map
           (if overriding-terminal-local-map
               (copy-keymap overriding-terminal-local-map)
             (make-sparse-keymap))))
-    (define-key overriding-terminal-local-map (kbd unbound-key)
+    (define-key overriding-terminal-local-map (kbd next-action-key)
       (lambda ()
         (interactive)
         (condition-case data
             (funcall (pop actions))
           (error (throw error-sym data)))))
     (catch result-sym
-      ;; Signals are not passed trough `read-from-minibuffer'.
+      ;; Signals are not passed through `read-from-minibuffer'.
       (let ((err (catch error-sym
                    (execute-kbd-macro
                     (kbd (mapconcat
                           #'identity
-                          (nconc (list unbound-key)
+                          (nconc (list next-action-key)
                                  (cl-loop for key in keys collect
-                                          (if (stringp key) key unbound-key))
-                                 (list unbound-key))
+                                          (if (stringp key) key 
next-action-key))
+                                 (list next-action-key))
                           " "))))))
         (signal (car err) (cdr err))))))
 



reply via email to

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