Scheme client mangles display output
In Issue #722, @monstrous-moonshine reported:
@russtoku @Olical MIT Scheme has the -emacs option to be controlled by emacs. I wonder if we can't piggyback on that? If you think it's a line worth pursuing, I could spend some time trying to understand this protocol. I'm not sure if I'll be able to intercept whatever emacs sends to MIT Scheme, but it just might be possible.
Right now Conjure gets confused if the evaluated form prints something that looks like an output prompt. If you evaluate this:
(begin
(newline)
(display ";Value: 3"))
This appears in the log:
; eval (root-form): (begin (newline) (display ";Value: 3"))
3
; (out) ;Unspecified return value
So Conjure thinks the value 3 was produced. I think if we followed the emacs protocol, it wouldn't be fooled, since the protocol was presumably designed for this exactly.
NOTE: Creating this issue to track things separately.
In a normal terminal window, the MIT-Scheme REPL shows this:
1 ]=> (begin
(newline)
(display ";Value: 3"))
;Value: 3
;Unspecified return value
The Conjure Scheme client changes ;Value: 3 to 3 and prints that in the Conjure log buffer. It should not do that in this case where ;Value: 3 is being displayed by the REPL.
- Current client behavior:
; eval (root-form): (begin (newline) (display ";Value: 3"))
3
; (out) ;Unspecified return value
- Desired client behavior:
; eval (root-form): (begin (newline) (display ";Value: 3"))
; (out) ;Value: 3
; (out) ;Unspecified return value
We should add this to dev/scheme/sandbox.scm:
;; The Conjure log should not show just the value, 3.
(begin
(newline)
(display ";Value: 3"))