tech-userlevel archive

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

Re: fold(1) and "blank" and add lazy option

On Tue, Sep 22, 2009 at 06:43:18AM -0500, Jeremy C. Reed wrote:
 > fold(1) says:
 >  -s      Fold line after the last blank character within the first width
 >          column positions (or bytes). 
 > I plan to add to that -s description: "If a blank character does not 
 > exist within the width, then a longer line will still be split at 
 > the width."
 > It specifically says "blank". But code has:
 >           if (buf[i] == ' ')
 >                   last_space = i;
 > It doesn't use isblank. I may change the manual page to say "space" 
 > instead (since \t has a different purpose in fold). Anyways "-s" for 
 > *s*pace makes sense.

Is it supposed to be explicitly a space, or a blank character? It
doesn't necessarily follow that the code is right and the docs are

 > The -[0-9] arguments aren't documented in manual page nor in usage. Why? 
 > Historical, but planned to be removed to just use -w instead?

A number of programs have the historical behavior that -12345 is
interpreted as a number rather than as five specific flags. POSIX went
and deprecated all these in the name of petty consistency, but there
are lots of scripts and fingers out there that use them nonetheless.
Actually removing any of them will anger ~all oldtimers in range, so
we shouldn't, and shouldn't seriously be planning to either. I think
the best approach to these is to quietly remove them from man pages
and docs so new folks don't learn them, but document the situation in
the source.

(The most notable example is tail(1).)

 > p.s. I am looking for a LaTeX formatter, that can fold and possibly 
 > justify lines. It must know LaTeX, for example, if it folds a % comment, 
 > then it should add a % to continue the comment.

"emacs" :-)

David A. Holland

Home | Main Index | Thread Index | Old Index