nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] RFC: was the removal of the automatic newline a good idea?


From: Benno Schulenberg
Subject: [Nano-devel] RFC: was the removal of the automatic newline a good idea?
Date: Tue, 2 Apr 2019 13:27:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi all,

Soon after the release of nano-4.0, we got this report:
  https://savannah.gnu.org/bugs/?55997

It says that POSIX defines a text file as a bunch of lines that each end
with a newline character, and that because of this definition there are
several Unix tools (not GNU ones) that fail to process the final line of
a file if it is not newline-terminated.

First, can anyone name a tool that skips the last, non-terminated line?
The poster of the report did not come up with any examples.

Second, I disagree that POSIX defines a text file as ending in a newline
character, because in its definitions [1] it says:

3.206 Line
A sequence of zero or more non-<newline> characters plus a terminating
<newline> character.

3.403 Text File
A file that contains characters organized into zero or more lines.

So, if I have some characters, say "foo", arranged into zero lines
(meaning that there is no newline character at the end), then it is
perfectly a text file.  No?

But third, even if there are no examples of misbehaving tools and "foo"
by itself is a fine POSIX text file, I am sometimes annoyed by the lack
of the automatic newline.  Because: often, for testing, I add something
at the end of ~/.nanorc, and often I want to add several similar lines,
so I type one row (without typing <Enter>) and then ^K and then several
^Us.  With the new lack of an automatic newline this results in the
concatenation of several copies of what I typed into a single line.
I find this annoying.

Of course, I could start to use 'set finalnewline' in may ~/.nanorc,
but if I have come to expect an automatic newline, surely there will
be other users who do so too.

Another example: if you start a new file, and type some text, and when
you're at the end of a row and reread what you wrote and see a typo and
go back and correct it, then, when you want to continue writing the text,
I would just type <Down> to go to the next row.  But without the automatic
newline, this does not work, you have to do <End> and <Enter> to get a new
line.  I find this annoying.

So...  Maybe we should make the magic newline the default again?

Or must the idea of not-modifying-the-file by default outweigh the
convenience of having always an empty line at end-of-file to go to?

Benno

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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