为什么Emac的方案模式中有额外的换行符?

时间:2009-06-18 02:24:14

标签: emacs scheme elisp emacs23

我正在使用Emacs 23的方案模式运行ypsilon方案。当我在解释器中输入表达式时,它会添加一个额外的换行符(见下文)。我从来没有见过这种情况发生在任何其他翻译上。我知道ypsilon没有这样做,因为它在 shell-mode shell中看起来很好(尽管shell模式表现出相同的错误行为)。方案或comint模式中的哪些功能可能会添加此额外的换行符?

看起来像这样:

> (+ 1 2)
3

> ;; extra newline above

应该是这样的:

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

2 个答案:

答案 0 :(得分:3)

我明白了。 comint-send-input有一个可选的no-newline参数。我通过将Return键重新绑定到包含comint-send-input的新函数,将其设置为true(不插入另一个换行符)。那些额外的新行消失了。不过,我不知道他们为什么出现在第一位。

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

答案 1 :(得分:0)

这更像是一种解决方法,但尝试SLIME。我发现它很好地处理输入/输出。您可以找到支持Scheme的SLIME后端。