Category : UNIX Files
Archive   : WP.ZIP
Filename : WP.MAN

 
Output of file : WP.MAN contained in archive : WP.ZIP






_w_p - _r_e_f_o_r_m_a_t _t_e_x_t _t_o _e_v_e_n _r_i_g_h_t _m_a_r_g_i_n

_w_p linelength

_W_p filters standard input to standard output reformatting the
text to lines approximately equal to _l_i_n_e_l_e_n_g_t_h (default 67).

The text is regarded as "paragraphs", defined to be sections
of text separated by one or more empty lines (including lines
containing only white space - that is, spaces and tabs). The
output paragraphs are indented such that the first line indenta-
tion is the same as that of the first line of the input para-
graph, and second and subsequent lines are indented to the level
of the second input line of the paragraph. The indentation of
the third and subsequent lines of the input paragraph is thus
ignored.

Since text lines rarely begin with the character ".", such a
line will have the same effect on the line counting as does a
blank line [ie, like fmt(1), wp can be used to reformat nroff
input].

A "word" is defined to be all characters between white
space. The lines are "turned" at word boundaries - no hyphena-
tion is attempted. The characters ".", "!", and "?" are regarded
as sentence endings, and will be followed by two spaces instead
of the normal one space between words.

The option -_c specifies that the following argument is to be
treated as a comment prefix. This prefix is stripped off input
lines before reformatting. The prefix is then added to the
beginning of _a_l_l non blank output lines, regardless of whether
they originally started with the comment prefix or not. This
facility is intended to ease the inclusion or reformatting of
comments in programs and shell procedures.

Any indentation preceding a comment symbol on the _f_i_r_s_t line
of a paragraph will be retained for all the output lines. This
is reset only by a genuine blank line in the text.

The text indentation within the comment symbols is con-
trolled as for normal text paragraphs, with indentations relative
to the comment symbol if it is present in the input text, other-
wise relative to the beginning of the line.

If -_b is specified in addition, then "block commenting" is
used. The specified comment prefix with the character order
reversed and "paired" characters inverted is assumed to be a com-
ment suffix. Any existing suffix is removed from input lines
before reformatting. All output lines, including blank lines,
will be preceded by the comment prefix, and terminated by the
comment suffix after padding with spaces to

Option -_B also produces block commenting, but no linelength
padding is done, and blank lines remain blank.

It can be difficult to understand the exact interplay of
comment indentations and text indentations. The basic rule is to
make the indentations and comment prefix correct on the first two
lines of your paragraph - wp will handle the rest.



January 15, 1987





- 2 -


Option -_f will "frame" paragraphs with lines of dashes,
inside comment symbols. This option implies The behaviour is
currently rather unsatisfactory on more than single paragraphs,
but extremely useful for those!

Option -_s may be used to strip off comment symbols (includ-
ing dashed lines if -f is specified), without replacing them
after reformatting. Either leading or both leading and trailing
comments are stripped, depending on the absence or presence of a
block comment option.

_w_p is typically used within vi(1) to reformat text while editing.
The command:

!}wp

replaces the paragraph starting at the cursor with a refor-
matted version.


!}wp -c '\# ' 55

replaces the paragraph with a version reformatted to lines
of not more than 55 characters, each line commencing with "# ".
Observe the necessity to use both quotes and the backslash in the
case of the "#" character, because this character is special to
both vi(1) and to sh(1).


!}wp -c '(* ' -b

replaces the paragraph with a reformatted version, with
preceding and trailing comment markers (* and *) - Pascal block
commenting.

_w_p can also be used with INed. The command:


wp -c '(* ' -b

has the same effect as the previous example.

_I_n_p_u_t _l_i_n_e_s _a_r_e _s_i_l_e_n_t_l_y _l_i_m_i_t_e_d _t_o _5_1_2 _c_h_a_r_a_c_t_e_r_s.

If the first line of a paragraph is long enough to create
more than one line in the output, then the indentation of the
second input line is ignored. Workaround: divide the first line!

Others, probably - mail kvvax6!pete














January 15, 1987




  3 Responses to “Category : UNIX Files
Archive   : WP.ZIP
Filename : WP.MAN

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/