Closed alhassy closed 3 years ago
I don't think this has anything to do with buffer switching. When I run these pieces of code, I get the error "Reached end of simulated input while evaluating body", which is the expected result because your input doesn't include RET at the end, so the function never returns. The following works fine and returns "HELLO"
:
(with-temp-buffer
(insert "hello")
(mark-whole-buffer)
(with-simulated-input
"upcase RET"
(what-do))
(buffer-string))
Thanks for pointing that out; however, your code, with the RET
, fails for me with the same error.
I'm using
with-simulated-input
Version: 2.4; Package-Version: 20200509.2010It looks like you posted an empty code block. For me, adding RET to the input sequence of either of the code examples above fixes them.
There hasn't been a reply on this for over a year, so I'm closing it. If it's still a problem, feel free to provide additional information and reopen it.
I expected the following test to show a string containing the word
hello
enclosed in asrc
block taggedemacs-lisp
, but instead it errors out.In case the error is something to do with
org-babel-demarcate-block
, I've also tried with a home-backed functionwhat-do
and we obtain the same error.This is related to issue #4.
The tests show that the following should pass:
But I could not get this to work for my uses cases above.
Since this issue of buffers has arisen multiple times, #4 and #11, it would seem prudent to document how to use
with-simulated-input
with different buffers in the README.