From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: cc-mode adds newlines Date: Mon, 22 Nov 2004 09:07:20 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1101132721 20463 80.91.229.6 (22 Nov 2004 14:12:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Nov 2004 14:12:01 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Andries.Brouwer@cwi.nl, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 22 15:11:52 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 1CWEv1-0007kU-00 for ; Mon, 22 Nov 2004 15:11:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWF44-00066x-Vq for ged-emacs-devel@m.gmane.org; Mon, 22 Nov 2004 09:21:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CWF1r-0005VB-Nr for emacs-devel@gnu.org; Mon, 22 Nov 2004 09:18:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CWF1p-0005Ub-Nj for emacs-devel@gnu.org; Mon, 22 Nov 2004 09:18:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CWF1p-0005Sj-Ej for emacs-devel@gnu.org; Mon, 22 Nov 2004 09:18:53 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CWEsM-0008QW-8g for emacs-devel@gnu.org; Mon, 22 Nov 2004 09:09:06 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CWEqe-00007e-8F; Mon, 22 Nov 2004 09:07:20 -0500 Original-To: Alan Mackenzie In-reply-to: (message from Alan Mackenzie on Sun, 21 Nov 2004 11:41:34 +0000 (GMT)) 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:30245 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30245 Somebody, sometime, wanted or needed the final newline inserted automatically. We know someone thought this should be done. Was that someone's thought based on an actual need, or was someone assigning too much importance to the ANSI C standard? The term "valid" is defined by a language definition, not by the behavior of a particular implementation. The C standard doesn't decide what is valid or not. It is just a guide that helps us decide what is useful or not. That is why many of the unhelpful warning requirements of ANSI C are implemented only with --pedantic, and we recommend that people not use --pedantic. The C standard "requires" these warnings, but it has no authority over us. I think that in the long run something more transparent for mode-specific defaults should be found. I think we should add a variable require-final-newline-modes which would be a list of mode names. run-mode-hook could see if the current mode is in require-final-newline-modes, and if so, set require-final-newline to require-final-newline-mode-value. The default for require-final-newline-mode-value would be :ask, but if a user sets it to t, then all the appriate modes would set require-final-newline to t.