tech-userlevel archive

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

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



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.

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?

I was thinking of adding a lazy option so when using -s it won't still 
split at width if there is no space up to the width. So some 
output lines may be longer than width when using the option.

  Jeremy C. Reed

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.


Home | Main Index | Thread Index | Old Index