From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada.Text_IO.Get_Line issue in windows Date: Wed, 03 Jun 2015 12:14:00 +0100 Organization: A noiseless patient Spider Message-ID: References: <556be876$0$2775$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="3bd306b9e9949526c2d1303d55d7ecbf"; logging-data="24741"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FYSW5VRALJo1afouxHtYdEfpL2dSpwLU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:rnFv09yu1wE66ZZoOa0PdKNqLIg= sha1:FHU65Fpur4XPz1C27dE917pnLyA= Xref: news.eternal-september.org comp.lang.ada:26158 Date: 2015-06-03T12:14:00+01:00 List-Id: Simon Clubley writes: > On 2015-06-03, Simon Wright wrote: >> It took me some time to realise that Emacs was automatically adding a >> linefeed to the end of the example file. > > That behaviour is adjustable in Emacs and the default with early > versions of Emacs was _not_ to add the line terminator to the final > record in the file. > > I have had the following line in my .emacs since the 1990s: > > (setq require-final-newline t) > > However, your comment above implies that the default has changed so I > don't know if that's now obsolete in the very latest Emacs versions. Looks as though text-mode (& message-mode?) set it to t (my global default is nil). C-h v: require-final-newline is a variable defined in `files.el'. Its value is t Original value was nil Local in buffer *unsent followup to Simon Clubley on comp.lang.ada*; global value is nil This variable is safe as a file local variable if its value satisfies the predicate `symbolp'. Documentation: Whether to add a newline automatically at the end of the file. A value of t means do this only when the file is about to be saved. A value of `visit' means do this right after the file is visited. A value of `visit-save' means do it at both of those times. Any other non-nil value means ask user whether to add a newline, when saving. A value of nil means don't add newlines. Certain major modes set this locally to the value obtained from `mode-require-final-newline'. You can customize this variable.