Skip to content
April 3, 2007 / edivad

emacs, convert dos to unix and vice versa

If in emacs you need a different file coding system (line terminator), for example you are on a windows system and need to type a unix like text file (or vice versa), you can easily convert the buffer coding system.

Dos to unix

M-x set-buffer-file-coding-system RET undecided-unix
save the file (C-x C-s)

or

C-x RET f undecided-unix
C-x C-f

Unix to dos

M-x set-buffer-file-coding-system RET undecided-dos
save the file (C-x C-s)

or

C-x RET f undecided-dos
C-x C-f

4 Comments

Leave a Comment
  1. Jeremy / Aug 13 2007 3:58 am

    Worked here on an already saved file in Windows.

  2. George Eckel / Nov 21 2008 5:25 am

    Thanks – handy-dandy, came right up on google, – fixed my (DOS) in gnu emacs !!

Trackbacks

  1. Emacs: unix coding in windows « /home/edivad
  2. always useful: http://tinyurl.com/56l4ro (#emacs #eol) — biotweets.org

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.