[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-simulated-input 39dbadff0b 120/134: Update the README
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/with-simulated-input 39dbadff0b 120/134: Update the README to reflect current supported syntax |
Date: |
Mon, 10 Jan 2022 23:00:12 -0500 (EST) |
branch: elpa/with-simulated-input
commit 39dbadff0bc9827e423c4d40b480a934a71f4f98
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>
Update the README to reflect current supported syntax
---
README.md | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index f3f95e72ff..b0e9c6928c 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ For example:
```elisp
(with-simulated-input
"hello SPC world RET"
- (read-string "Say hello: "))
+ (read-string "Say hello to the world: "))
```
This would return the string `"hello world"`.
@@ -30,11 +30,16 @@ simulated interaction. For example, we can use Emacs Lisp
code to
enter "world" after entering "hello" via key sequence:
```elisp
-(with-simulated-input
- '("hello SPC" (insert "world") "RET")
- (read-string "Say hello: "))
+(let ((thing-to-greet "world"))
+ (with-simulated-input
+ ("hello SPC" (insert thing-to-greet) "RET")
+ (read-string "Say hello: ")))
```
+Note that the return values of any forms in the input list are
+ignored. Only the side effects matter. In this case, the side effect
+of `insert` is to insert "world" into the minibuffer.
+
## Simulating idleness
Some interactive functions rely on idle timers to do their work, so
@@ -47,15 +52,13 @@ will return `"hello world"`.
(run-with-idle-timer 500 nil 'insert "world")
(with-simulated-input
;; Type "hello ", then "wait" 501 seconds, then type "RET"
- '("hello SPC" (wsi-simulate-idle-time 501) "RET")
+ ("hello SPC" (wsi-simulate-idle-time 501) "RET")
(read-string "Enter a string: "))
```
Note that the example code above only *pretends* to be idle for 501
seconds. It actually runs immediately.
-Get it from MELPA: https://stable.melpa.org/#/with-simulated-input
-
## Running the tests
This package comes with a test suite. If you want to run it yourself,
- [nongnu] branch elpa/with-simulated-input created (now 0f43fe46d4), ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 568bfb8e1d 015/134: Version 2.0, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 5bdbde591d 058/134: Eliminate spurious warning in test file, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 433ee087ce 066/134: Test: handle `undercover' not being installed, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ea6735cf1b 083/134: KEYS: support a single variable, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input d32cbc3ac9 093/134: Revert "Remove interpolation test", ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 39dbadff0b 120/134: Update the README to reflect current supported syntax,
ELPA Syncer <=
- [nongnu] elpa/with-simulated-input e7a7a6c39d 109/134: Don't use "define-advice" in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 334f9f244f 119/134: Implement support for characters in KEYS, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 00209c2be3 128/134: Test on 27.2 instead of 27.1, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 1006e93000 125/134: Add more tests to improve coverage, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9c160b2d81 106/134: Add warnings for quoted list KEYS and nil/constant BODY, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 4eedb0eee8 126/134: Use an alternate method to disable eager macro-expansion for testing, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9d082a372a 113/134: Be more selective about which file changes trigger a CI run, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 681397b90d 130/134: Also test variables containing characters, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9ecf7c3f84 107/134: Improve code for detecting warnings in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ddd7bd71b1 011/134: Add "wsi-simulate-idle-time" and tests for it, ELPA Syncer, 2022/01/10