Skip site navigation (1)Skip section navigation (2)
Date:      27 Apr 2000 10:05:52 -0400
From:      Lowell Gilbert <lowell@world.std.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Convert DOS -> Unix text
Message-ID:  <rd6ya5zprjz.fsf@world.std.com>
In-Reply-To: djkanter@nwu.edu's message of 27 Apr 2000 01:00:58 %2B0200
References:  <20000426175651.A92365@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
djkanter@nwu.edu (David J. Kanter) writes:

> I use two flavors of Emacs: one on DOS, one on BSD. The BSD version
> complains when compiling my c++ programs because DOS uses a different kind
> of carriage return than Unix. The warning I get is:
> 
> warning: carriage return in preprocessing directive
> 
> How can I convert DOS text into BSD text? I looked at convert, but that
> seems to be for images only.

If you want emacs to do the conversion for you, set the coding system
for the buffer.  There are different ways to do this; I think most
people set file-coding-system-alist to handle this, but you might find
buffer-file-coding-system more convenient.

The idea is to make sure that emacs is always storing text in Unix
format, regardless of which platform you're on.

As a really ugly hack, you could just start a comment at the end of
your preprocessor lines.  Doesn't allow multi-line macros, of course...

Be well.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?rd6ya5zprjz.fsf>