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

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

Re: what are some example case of files needing newline at end?


From: Chris F.A. Johnson
Subject: Re: what are some example case of files needing newline at end?
Date: Sat, 06 Dec 2008 18:39:11 +0000
User-agent: slrn/0.9.8.1 (Linux)

On 2008-12-06, Xah Lee wrote:
> what are some examples of files that requires a newline by itself at
> the end?
>
> Detail:
>
> recently i'm coding elisp to process a input file line by line. Each
> line is expected to have text.
> I ran into error at the last line because the file has a empty line,
> and i noticed that it is automatically added, due to mode-require-
> final-newline being true.

    I have never seen a blank line added. If there is no newline at
    the end of the file, one will be added. That is not a blank line.
    a blank line at the end would mean two newlines at the end of the
    file.

> So, i'm wondering, what kinda files actually require newline at the
> end? and if it is still so today?

    A final newline is required by many UNIX utilities. The POSIX
    definition of a text file is one that ends with a newline.


-- 
   Chris F.A. Johnson, author   |    <http://cfaj.freeshell.org>
   Shell Scripting Recipes:     |  My code in this post, if any,
   A Problem-Solution Approach  |         is released under the
   2005, Apress                 |    GNU General Public Licence


reply via email to

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