From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: problem with require-final-newline Date: Fri, 14 May 2004 07:20:47 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084545748 1136 80.91.224.253 (14 May 2004 14:42:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 May 2004 14:42:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 14 16:42:18 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOdtB-0002j5-00 for ; Fri, 14 May 2004 16:42:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOdjE-0000q7-Ia for geh-help-gnu-emacs@m.gmane.org; Fri, 14 May 2004 10:32:00 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn52feed!worldnet.att.net!208.48.142.85!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed.stueberl.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1084543811 6632 193.149.49.134 (14 May 2004 14:10:11 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 14 May 2004 14:10:11 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:123190 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18483 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18483 Charles Jamieson wrote on Thu, 13 May 2004 17:43:48 GMT: > I have the line > (setq-default require-final-newline t) > in my .emacs file. When I save a .txt file without a final newline, I > am asked whether to add a newline. When I enter C-h v > require-final-newline, I am informed this variable is set to query. > However, when I save a .cpp or.h file without a terminating new > line, the newline is silently added. In fact when I enter C-h v > require-final-newline, I am informed its value is set to t. CC Mode does this to help you. A C++ (etc) source file absolutely requires a final newline to be syntactically correct, I think. If for any reason you don't want this, you can set the (buffer local) value to nil or 'query in a hook function. > Why is this variable not being set consistently across file types? Different file types have different requirements, or lack thereof. > -charles -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a").