【问题标题】:^M Character showing in clojure slime-repl^M 字符显示在 clojure slime-repl
【发布时间】:2012-04-11 02:02:27
【问题描述】:

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

我认为这可能与Emacs showing ^M in a process buffer 相同,但我还没有尝试过修复。

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

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

【问题讨论】:

    标签: emacs clojure slime termination


    【解决方案1】:

    这个方法对我有用: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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-08
      相关资源
      最近更新 更多