[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-simulated-input a718d66c5d 039/134: Don't generate a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/with-simulated-input a718d66c5d 039/134: Don't generate a new canary for each call |
Date: |
Mon, 10 Jan 2022 23:00:03 -0500 (EST) |
branch: elpa/with-simulated-input
commit a718d66c5d45c7174554c321a56f97796925ffa8
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>
Don't generate a new canary for each call
A single canary value is sufficient for all calls to
"with-simulated-input".
---
with-simulated-input.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/with-simulated-input.el b/with-simulated-input.el
index a882084ef9..99c90aec45 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -121,6 +121,9 @@ environment."
`(closure ,env () ,expr)
`(lambda () ,expr)))
+(defconst wsi--canary-sym (cl-gensym "wsi-canary-")
+ "A unique symbol.")
+
;;;###autoload
(defmacro with-simulated-input (keys &rest body)
"Eval BODY forms with KEYS as simulated input.
@@ -160,15 +163,14 @@ in `progn'."
`(cl-letf*
((lexenv (wsi-current-lexical-environment))
(next-action-key (wsi-get-unbound-key))
- (canary-sym ',(cl-gensym "wsi-canary-"))
- (result canary-sym)
+ (result wsi--canary-sym)
(thrown-error nil)
(body-form
'(throw 'wsi-body-finished (progn ,@body)))
(end-of-actions-form
(list 'throw
'(quote wsi-body-finished)
- (list 'quote canary-sym)))
+ (list 'quote wsi--canary-sym)))
;; Ensure KEYS is a list, and put the body form as the first
;; item and `C-g' as the last item
(keylist ,keys)
@@ -233,7 +235,7 @@ in `progn'."
(throw 'wsi-threw-error nil)))
(when thrown-error
(signal (car thrown-error) (cdr thrown-error)))
- (if (eq result canary-sym)
+ (if (eq result wsi--canary-sym)
(error "Reached end of simulated input while evaluating body")
result)))
- [nongnu] elpa/with-simulated-input ad9eaf2252 014/134: Add info on idle simulation to README, (continued)
- [nongnu] elpa/with-simulated-input ad9eaf2252 014/134: Add info on idle simulation to README, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 4932368712 016/134: Add MELPA links, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 33b40e59a1 018/134: Fix indentation, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 004218b75c 023/134: Add more info to docstring for wsi-simulated-idle-time, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 395a985348 026/134: Use gensym to generate the canary symbol, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input e66a24d067 031/134: Add Makefile and code coverage, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 1012ccbec7 033/134: Convert defadvice to advice-add, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input d0f7795942 034/134: Update buttercup, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input af9a38ce28 036/134: Add LICENSE file, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 3b847dec31 037/134: Add tests for wsi-get-unbound-key, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input a718d66c5d 039/134: Don't generate a new canary for each call,
ELPA Syncer <=
- [nongnu] elpa/with-simulated-input e8738fe72c 040/134: Fix issue #4 and add a test for it, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 011183121d 042/134: Remove Emacs 26.3 from Travis config, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input d66b8b853f 041/134: Test in Emacs 26 on Travis, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 3d88179352 044/134: Version 2.4, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input b030953ca0 050/134: Fix a bug with actually-wait, and add tests for it, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input a71ecf18f7 051/134: Fix a bug in current-idle-time advice and add a test for it, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ea666ecab7 064/134: Remove hacky closure modification, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input cc15ccfe5a 062/134: Switch CI to Github Actions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input af15d1a1f5 068/134: Remove interpolation test, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 6ac56316df 074/134: Revert version change, ELPA Syncer, 2022/01/10