我正在从我的服务器连接到一个 swank 服务器ClojureBox http://clojure.billhugh.com安装。 IE。lein swank
从我的项目目录然后M-x slime-connect
来自 EmacsW32。
然而,当我这样做时,我在 REPL 中到处都看到了 DOS 行结尾(^M
). I.e.
user> (doc map)
-------------------------^M
clojure.core/map^M
([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])^M
Returns a lazy sequence consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.^M
nil
user> (println "foo")
foo^M
我知道这与平台编码有关,但我无法弄清楚如何抑制它们。我在 EmacsW32 菜单中浏览并尝试了 java 命令行系统属性(在 lein.bat 中)-Dfile.encoding=ISO-8859-1
无济于事。
我还发现了有关在缓冲区内全局查找/替换 ^M 的其他问题 - 但我想过滤 REPL 输出。
我还注意到以下内容*inferior-lisp*
buffer:
(do (.. java.net.InetAddress getLocalHost getHostAddress) nil)(swank.swank/start-server "c:/Users/noahz/AppData/Local/Temp/slime.4912" :encoding "iso-latin-1-unix")
我的 .emacs 中有这个:
(defun hide-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 []))
我只是在需要时用 M-x hide-eol 来调用它。如果您愿意,您可以绑定一把钥匙,或者将其放在某种挂钩中。
功劳归功于未知的人 - 我从某个地方复制了这个功能,但我不记得在哪里。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)