Closed tgbugs closed 3 years ago
comint-send-region
is effectively copying from the source buffer and pasting into the REPL buffer.
In a Racket Mode REPL, typing:
> (require syntax/to-string)
> (syntax->string #'(foo bar baz))
"foobarbaz"
This seems to be because the TCP input port for the Racket Mode REPL has not had port-count-lines!
called on it. Therefore things like syntax-column
are #f
. Quick glance, syntax->string
uses syntax->column
.
Possibly this broke when doing "The Big Switcheroo", and the REPL input port changed from stdin to TCP.
I'll push a commit to add port-count-lines!
.
Thanks again for reporting!
Merged.
If you get Racket Mode from MELPA, it might take a couple hours for that to refresh.
You'll want to wait until it says the version is > 20210211.0000
.
As usual be sure to do a package-refresh-contents
in Emacs before updating.
Confirming working on my end now. Thanks!
Reopening because while looking at #556 I realized that commit 7f12cb1 regressed this.
It seems that something strange is going on with an interaction between
comint-send-region
andsyntax->string
inside ofracket-send-last-sexp
. When I runracket-run-module-at-point
with the cursor intest-py
everything works as expected, but when I runracket-send-last-sexp
where indicated below, all of the spaces in the input are removed, apparently during the call to#:with block-source (datum->syntax #'(body ...) (syntax->string #'(body ...)))
because the syntax object looks like it is correct and has spaces. I'm not entirely sure this is aracket-mode
issue, but it manifests as one.Given that the call toThis was because I had compiled the file first, if the file is not compiled then thepretty-print
only triggers forracket-send-last-sexp
I'm wondering if this has to do with the fact that there is some compilation phase that is missing inracket-send-last-sexp
that is handled correctly when compiling a whole file?pretty-print
fires in both cases.Results Ok.
Error.