[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Force Windows line endings

From: Stephen Leake
Subject: Re: [h-e-w] Force Windows line endings
Date: Wed, 22 Feb 2006 09:40:47 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

"Ryan Bowman" <address@hidden> writes:

> I run Emacs ( on Windows XP.  When I open a file emacs
> detects if the file contains unix or windows line endings and uses the
> appropriate.  


> When I create a new file it uses Unix line endings. 

You must have:

(setq default-buffer-file-coding-system 'unix)

or something equivalent in your .emacs.

Try it with "emacs -q" to verify.

> I would like emacs to always use dos line endings (because everyone
> else I work with uses Eclipse on Windows). I now know I can use C-x
> RET c dos RET C-x C-f to open a file in dos mode, but that's fairly
> lengthy to perform everytime I need to open a new file. I wanted to
> write a simple function that called
> (universal-coding-system-argument "dos") then called (find-file) but
> universal-coding-system-argument seems geared toward interactive
> calls. What is a good way to collect the above commands into one?

If you only want _new_ files to use DOS line endings, use

(setq default-buffer-file-coding-system 'dos)

If you want to automatically convert existing files to DOS line
endings, that's a different story.

-- Stephe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]