Emacs: Change File Newline Format

By Xah Lee. Date: . Last updated: .

Change File Line Ending Between Windows, Linux, Mac

  1. Open the file
  2. Alt+x set-buffer-file-coding-system.

If you want utf-8 encoding, chose one of:

then save the file.

Which newline convention is used for the current file?

See the value in variable buffer-file-coding-system 〔see Emacs: Show Variable Value

Emacs Line Ending