^ M字符显示在clojure slime-repl

Son*_*oth 5 emacs termination clojure slime

(println...)我的代码中的每一个都导致在REPL中出现终止的^ M字符.我lein swank在一个单独的窗口中运行,我通过连接M-x slime-connect

我认为这可能与Emacs在进程缓冲区中显示^ M的问题相同,但我还没有尝试过该修复程序.

我已经尝试将行尾样式改为unix/dos/mac,并遵循我在网上找到的其他一些处方,但我认为其中大部分与实际替换文件中的^ M有关.或者在缓冲区中,或写一些我认为可能有点过分的elisp.这真的应该是某个地方的复选框,如果不是字面上至少在概念上.

我在Win7 x64上使用Emacs 24 + clojure模式+ slime + swank.

小智 5

这种方法对我有用:https://stackoverflow.com/a/750933

基本上只需将此代码添加到.emacs:

(defun remove-dos-eol ()
  "Do not show ^M in files containing mixed UNIX and DOS line endings."
  (interactive)
  (setq buffer-display-table (make-display-table))
  (aset buffer-display-table ?\^M []))

(add-hook 'slime-repl-mode-hook 'remove-dos-eol) ;Remove ^M from clojure repl in windows
Run Code Online (Sandbox Code Playgroud)