From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andries Brouwer Newsgroups: gmane.emacs.devel Subject: Re: cc-mode adds newlines Date: Sun, 21 Nov 2004 12:45:00 +0100 Message-ID: <20041121114500.GD20436@apps.cwi.nl> References: <20041119231343.GA19603@apps.cwi.nl> <20041121020850.GA20436@apps.cwi.nl> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101037564 21891 80.91.229.6 (21 Nov 2004 11:46:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Nov 2004 11:46:04 +0000 (UTC) Cc: Jari Aalto , Alan Mackenzie , Andries Brouwer , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 21 12:45:57 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CVqAH-0002vy-00 for ; Sun, 21 Nov 2004 12:45:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVqJG-0001Z1-Mi for ged-emacs-devel@m.gmane.org; Sun, 21 Nov 2004 06:55:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CVqIq-0001Yv-Vm for emacs-devel@gnu.org; Sun, 21 Nov 2004 06:54:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CVqIq-0001Yj-DV for emacs-devel@gnu.org; Sun, 21 Nov 2004 06:54:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVqIp-0001Yg-KD for emacs-devel@gnu.org; Sun, 21 Nov 2004 06:54:47 -0500 Original-Received: from [192.16.191.8] (helo=hera.cwi.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CVq9P-0001Kg-13; Sun, 21 Nov 2004 06:45:03 -0500 Original-Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id iALBj0xh014250 for ; Sun, 21 Nov 2004 12:45:00 +0100 (MET) Original-Received: (from aeb@localhost) by apps.cwi.nl (8.11.7p1+Sun/8.12.2) id iALBj0Q06160; Sun, 21 Nov 2004 12:45:00 +0100 (MET) Original-To: David Kastrup Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30149 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30149 On Sun, Nov 21, 2004 at 12:06:24PM +0100, David Kastrup wrote: > Andries Brouwer 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