From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hallvard B Furuseth Newsgroups: gmane.emacs.bugs Subject: Re: cc-mode adds newlines Date: Mon, 22 Nov 2004 20:37:14 +0100 Organization: University of Oslo, Norway Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101152281 17349 80.91.229.6 (22 Nov 2004 19:38:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Nov 2004 19:38:01 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 22 20:37:54 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 1CWK0Y-0004r8-00 for ; Mon, 22 Nov 2004 20:37:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWK9Y-00061z-VQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Nov 2004 14:47:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CWK9X-00061u-IJ for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2004 14:47:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CWK9X-00061i-4b for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2004 14:47:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWK9X-00061f-0a for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2004 14:47:11 -0500 Original-Received: from [193.4.58.12] (helo=horus.isnic.is) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CWK05-0004jD-4w for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2004 14:37:25 -0500 Original-Received: from pat.uio.no (IDENT:7411@pat.uio.no [129.240.130.16]) by horus.isnic.is (8.12.9p2/8.12.9/isnic) with ESMTP id iAMJbLuC074397 for ; Mon, 22 Nov 2004 19:37:22 GMT (envelope-from news@readme.uio.no) Original-Received: from mail-mx6.uio.no ([129.240.10.47]) by pat.uio.no with esmtp (Exim 4.34) id 1CWJzy-0006m6-VA for gnu-emacs-bug@moderators.isc.org; Mon, 22 Nov 2004 20:37:19 +0100 Original-Received: from readme.uio.no ([129.240.148.41]) by smtp.uio.no with esmtp (Exim 4.34) id 1CWJzv-0000CK-O7 for gnu-emacs-bug@moderators.isc.org; Mon, 22 Nov 2004 20:37:15 +0100 Original-Received: from news by readme.uio.no with local (Exim 2.12 #7) id 1CWJzv-0001T1-00 for gnu-emacs-bug@moderators.isc.org; Mon, 22 Nov 2004 20:37:15 +0100 Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 38 Original-NNTP-Posting-Host: bombur2.uio.no Original-X-Trace: readme.uio.no 1101152234 5641 129.240.186.24 (22 Nov 2004 19:37:14 GMT) Original-X-Complaints-To: abuse@uio.no Original-NNTP-Posting-Date: Mon, 22 Nov 2004 19:37:14 +0000 (UTC) Cancel-Lock: sha1:qlr+vtErI8KEikjQuSyG3cu/494= X-MailScanner-Information: This message has been scanned for viruses/spam. Contact postmaster@uio.no if you have questions about this scanning X-UiO-MailScanner: No virus found X-UiO-Spam-info: not spam, SpamAssassin (score=-5, required 12, UIO_MAIL_IS_INTERNAL -5.00) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:9785 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9785 Stefan Monnier writes: >> The C standard requires a newline. > > Where? C99 5.1.1.2 Translation phases: 2. Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. (...) A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character before any such splicing takes place. Phase 2 in C89 had similar text. >> Regardless of standards, there are tools out there which do not behave >> properly if a file does not end in a newline. > > Yup. A good reason to set require-final-newlnie to `ask'. One of the good things about Emacs compared to other "user-friendly" things out there was once that one didn't have to tell it "yes, I really mean that and you really don't know better than me" all the time. >> And finally, I have a very hard time imagining a situation where it's >> important to _NOT_ have a final newline in a text file, especially >> a C source file > > Come on, that's easy. Think of the usual "proof by diagonalization". > I.e. one such situation is when you want to find out if the tool > misbehaves in the absence of a final newline. Or, like I said, if it's a file name which ends with .c or .h but is not a C source file. Filename extension collisions do happen at times. -- Hallvard