views:

261

answers:

2

I'm running ypsilon scheme using Emacs 23's scheme-mode. When I enter an expression in the interpreter, it adds an extra newline (see below). I've never seen this happen for any other interpreter. I know ypsilon isn't doing it, because it looks fine in shell-mode a shell (though shell-mode exhibits the same incorrect behavior). What function in scheme or comint mode might be adding this extra newline?

Looks like this:

> (+ 1 2)
3

> ;; extra newline above

Should be this:

> (+ 1 2)
3
> ;; no extra newline above
A: 

This is more of a workaround than anything else, but give SLIME a try. I've found that it handles input/output really nicely. You can find SLIME backends that support Scheme.

twopoint718
I use SLIME for Lisp, but it looks like SLIME only supports 2 Scheme implementations and it's a bit of work to add new backends.
projectshave
+2  A: 

I figured it out. comint-send-input has an optional no-newline parameter. I set this to true (don't insert another newline) by rebinding the Return key to a new function that wraps comint-send-input. Those extra newlines disappear. I don't know why they appear in the first place, though.

(defun comint-send-input-no-newline ()
  (interactive)
  (comint-send-input t nil))
projectshave