emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode adds newlines


From: Andries Brouwer
Subject: Re: cc-mode adds newlines
Date: Sun, 21 Nov 2004 12:45:00 +0100
User-agent: Mutt/1.4i

On Sun, Nov 21, 2004 at 12:06:24PM +0100, David Kastrup wrote:
> Andries Brouwer <address@hidden> writes:
> 
> > On Sat, Nov 20, 2004 at 03:14:24PM +0000, Alan Mackenzie wrote:
> >
> >> >It is not the goal of an editor to force the user to write syntactically
> >> >correct programs.
> >> 
> >> Well, that is debateable.  I'd tend to agree with you, whilst pointing
> >> out that in this case, there was no "force" used [see below].
> >> 
> >> An equally valid argument is that of the programmer who hacks through the
> >> night and sets off a build (which takes several hours to complete), goes
> >> home for some sleep, then comes back into the office the following
> >> afternoon.  He then finds that the build failed for lack of a final
> >> newline in one of the files.  Then he expostulates "FAQ!  Why couldn't
> >> that stupid editor have put that stupid newline in for me?".
> >
> > That is a phantasy argument.
> > Old compilers just accept the C source without final newline
> > without any complaint. Some newer pedantic ones print a warning.
> 
> I would not be surprised if there were compilers that just dropped the
> last character of a line read in, assuming it to be a linefeed.

That is a phantasy argument, and you know it.

But this is a completely irrevant side discussion.

It is not the case that emacs has the goal to force users
to only write syntactically correct programs -
and, as said, there is no guarantee at all that a file
with a name ending in .c is in fact a C99 program.

In fact there is no guarantee that it is a C program at all.
For example, I have old files where the .c extension means
that it was compressed using the "compact" utility.

Andries




reply via email to

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