help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: problem with require-final-newline


From: Alan Mackenzie
Subject: Re: problem with require-final-newline
Date: Fri, 14 May 2004 07:20:47 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Charles Jamieson <cjamieson@no.junk> 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").



reply via email to

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