[Toybox] fold implementation

Samuel Holland samuel at sholland.net
Thu Apr 3 17:29:52 PDT 2014


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.

> Rob

Regards,
Samuel Holland <samuel at sholland.net>


 1396571392.0


More information about the Toybox mailing list