Converting line ends for dos to unix and viceversa in Emacs

Dos (windows) to unix:

  • meta-style:
    M-x set-buffer-file-coding-system RET undecided-unix
  • control-style:
    C-x RET f undecided-unix

Unix to dos (windows):

  • meta-style:
    M-x set-buffer-file-coding-system RET undecided-dos
  • control-style:
    C-x RET f undecided-dos

This is more a memo to self than a public utility post, because every time I need to do this conversion I don’t remember the command and I have to google for it. From now on I will skip the google step ;)