How to get suppress ^M characters in my ClojureBox (EmacsW32) REPL connected to lein swank

梦想与她 提交于 2019-12-06 04:04:38

I have this in my .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 []))

I just call it with M-x hide-eol when required. You could bind a key, or put it in a hook of some sort if you prefer.

Credit is due to persons unknown - I copied this function from somewhere, but I don't remember where.

C-x RET f then type unix-undecided or similar. Then save your file. Basically, you want to change the end-of-line convention for the file.

If this is not your file and you cannot save it, you can use M-% then type C-q C-m followed by RET and then just RET, to query-replace `C-M' with nothing.


Oops -- scratch all of that. I see now that you are not working with a file, but with REPL output. Dunno whether it will help, but maybe you can still use C-x RET f, but enter dos so you at least won't see the ^Ms. If that's not good enough, hopefully someone else will have an answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!