nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] RFC: nano's justifications are poorer than those of Pico --


From: Benno Schulenberg
Subject: [Nano-devel] RFC: nano's justifications are poorer than those of Pico -- okay to improve?
Date: Fri, 18 May 2018 10:56:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Hi all,

Nano claims to copy Pico's behavior, but... it turns out that for
justifications this is far from true.  1) nano doesn't treat indented
paragraphs by default the same as Pico.  2) nano misjudges paragraphs
when the starting line has less instead of more indentation than the
rest.  3) nano could do better than Pico in that case.

To illustrate: make your terminals 60 columns wide and run 'pico NEWS'
in one and 'nano --ignore NEWS' in another, then type ^J a few times
in each.  Note that Pico treats each block of text as two paragraphs:
the first line as one paragraph, and the rest as one paragraph.  But
see that nano treats each and every line as a separate paragraph.
Poor!  Only when you add --autoindent on the command line, will nano
act like Pico.

1) I think nano should recognize indented paragraphs also when
--autoindent is not given.  Okay to change?

Now remove the blank lines from the NEWS file (sed -i /^$/d NEWS) and
do the same exercise again: run 'pico NEWS' and 'nano --ignore --auto
NEWS' and type ^J a few times.  Pico still behaves the same as before,
treating each actual paragraph as two paragraphs.  But nano makes a
mess: it thinks that the unindented line of the second paragraph is
the last line of the first paragraph and rewraps the whole with *zero*
indentation.

2) Nano should do the same as Pico in this case: the indentation of a
paragraph may not change after its second line.  Okay to change?

Now use the "nice editor" instead: 'ne NEWS', and type M-P a few times.
It treats an unindented line plus all subsequent indented lines as a
single paragraph.  *That* is how justification should work: the first
line of a paragraph may have any indentation; the indentation of the
second line may differ; and all subsequent lines must have the same
indentation as the second line.  (Exit from ne with ^Q Y.)

3) I think nano should be improved to treat paragraphs like ne does.
Okay to change?


(For the original reports see https://savannah.gnu.org/bugs/?53933
and https://savannah.gnu.org/bugs/?53932.)

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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