[Top][All Lists]

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

Re: cc-mode adds newlines

From: Richard Stallman
Subject: Re: cc-mode adds newlines
Date: Mon, 22 Nov 2004 09:07:20 -0500

    Somebody, sometime, wanted or needed the final newline inserted

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

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.

reply via email to

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