[Toybox] fold implementation

Rob Landley rob at landley.net
Thu Apr 3 19:32:02 PDT 2014


On 04/03/14 19:29, Samuel Holland wrote:
> On Apr 3, 2014, at 5:56 PM, Rob Landley <rob at landley.net> wrote:
>> The -u option to fold isn't currently being used...
>>
>> Could you describe a little more how unfold would work?
> 
> Generally, I write papers and such in a text editor with hard wrapping, like nano, and then transfer them to LibreOffice for formatting. So I go from newline after X columns and a blank line between paragraphs to long lines with a single newline between paragraphs. The simplest algorithm would be to remove all newlines except double newlines (and convert those to single). If -s was specified, we would only remove newlines after spaces and tabs (or unless there was no space in that line). Finally, if -w was specified, we would re-wrap at that width.

*shrug* sounds good to me. I note that when we implement our toybox's
editor, it'll probably need something like this.

It's sad that with all the ascii characters devoted to this sort of
thing (10=linefeet, 11=vertical tab, 12 = form feed, 13 = carriage
return) we never had a darn "end paragraph" character.

The "textcraft" amiga word processor had a visible end paragraph
character (backwards P with some lines through it) in 1987. Should not
be rocket science, and yet...

Rob

 1396578722.0


More information about the Toybox mailing list