Drop Silly ^M Line Endings in EMACS

Here’s a tip for when you notice you are editing a file with silly dos
^M endings in emacs. I know it doesn’t really matter, but I can’t
stand seeing the little (DOS) notice sitting in the mode line. So:

Just introduce a change to the file, like hit the spacebar and then
delete the space, or whatever. This way, emacs will want to write out
the file next time you save it. Then use this command:

C-x RET c utf-8-unix

… and when it prompts you for the command to run as utf-8-unix, ask
it to save the file: C-x C-s

Now you have a utf8-encoded file with unix line endings. Perfect!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.