I'd like all new files created by Emacs (28.0.50 prerelease on Win10) to have Unix-style (LF) line endings by default. I've had the following in my .emacs for a long time:

(prefer-coding-system 'utf-8)
(set-charset-priority 'unicode)
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))

While researching that, I did M-x describe-coding-system utf-8, and it says:

U -- utf-8 (alias: mule-utf-8 cp65001)

UTF-8 (no signature (BOM))
Type: utf-8 (UTF-8: Emacs internal multibyte form)
EOL type: Automatic selection from:
    [utf-8-unix utf-8-dos utf-8-mac]
This coding system encodes the following charsets:

So what does "Automatic selection" mean? How does it automatically select? (For new buffers of course -- existing buffers, it figures it out as always.) I've been using this default coding system for years, but often when I create a new buffer, it's in DOS mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.