-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lexical let-binding no scope of let variables in subsequent deferred async tasks #54
Comments
Hey! I faced a similar situation. Here is a workaround: (let ((a (point)))
(deferred:$
(deferred:wait 1000)
(deferred:nextc it
`(lambda (x)
(goto-char ,a)
(insert "here!"))))) The trick is that |
Thanks! I got stuck here too. Never thought of using a quoted expression @p3r7 |
This got me in something I was working on! A function would behave differently if I evaluated the |
I followed the example in the documentation related to lexical binding:
(let ((a (point)))
(deferred:$
(deferred:wait 1000)
(deferred:nextc it
(lambda (x)
(goto-char a)
(insert "here!")))))
In Emacs 26.1 I did a evaluation on region with above code and I got an error like:
deferred error : (void-variable a)
The text was updated successfully, but these errors were encountered: