Hiding ^M in emacs

后端 未结 12 821
陌清茗
陌清茗 2020-12-12 12:54

Sometimes I need to read log files that have ^M (control-M) in the line endings. I can do a global replace to get rid of them, but then something more is logged to the log

12条回答
  •  北海茫月
    2020-12-12 13:27

    Modern versions of emacs know how to handle both UNIX and DOS line endings, so when ^M shows up in the file, it means that there's a mixture of both in the file. When there is such a mixture, emacs defaults to UNIX mode, so the ^Ms are visible. The real fix is to fix the program creating the file so that it uses consistent line-endings.

提交回复
热议问题