[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-simulated-input 4e918757ae 111/134: Implement warning
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/with-simulated-input 4e918757ae 111/134: Implement warnings for no-op KEYS inside a variable value |
Date: |
Mon, 10 Jan 2022 23:00:10 -0500 (EST) |
branch: elpa/with-simulated-input
commit 4e918757ae34c9f2443de743d5194afb57e9b019
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>
Implement warnings for no-op KEYS inside a variable value
---
with-simulated-input.el | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/with-simulated-input.el b/with-simulated-input.el
index 187c9ff369..48b9f8de0c 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -227,12 +227,29 @@ in `progn'."
(lambda ()
,@body)
,keys))
- ((listp ,keys)
+ ((consp ,keys)
+ (display-warning
+ 'with-simulated-input
+ "Passing a variable with a list value as KEYS is deprecated and will
not be supported in future releases.")
(apply
#'with-simulated-input-1
(lambda ()
,@body)
- (cl-loop for key in ,keys collect (if (stringp key) key `(lambda ()
,key)))))
+ (cl-loop
+ for key in ,keys
+ if (stringp key) collect key
+ ;; It is occasionally useful to include nil as an element of
+ ;; KEYS, so we don't produce a warning for it.
+ else if (null key) do (ignore)
+ else if (hack-one-local-variable-constantp key) do
+ (display-warning
+ 'with-simulated-input-1
+ "Non-string forms in KEYS are evaluated for side effects only.
Non-string constants in KEYS have no effect.")
+ else if (symbolp key) do
+ (display-warning
+ 'with-simulated-input-1
+ "Non-string forms in KEYS are evaluated for side effects only.
Variables in KEYS have no effect.")
+ else collect `(lambda () ,key))))
(t
(error "KEYS must be a string or list, not %s: %s = %S"
(type-of ,keys) ',keys ,keys))))
@@ -253,7 +270,7 @@ in `progn'."
(prog1 (setq ,evaluated-keys-sym x)
(display-warning
'with-simulated-input
- "Passing KEYS as a quoted list is deprecated and will not be
supported in future releases.")))
+ "Passing a quoted list as KEYS is deprecated and will not be
supported in future releases.")))
((guard (not (listp ,evaluated-keys-sym))) (cl-callf list
,evaluated-keys-sym)))
(apply
#'with-simulated-input-1
@@ -283,7 +300,7 @@ in `progn'."
(prog1 (setq keys x)
(display-warning
'with-simulated-input
- "Passing KEYS as a quoted list is deprecated and will not be
supported in future releases.")))
+ "Passing a quoted list as KEYS is deprecated and will not be
supported in future releases.")))
((guard (not (listp keys))) (cl-callf list keys)))
`(with-simulated-input-1
(lambda ()
- [nongnu] elpa/with-simulated-input c8389984e6 088/134: Update Eldev file, (continued)
- [nongnu] elpa/with-simulated-input c8389984e6 088/134: Update Eldev file, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 15581a4459 076/134: (symbol ...) KEYS are now function-call strings, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 38454eae74 086/134: Improve test coverage for wsi-get-unbound-key, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 82f8bada42 077/134: Fix tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 37047a2073 090/134: Add tests for loading and unloading, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 2f40b160f5 096/134: Re-enable test for byte-compiled code, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 3525ed7dc5 095/134: Merge branch 'bleeding-edge' into rewrite-bleed, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 8f335ad321 108/134: Implement warnings for inputs that have no effect, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 8b4d44c3aa 104/134: Clean up wording in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ee4d2b75fd 133/134: Version 3.0, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 4e918757ae 111/134: Implement warnings for no-op KEYS inside a variable value,
ELPA Syncer <=
- [nongnu] elpa/with-simulated-input addb2a0711 122/134: Improve KEYS validation logic and error messages, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 0f43fe46d4 134/134: Add CI status badge to README, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 235a93f0fc 060/134: Add test for run-time evaluation of KEYS, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 5f0bc054b5 069/134: Better error propagation, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input abe9c855a8 075/134: `with-simulated-input' support `list' KEYS, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 1f48107e92 081/134: Add nbfalcon as Author, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 5713495a1c 067/134: Refactor: `with-simulated-input' function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 2a4866984a 080/134: No longer handle variables specially in KEYS, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 6c2e0ece2d 084/134: Use #' for advice-add/-remove, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 582844da4c 085/134: Add a failing test for byte-compiled closures, ELPA Syncer, 2022/01/10