I am wondering if there is a way to temporarily not display the ^M characters in a file. I don't want to remove them I just want to not display them.
Cheers,
I use the following function (forgot where I found it):
(defun hide-ctrl-M ()
"Hides the disturbing '^M' showing up in files containing mixed UNIX and DOS line endings."
(interactive)
(setq buffer-display-table (make-display-table))
(aset buffer-display-table ?\^M []))
The GNU Emacs documentation describes how to handle Text Coding using revert-buffer-with-coding-system
:
C-x <RET> r coding <RET>
Revisit the current file using the coding system coding (revert-buffer-with-coding-system).
In your case if the correct system coding isn't detected automatically you can type:
C-x RET r dos RET
to avoid displaying the ^M
characters without actually modifying the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With