branch: elpa/with-simulated-input
commit 0d5e910f19657ab376f72e5848be50d13d3b8e50
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>

    Add an error message for unhandled case
    
    with-simulated-input currently doesn't work from byte-compiled code.
    With this commit, it still doesn't work, but now it should produce a
    germane error message.
    
    See #6.
---
 with-simulated-input.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/with-simulated-input.el b/with-simulated-input.el
index 0f344f1675..a70e7eb523 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -111,6 +111,8 @@ extracting and returning its lexical environment.
 This can be used to manually construct closures in that
 environment."
   `(let ((temp-closure (lambda () t)))
+     (unless (listp temp-closure)
+       (error "Cannot capture lexical environment from byte-compiled code"))
      (when (eq (car temp-closure) 'closure)
        (cadr temp-closure))))
 

Reply via email to