From the https://www.emacswiki.org/emacs/EndOfLineTips
You can reopen the file with the correct line ending with a command like M-x revert-buffer-with-coding-system utf-8-dos
. If your file is not in Unicode, be sure to specify the correct encoding system instead of utf-8-dos
Dos uses CR+LF
end of line, when UNIX uses only LF
. CR
sometimes looks like ^M
. For viewing ^M
you must use M-x revert-buffer-with-coding-system utf-8-unix
. This will use LF
as end of line and indicate CR
like ^M
instead of Dos which uses CR+LF
as end of line.
Disable autodetect: not sure it needs. If you want to convert files into UNIX format, then open DOS file and set line ending with M-x set-buffer-file-coding-system utf-8-unix
, this command will convert all CR+LF
into LF
.
If you can edit the file, you could open file with a certain coding system with -*- coding: utf-8-unix; -*-
at the first or second line in the file.
major-mode
and whatminor-modes
are active in the buffer -- i.e., typeM-x describe-mode
and update the question with said information. In addition, please consider including a screen-shot and/or some detailed description as to what is meant by "hides the extra codes". At first read, I thought perhaps this has to do with a simpleM-x fundamental-mode
to exit whatever major-mode exists; and, I thought about deleting entry from theauto-mode-alist
-- but now, I'm thinking just line endings dos/unix?^M
codes when opening dos-line-end file?