home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / par150o2.zip / par.doc < prev    next >
Text File  |  1996-02-04  |  55KB  |  1,368 lines

  1.   *********************
  2.   * par.doc           *
  3.   * for Par 1.50      *
  4.   * Copyright 1996 by *
  5.   * Adam M. Costello  *
  6.   *********************
  7.  
  8.  
  9.     Par 1.50 is a package containing:
  10.  
  11.        + This doc file.
  12.        + A man page based on this doc file.
  13.        + The ANSI C source for the filter "par".
  14.  
  15.  
  16. Contents
  17.  
  18.     Contents
  19.     File List
  20.     Rights and Responsibilities
  21.     Compilation
  22.     Synopsis
  23.     Description
  24.    *Quick Start
  25.     Terminology
  26.     Options
  27.     Environment
  28.     Details
  29.     Diagnostics
  30.     Examples
  31.     Limitations
  32.     Apologies
  33.     Bugs
  34.  
  35.  
  36. File List
  37.  
  38.     The Par 1.50 package is always distributed with at least the
  39.     following files:
  40.  
  41.         buffer.c
  42.         buffer.h
  43.         charset.c
  44.         charset.h
  45.         errmsg.c
  46.         errmsg.h
  47.         par.1
  48.         par.c
  49.         par.doc
  50.         protoMakefile
  51.         reformat.c
  52.         reformat.h
  53.         releasenotes
  54.  
  55.     Each file is a text file which identifies itself on the second line,
  56.     and identifies the version of Par to which it belongs on the third
  57.     line, so you can always tell which file is which, even if the files
  58.     have been renamed.
  59.  
  60.     The file "par.1" is a man page for the filter par (not to be
  61.     confused with the package Par, which contains the source code for
  62.     par). "par.1" is based on this doc file, and conveys much (not
  63.     all) of the same information, but "par.doc" is the definitive
  64.     documentation for both par and Par.
  65.  
  66.  
  67. Rights and Responsibilities
  68.  
  69.     The files listed in the Files List section above are each Copyright
  70.     1996 by Adam M. Costello (henceforth "I", "me").
  71.  
  72.     I grant everyone permission to use these files in any way, subject
  73.     to the following two restrictions:
  74.  
  75.      1) No one may distribute any one of the files unless it is
  76.         accompanied by all of the other files.
  77.  
  78.      2) No one (except me) may distribute a modified version of one of
  79.         the files unless it clearly identifies itself as a modified
  80.         version, and it is accompanied by the original version of the
  81.         file.
  82.  
  83.     Regardless of whether modifications get distributed or not, I would
  84.     appreciate being sent copies in case I wish to incorporate them into
  85.     future versions of Par.  See the Bugs section for my addresses.
  86.  
  87.     All official versions of Par will have version numbers that fit the
  88.     pattern "<digits>.<digits>".  Those who distribute modified files
  89.     should, as a courtesy, make sure to modify the version number (which
  90.     appears in many places--search for it) to something that doesn't
  91.     fit the pattern, to avoid confusion between official versions and
  92.     modified versions.
  93.  
  94.     Though I have tried to make sure that Par is free of bugs, I make no
  95.     guarantees about its soundness.  Therefore, I am not responsible for
  96.     any damage resulting from the use of these files.
  97.  
  98.  
  99. Compilation
  100.  
  101.     To compile par, you need an ANSI C compiler.  Follow the
  102.     instructions in the comments in protoMakefile.
  103.  
  104.     If your compiler generates any warnings that you think are
  105.     legitimate, please tell me about them (see the Bugs section).
  106.  
  107.     Note that all variables in par are either constant or automatic
  108.     (or both), which means that par can be made reentrant (if your
  109.     compiler supports it).  Given the right operating system, it should
  110.     be possible for several par processes to share the same code space
  111.     and the same data space (but not the same stack, of course) in
  112.     memory.
  113.  
  114.  
  115. Synopsis
  116.     par [help] [version] [B<op><set>] [P<op><set>] [Q<op><set>]
  117.         [h[<hang>]] [p[<prefix>]] [r[<repeat>]] [s[<suffix>]] [T[<Tab>]]
  118.         [w[<width>]] [b[<body>]] [c[<cap>]] [d[<div>]] [E[<Err>]]
  119.         [e[<expel>]] [f[<fit>]] [g[<guess>]] [i[<invis>]] [j[<just>]]
  120.         [l[<last>]] [q[<quote>]] [R[<Report>]] [t[<touch>]]
  121.  
  122.     Things enclosed in [square brackets] are optional.  Things enclosed
  123.     in <angle brackets> are parameters.
  124.  
  125.  
  126. Description
  127.  
  128.     par is a filter which copies its input to its output, changing all
  129.     white characters (except newlines) to spaces, and reformatting
  130.     each paragraph.  Paragraphs are separated by protected, blank, and
  131.     bodiless lines (see the Terminology section for definitions), and
  132.     optionally delimited by indentation (see the d option in the Options
  133.     section).
  134.  
  135.     Each output paragraph is generated from the corresponding input
  136.     paragraph as follows:
  137.  
  138.      1) An optional prefix and/or suffix is removed from each input
  139.         line.
  140.      2) The remainder is divided into words (separated by spaces).
  141.      3) The words are joined into lines to make an eye-pleasing
  142.         paragraph.
  143.      4) The prefixes and suffixes are reattached.
  144.  
  145.      If there are suffixes, spaces are inserted before them so that they
  146.      all end in the same column.
  147.  
  148.  
  149. Quick Start
  150.  
  151.     par is necessarily complex.  For those who wish to use it
  152.     immediately and understand it later, assign to the PARINIT
  153.     environment variable the following value:
  154.  
  155.         rTbgqR B=.?_A_a Q=_s>|
  156.  
  157.     The spaces, question mark, greater-than sign, and vertical bar will
  158.     probably have to be escaped or quoted to prevent your shell from
  159.     interpreting them.
  160.  
  161.     The documentation, though precise, is unfortunately not well-written
  162.     for the end-user.  Your best bet is probably to read quickly the
  163.     Description, Terminology, Options, and Environment sections, then
  164.     read carefully the Examples section, referring back to the Options
  165.     and Terminology sections as needed.
  166.  
  167.     For the "power user", a full understanding of par will require
  168.     multiple readings of the Terminology, Options, Details, and Examples
  169.     sections.
  170.  
  171.  
  172. Terminology
  173.  
  174.     Miscellaneous terms:
  175.  
  176.         charset syntax
  177.             A way of representing a set of characters as a string.
  178.             The set includes exactly those characters which appear in
  179.             the string, except that the underscore (_) is an escape
  180.             character.  Whenever it appears, it must begin one of the
  181.             following escape sequences:
  182.  
  183.                    __ = an underscore
  184.                    _s = a space
  185.                    _b = a backslash (\)
  186.                    _q = a single quote (')
  187.                    _Q = a double quote (")
  188.                    _A = all upper case letters
  189.                    _a = all lower case letters
  190.                    _0 = all decimal digits
  191.                  _xhh = the character represented by the two hexadecimal
  192.                         digits hh (which may be upper or lower case)
  193.  
  194.             The NUL character must not appear in the string but it may
  195.             be included in the set with the _x00 sequence.
  196.  
  197.         error
  198.             A condition which causes par to abort.  See the Diagnostics
  199.             section.
  200.  
  201.         IP  Input paragraph.
  202.  
  203.         OP  Output paragraph.
  204.  
  205.         parameter
  206.             A symbol which may take on unsigned integral values.  There
  207.             are several parameters whose values affect the behavior of
  208.             par.  Parameters can be assigned values using command line
  209.             options.
  210.  
  211.  
  212.     Types of characters:
  213.  
  214.         alphanumeric character
  215.             An upper case letter, lower case letter, or decimal digit.
  216.  
  217.         body character
  218.             A member of the set of characters defined by the PARBODY
  219.             environment variable (see the Environment section) and/or
  220.             the B option (see the Options section).
  221.  
  222.         protective character
  223.             A member of the set of characters defined by the PARPROTECT
  224.             environment variable and/or the P option.
  225.  
  226.         quote character
  227.             A member of the set of characters defined by the PARQUOTE
  228.             environment variable and/or the Q option.
  229.  
  230.         terminal character
  231.             A period, question mark, exclamation point, or colon.
  232.  
  233.         white character
  234.             A space, formfeed, newline, carriage return, tab, or
  235.             vertical tab.
  236.  
  237.     Functions:
  238.  
  239.         comprelen
  240.             Given a non-empty sequence <S> of lines, let <c> be their
  241.             longest common prefix.  If the parameter <body> is 0, place
  242.             a divider just after the leading non-body characters in <c>
  243.             (at the beginning if there are none).  If <body> is 1, place
  244.             the divider just after the last non-space non-body character
  245.             in <c> (at the beginning if there is none), then advance
  246.             the divider over any immediately following spaces.  The
  247.             comprelen of <S> is the number of characters preceeding the
  248.             divider.
  249.  
  250.         comsuflen
  251.             Given a non-empty sequence <S> of lines, let <p> be the
  252.             comprelen of <S>.  Let <T> be the set of lines which results
  253.             from stripping the first <p> characters from each line in
  254.             <S>.  Let <c> be the longest common suffix of the lines
  255.             in <T>.  If <body> is 0, place a divider just before the
  256.             trailing non-body characters in <c> (at the end if there are
  257.             none), then advance the divider over all but the last of any
  258.             immediately following spaces.  If <body> is 1, place the
  259.             divider just before the first non-space non-body character,
  260.             then back up the divider over one immediately preceeding
  261.             space if there is one.  The comsuflen of <S> is the number
  262.             of characters following the divider.
  263.  
  264.         fallback prelen (suflen)
  265.             The fallback prelen (suflen) of an IP is: the comprelen
  266.             (comsuflen) of the IP, if the IP contains at least two
  267.             lines; otherwise, the comprelen (comsuflen) of the block
  268.             containing the IP, if the block contains at least two
  269.             lines; otherwise, the length of the longer of the prefixes
  270.             (suffixes) of the bodiless lines just above and below the
  271.             block, if the segment containing the block has any bodiless
  272.             lines; otherwise, 0.  (See below for the definitions of
  273.             block, segment, and bodiless line.)
  274.  
  275.         augmented fallback prelen
  276.             Let <fp> be the fallback prelen of an IP.  If the IP
  277.             contains more than one line, or if <quote> is 0, then
  278.             the augmented fallback prelen of the IP is simply <fp>.
  279.             Otherwise, it is <fp> plus the number of quote characters
  280.             immediately following the first <fp> characters of the line.
  281.  
  282.         quoteprefix
  283.             The quoteprefix of a line is the longest string of quote
  284.             characters appearing at the beginning of the line, after
  285.             this string has been stripped of any trailing spaces.
  286.  
  287.     Types of lines:
  288.  
  289.         blank line
  290.             An empty line, or a line whose first character is not
  291.             protective and which contains only spaces.
  292.  
  293.         protected line
  294.             An input line whose first character is protective.
  295.  
  296.         bodiless line
  297.             A line which is order <k> bodiless for some <k>.
  298.  
  299.         order <k> bodiless line
  300.             There is no such thing as an order 0 bodiless line.  Suppose
  301.             <S> is a a contiguous subsequence of a segment (see below)
  302.             containing at least two lines, containing no order <k>-1
  303.             bodiless lines, bounded above and below by order <k>-1
  304.             bodiless lines and/or the beginning/end of the segment.
  305.             Let <p> and <s> be the comprelen and comsuflen of <S>.
  306.             Any member of <S> which, if stripped of its first <p> and
  307.             last <s> characters, would be blank (or, if the parameter
  308.             <repeat> is non-zero, would consist of the same character
  309.             repeated at least <repeat> times), is order <k> bodiless.
  310.             The first <p> characters of the bodiless line comprise its
  311.             prefix; the last <s> characters comprise its suffix.  The
  312.             character which repeats in the middle is called its repeat
  313.             character.  If the middle is empty, the space is taken to be
  314.             its repeat character.
  315.  
  316.         vacant line
  317.             A bodiless line whose repeat character is the space.
  318.  
  319.         superfluous line
  320.             Only blank and vacant lines may be superfluous.  If
  321.             contiguous vacant lines lie at the beginning or end of
  322.             a segment, they are all superfluous.  But if they lie
  323.             between two non-vacant lines within a segment, then all are
  324.             superfluous except one--the one which contains the fewest
  325.             non-spaces.  In case of a tie, the first of the tied lines
  326.             is chosen.  Similarly, if contiguous blank lines lie outside
  327.             of any segments at the beginning or end of the input, they
  328.             are all superfluous.  But if they lie between two segments
  329.             and/or protected lines, then all are superfluous except the
  330.             first.
  331.  
  332.     Groups of lines:
  333.  
  334.         segment
  335.             A contiguous sequence of input lines containing no protected
  336.             or blank lines, bounded above and below by protected lines,
  337.             blank lines, and/or the beginning/end of the input.
  338.  
  339.         block
  340.             A contiguous subsequence of a segment containing no bodiless
  341.             lines, bounded above and below by bodiless lines and/or the
  342.             beginning/end of the segment.
  343.  
  344.     Types of words:
  345.  
  346.         capitalized word
  347.             If the parameter <cap> is 0, a capitalized word is one which
  348.             contains at least one alphanumeric character, whose first
  349.             alphanumeric character is not a lower case letter.  If <cap>
  350.             is 1, every word is considered a capitalized word.  (See the
  351.             c option in the Options section.)
  352.  
  353.         curious word
  354.             A word which contains a terminal character <c> such that
  355.             there are no alphanumeric characters in the word after <c>,
  356.             but there is at least one alphanumeric character in the word
  357.             before <c>.
  358.  
  359.  
  360. Options
  361.  
  362.     Any command line argument may begin with one minus sign (-) which
  363.     is ignored.  Generally, more than one option may appear in a single
  364.     command line argument, but there are exceptions:  The help, version,
  365.     B, P, and Q options must have whole arguments all to themselves.
  366.  
  367.     help        Causes all remaining arguments to be ignored.  No input
  368.                 is read.  A usage message is printed on the output
  369.                 briefly describing the options used by par.
  370.  
  371.     version     Causes all remaining arguments to be ignored.  No input
  372.                 is read. "par 1.50" is printed on the output.  Of
  373.                 course, this will change in future releases of Par.
  374.  
  375.     B<op><set>  <op> is a single character, either an equal sign (=),
  376.                 a plus sign (+), or a minus sign (-), and <set> is a
  377.                 string using charset syntax.  If <op> is an equal sign,
  378.                 the set of body characters is set to the character set
  379.                 defined by <set>.  If <op> is a plus/minus sign, the
  380.                 characters in the set defined by <set> are added/removed
  381.                 to/from the existing set of body characters defined by
  382.                 the PARBODY environment variable and any previous B
  383.                 options.  It is okay to add characters that are already
  384.                 in the set or to remove characters that are not in the
  385.                 set.
  386.  
  387.     P<op><set>  Just like the B option, except that it applies to the
  388.                 set of protective characters.
  389.  
  390.     Q<op><set>  Just like the B option, except that it applies to the
  391.                 set of quote characters.
  392.  
  393.     All remaining options are used to set values of parameters.  Values
  394.     set by command line options hold for all paragraphs.  Unset
  395.     parameters are given default values.  Any parameters whose default
  396.     values depend on the IP (namely <prefix> and <suffix>), if left
  397.     unset, are recomputed separately for each paragraph.
  398.  
  399.     The approximate role of each parameter is described here.  See the
  400.     Details section for the rest of the story.
  401.  
  402.     The first six parameters, <hang>, <prefix>, <repeat>, <suffix>,
  403.     <Tab>, and <width>, may be set to any unsigned decimal integer less
  404.     than 10000.
  405.  
  406.     h[<hang>]   Mainly affects the default values of <prefix> and
  407.                 <suffix>.  Defaults to 0.  If the h option is given
  408.                 without a number, the value 1 is inferred.  (See also
  409.                 the p and s options.)
  410.  
  411.     p[<prefix>] The first <prefix> characters of each line of the OP
  412.                 are copied from the first <prefix> characters of the
  413.                 corresponding line of the IP.  If there are more than
  414.                 <hang>+1 lines in the IP, the default value is the
  415.                 comprelen of all the lines in the IP except the first
  416.                 <hang> of them.  Otherwise, the default value is the
  417.                 augmented fallback prelen of the IP.  If the p option is
  418.                 given without a number, <prefix> is unset, even if it
  419.                 had been set earlier.  (See also the h and q options.)
  420.  
  421.     r[<repeat>] If <repeat> is non-zero, bodiless lines have the number
  422.                 of instances of their repeat characters increased or
  423.                 decreased until the length of the line is <width>.
  424.                 The exact value of <repeat> affects the definition of
  425.                 bodiless line.  Defaults to 0.  If the r option is given
  426.                 without a number, the value 3 is inferred.  (See also
  427.                 the w option.)
  428.  
  429.     s[<suffix>] The last <suffix> characters of each line of the OP
  430.                 are copied from the last <suffix> characters of the
  431.                 corresponding line of the IP.  If there are more than
  432.                 <hang>+1 lines in the IP, the default value is the
  433.                 comsuflen of all the lines in the IP except the first
  434.                 <hang> of them.  Otherwise, the default value is the
  435.                 fallback suflen of the IP.  If the s option is given
  436.                 without a number, <suffix> is unset, even if it had been
  437.                 set earlier.  (See also the h option.)
  438.  
  439.     T[<Tab>]    Tab characters in the input are expanded to spaces,
  440.                 assuming tab stops every <Tab> columns.  Must not be
  441.                 0.  Defaults to 1.  If the T option is given without a
  442.                 number, the value 8 is inferred.
  443.  
  444.     w[<width>]  No line in the OP may contain more than <width>
  445.                 characters, not including the trailing newlines.
  446.                 Defaults to 72.  If the w option is given without a
  447.                 number, the value 79 is inferred.
  448.  
  449.     The remaining thirteen parameters, <body>, <cap>, <div>, <Err>,
  450.     <expel>, <fit>, <guess>, <invis>, <just>, <last>, <quote>, <Report>,
  451.     and <touch>, may be set to either 0 or 1.  If the number is absent
  452.     in the option, the value 1 is inferred.
  453.  
  454.     b[<body>]   If <body> is 1, prefixes may not contain any trailing
  455.                 body characters, and suffixes may not contain any
  456.                 leading body characters.  (Actually, the situation
  457.                 is complicated by space characters.  See comprelen
  458.                 and comsuflen in the Terminology section.)  If <body>
  459.                 is 0, prefixes and suffixes may not contain any body
  460.                 characters at all.  Defaults to 0.
  461.  
  462.     c[<cap>]    If <cap> is 1, all words are considered capitalized.
  463.                 This currently affects only the application of the g
  464.                 option.  Defaults to 0.
  465.  
  466.     d[<div>]    If <div> is 0, each block becomes an IP.  If <div> is 1,
  467.                 each block is subdivided into IPs as follows:  Let <p>
  468.                 be the comprelen of the block.  Let a line's status be
  469.                 1 if its (<p>+1)st character is a space, 0 otherwise.
  470.                 Every line in the block whose status is the same as the
  471.                 status of the first line will begin a new paragraph.
  472.                 Defaults to 0.
  473.  
  474.     E[<Err>]    If <Err> is 1, messages to the user (caused by the help
  475.                 and version options, or by errors) are sent to the error
  476.                 stream instead of the output stream.  Defaults to 0.
  477.  
  478.     e[<expel>]  If <expel> is 1, superfluous lines withheld from the
  479.                 output.  Defaults to 0.
  480.  
  481.     f[<fit>]    If <fit> is 1 and <just> is 0, par tries to make the
  482.                 lines in the OP as nearly the same length as possible,
  483.                 even if it means making the OP narrower.  Defaults to 0.
  484.                 (See also the j option.)
  485.  
  486.     g[<guess>]  If <guess> is 1, then when par is choosing line breaks,
  487.                 whenever it encounters a curious word followed by a
  488.                 capitalized word, it takes one of two special actions.
  489.                 If the two words are separated by a single space in
  490.                 the input, they will be merged into one word with an
  491.                 embedded non-breaking space.  If the two words are
  492.                 separated by more than one space, or by a line break,
  493.                 par will insure that they are separated by two spaces,
  494.                 or by a line break, in the output.  Defaults to 0.
  495.  
  496.     i[<invis>]  If <invis> is 1, then vacant lines inserted because
  497.                 <quote> is 1 are invisible; that is, they are not
  498.                 output.  If <quote> is 0, <invis> has no effect.
  499.                 Defaults to 0.  (See also the q option.)
  500.  
  501.     j[<just>]   If <just> is 1, par justifies the OP, inserting spaces
  502.                 between words so that all lines in the OP have length
  503.                 <width> (except the last, if <last> is 0).  Defaults to
  504.                 0.  (See also the w, l, and f options.)
  505.  
  506.     l[<last>]   If <last> is 1, par tries to make the last line of the
  507.                 OP about the same length as the others.  Defaults to 0.
  508.  
  509.     q[<quote>]  If <quote> is 1, then before each segment is scanned
  510.                 for bodiless lines, par supplies vacant lines between
  511.                 different quotation nesting levels as follows:  For each
  512.                 pair of adjacent lines in the segment (scanned from the
  513.                 top down) which have different quoteprefixes, one of
  514.                 two actions is taken.  If <invis> is 0, and either line
  515.                 consists entirely of quote characters and spaces (or is
  516.                 empty), that line is truncated to the longest common
  517.                 prefix of the two lines (both are truncated if both
  518.                 qualify).  Otherwise, a line consisting of the longest
  519.                 common prefix of the two lines is inserted between them.
  520.                 <quote> also affects the default value of <prefix>.
  521.                 Defaults to 0.  (See also the p and i options.)
  522.  
  523.     R[<Report>] If <Report> is 1, it is considered an error for an input
  524.                 word to contain more than <L> = (<width> - <prefix> -
  525.                 <suffix>) characters.  Otherwise, such words are chopped
  526.                 after each <L>th character into shorter words.  Defaults
  527.                 to 0.
  528.  
  529.     t[<touch>]  Has no effect if <suffix> is 0 or <just> is 1.
  530.                 Otherwise, if <touch> is 0, all lines in the OP have
  531.                 length <width>.  If <touch> is 1, the length of the
  532.                 lines is decreased until the suffixes touch the body of
  533.                 the OP.  Defaults to the logical OR of <fit> and <last>.
  534.                 (See also the s, j, w, f, and l options.)
  535.  
  536.     If an argument begins with a number, that number is assumed
  537.     to belong to a p option if it is 8 or less, and to a w option
  538.     otherwise.
  539.  
  540.     If the value of any parameter is set more than once, the last value
  541.     is used.  When unset parameters are assigned default values, <hang>
  542.     and <quote> are assigned before <prefix>, and <fit> and <last> are
  543.     assigned before <touch> (because of the dependencies).
  544.  
  545.     It is an error if <width> <= <prefix> + <suffix>.
  546.  
  547.  
  548. Environment
  549.  
  550.     PARBODY     Determines the initial set of body characters (which are
  551.                 used for determining comprelens and comsuflens), using
  552.                 charset syntax.  If PARBODY is not set, the set of body
  553.                 characters is initially empty.
  554.  
  555.     PARINIT     If set, par will read command line arguments from PARINIT
  556.                 before it reads them from the command line.  Within
  557.                 the value of PARINIT, arguments are separated by white
  558.                 characters.
  559.  
  560.     PARPROTECT  Determines the set of protective characters, using charset
  561.                 syntax.  If PARPROTECT is not set, the set of protective
  562.                 characters is initially empty.
  563.  
  564.     PARQUOTE    Determines the set of quote characters, using charset
  565.                 syntax.  If PARQUOTE is not set, the set of quote characters
  566.                 initially contains only the greater-than sign (>) and the
  567.                 space.
  568.  
  569.     If a NUL character appears in the value of an environment variable, it
  570.     and the rest of the string will not be seen by par.
  571.  
  572.     Note that the PARINIT variable, together with the B, P, and Q
  573.     options, renders the other environment variables unnecessary.  They
  574.     are included for backward compatibility.
  575.  
  576. Details
  577.  
  578.     Lines are terminated by newline characters, but the newlines are not
  579.     considered to be included in the lines.  If the last character of
  580.     the input is a non-newline, a newline will be inferred immediately
  581.     after it (but if the input is empty, no newline will be inferred;
  582.     the number of input lines will be 0).  Thus, the input can always be
  583.     viewed as a sequence of lines.
  584.  
  585.     Protected lines are copied unchanged from the input to the output.
  586.     All other input lines, as they are read, have any NUL characters
  587.     removed, and every white character (except newlines) turned into a
  588.     space.  Actually, each tab character is turned into <Tab> - (<n> %
  589.     <Tab>) spaces, where <n> is the number of characters preceeding the
  590.     tab character on the line (evaluated after earlier tab characters
  591.     have been expanded).
  592.  
  593.     Blank lines in the input are transformed into empty lines in the
  594.     output.
  595.  
  596.     If <repeat> is 0, all bodiless lines are vacant, and they are all
  597.     simply stripped of trailing spaces before being output.  If <repeat>
  598.     is not 0, only vacant lines whose suffixes have length 0 are treated
  599.     that way; other bodiless lines have the number of instances of their
  600.     repeat characters increased or decreased until the length of the
  601.     line is <width>.
  602.  
  603.     If <expel> is 1, superfluous lines are not output.  If <quote> and
  604.     <invis> are both 1, there may be invisible lines; they are not
  605.     output.
  606.  
  607.     The input is divided into segments, which are divided into blocks,
  608.     which are divided into IPs.  The exact process depends on the values
  609.     of <quote> and <div> (see q and d in the Options section).  The
  610.     remainder of this section describes the process which is applied
  611.     independently to each IP to construct the corresponding OP.
  612.  
  613.     After the values of the parameters are determined (see the Options
  614.     section), the first <prefix> characters and the last <suffix>
  615.     characters of each input line are removed and remembered.  It is
  616.     an error for any line to contain fewer than <prefix> + <suffix>
  617.     characters.
  618.  
  619.     The remaining text is treated as a sequence of characters, not
  620.     lines.  The text is broken into words, which are separated by
  621.     spaces.  That is, a word is a maximal sub-sequence of non-spaces.
  622.     If <guess> is 1, some words might be merged (see g in the Options
  623.     section).  The first word includes any spaces that preceed it on the
  624.     same line.
  625.  
  626.     Let <L> = <width> - <prefix> - <suffix>.
  627.  
  628.     If <Report> is 0, some words may get chopped up at this point (see R
  629.     in the Options section).
  630.  
  631.     The words are reassembled, preserving their order, into lines.  If
  632.     <just> is 0, adjacent words within a line are separated by a single
  633.     space (or sometimes two if <guess> is 1), and line breaks are chosen
  634.     so that the paragraph satisfies the following properties:
  635.  
  636.          1) No line contains more than <L> characters.
  637.  
  638.          2) If <fit> is 1, the difference between the lengths of the
  639.             shortest and longest lines is as small as possible.
  640.  
  641.          3) The shortest line is as long as possible, subject to
  642.             properties 1 and 2.
  643.  
  644.          4) Let <target> be <L> if <fit> is 0, or the length of the
  645.             longest line if <fit> is 1.  The sum of the squares of the
  646.             differences between <target> and the lengths of the lines is
  647.             as small as possible, subject to properties 1, 2, and 3.
  648.  
  649.         If <last> is 0, the last line does not count as a line for the
  650.         purposes of properties 2, 3, and 4 above.
  651.  
  652.         If all the words fit on a single line, the properties as worded
  653.         above don't make much sense.  In that case, no line breaks are
  654.         inserted.
  655.  
  656.     If <just> is 1, adjacent words within a line are separated by one
  657.     space (or sometimes two if <guess> is 1) plus zero or more extra
  658.     spaces.  The value of <fit> is disregarded, and line breaks are
  659.     chosen so that the paragraph satisfies the following properties:
  660.  
  661.          1) Every line contains exactly <L> characters.
  662.  
  663.          2) The largest inter-word gap is as small as possible, subject
  664.             to property 1.  (An inter-word gap consists only of the
  665.             extra spaces, not the regular spaces.)
  666.  
  667.          3) The sum of the squares of the lengths of the inter-word gaps
  668.             is as small as possible, subject to properties 1 and 2.
  669.  
  670.         If <last> is 0, the last line does not count as a line for the
  671.         purposes of property 1, and it does not require or contain any
  672.         extra spaces.
  673.  
  674.         Extra spaces are distributed as uniformly as possible among the
  675.         inter-word gaps in each line.
  676.  
  677.         In a justified paragraph, every line must contain at least two
  678.         words, but that's not always possible to accomplish.  If the
  679.         paragraph cannot be justified, it is considered an error.
  680.  
  681.     If the number of lines in the resulting paragraph is less than
  682.     <hang>, empty lines are added at the end to bring the number of
  683.     lines up to <hang>.
  684.  
  685.     If <just> is 0 and <touch> is 1, <L> is changed to be the length of
  686.     the longest line.
  687.  
  688.     If <suffix> is not 0, each line is padded at the end with spaces to
  689.     bring its length up to <L>.
  690.  
  691.     To each line is prepended <prefix> characters.  Let <n> be the
  692.     number of lines in the IP, let <afp> be the augmented fallback
  693.     prelen of the IP, and let <fs> be the fallback suflen of the IP.
  694.     The characters which are prepended to the <i>th line are chosen as
  695.     follows:
  696.  
  697.      1) If <i> <= <n>, the characters are copied from the ones that were
  698.         removed from the beginning of the <n>th input line.
  699.  
  700.      2) If <i> > <n> > <hang>, the characters are copied from the ones
  701.         that were removed from the beginning of the last input line.
  702.  
  703.      3) If <i> > <n> and <n> <= <hang>, the first min(<afp>,<prefix>)
  704.         of the characters are copied from the ones that were removed
  705.         from the beginning of the last input line, and the rest are all
  706.         spaces.
  707.  
  708.     Then to each line is appended <suffix> characters.  The characters
  709.     which are appended to the <i>th line are chosen as follows:
  710.  
  711.      1) If <i> <= <n>, the characters are copied from the ones that were
  712.         removed from the end of the nth input line.
  713.  
  714.      2) If <i> > <n> > <hang>, the characters are copied from the ones
  715.         that were removed from the end of the last input line.
  716.  
  717.      3) If <i> > <n> and <n> <= <hang>, the first min(<fs>,<suffix>)
  718.         of the characters are copied from the ones that were removed
  719.         from the beginning of the last input line, and the rest are all
  720.         spaces.
  721.  
  722.     Finally, the lines are printed to the output as the OP.
  723.  
  724.  
  725. Diagnostics
  726.  
  727.     If there are no errors, par returns EXIT_SUCCESS (see <stdlib.h>).
  728.  
  729.     If there is an error, an error message will be printed to the
  730.     output, and par will return EXIT_FAILURE.  If the error is local
  731.     to a single paragraph, the preceeding paragraphs will have been
  732.     output before the error was detected.  Line numbers in error
  733.     messages are local to the IP in which the error occurred.  All
  734.     error messages begin with "par error:" on a line by itself.  Error
  735.     messages concerning command line or environment variable syntax are
  736.     accompanied by the same usage message that the help option produces.
  737.  
  738.     Of course, trying to print an error message would be futile if an
  739.     error resulted from an output function, so par doesn't bother doing
  740.     any error checking on output functions.
  741.  
  742.  
  743. Examples
  744.  
  745.     The superiority of par's dynamic programming algorithm over a greedy
  746.     algorithm (such as the one used by fmt) can be seen in the following
  747.     example:
  748.  
  749.     Original paragraph (note that each line begins with 8 spaces):
  750.  
  751.         We the people of the United States,
  752.         in order to form a more perfect union,
  753.         establish justice,
  754.         insure domestic tranquility,
  755.         provide for the common defense,
  756.         promote the general welfare,
  757.         and secure the blessing of liberty
  758.         to ourselves and our posterity,
  759.         do ordain and establish the Constitution
  760.         of the United States of America.
  761.  
  762.     After a greedy algorithm with width = 39:
  763.  
  764.         We the people of the United
  765.         States, in order to form a more
  766.         perfect union, establish
  767.         justice, insure domestic
  768.         tranquility, provide for the
  769.         common defense, promote the
  770.         general welfare, and secure the
  771.         blessing of liberty to
  772.         ourselves and our posterity, do
  773.         ordain and establish the
  774.         Constitution of the United
  775.         States of America.
  776.  
  777.     After "par 39":
  778.  
  779.         We the people of the United    
  780.         States, in order to form a     
  781.         more perfect union, establish  
  782.         justice, insure domestic       
  783.         tranquility, provide for the   
  784.         common defense, promote the    
  785.         general welfare, and secure    
  786.         the blessing of liberty to     
  787.         ourselves and our posterity,   
  788.         do ordain and establish the    
  789.         Constitution of the United     
  790.         States of America.             
  791.  
  792.     The line breaks chosen by par are clearly more eye-pleasing.
  793.  
  794.     par is most useful in conjunction with the text-filtering features
  795.     of an editor, such as the ! commands of vi.  You may wish to add the
  796.     following lines to your .exrc file:
  797.  
  798.         " use Bourne shell for speed:
  799.         set shell=/bin/sh
  800.         "
  801.         " reformat paragraph with no arguments:
  802.         map ** {!}par^M}
  803.         "
  804.         " reformat paragraph with arguments:
  805.         map *^V  {!}par 
  806.  
  807.     Note that the leading spaces must be removed, and that what is shown
  808.     as ^M and ^V really need to be ctrl-M and ctrl-V.  Also note that
  809.     the last map command contains two spaces following the ctrl-V, plus
  810.     one at the end of the line.
  811.  
  812.     To reformat a simple paragraph delimited by blank lines in vi, you
  813.     can put the cursor anywhere in it and type "**" (star star).  If
  814.     you need to supply arguments to par, you can type "* " (star space)
  815.     instead, then type the arguments.
  816.  
  817.     The rest of this section is a series of before-and-after pictures
  818.     showing some typical uses of par.  In all cases, no environment
  819.     variables are set.
  820.  
  821.     Before:
  822.  
  823.         /*   We the people of the United States, */
  824.         /* in order to form a more perfect union, */
  825.         /* establish justice, */
  826.         /* insure domestic tranquility, */
  827.         /* provide for the common defense, */
  828.         /* promote the general welfare, */
  829.         /* and secure the blessing of liberty */
  830.         /* to ourselves and our posterity, */
  831.         /* do ordain and establish the Constitution */
  832.         /* of the United States of America. */
  833.  
  834.     After "par 59":
  835.  
  836.         /*   We the people of the United States, in      */
  837.         /* order to form a more perfect union, establish */
  838.         /* justice, insure domestic tranquility, provide */
  839.         /* for the common defense, promote the general   */
  840.         /* welfare, and secure the blessing of liberty   */
  841.         /* to ourselves and our posterity, do ordain     */
  842.         /* and establish the Constitution of the United  */
  843.         /* States of America.                            */
  844.  
  845.     Or after "par 59f":
  846.  
  847.         /*   We the people of the United States,  */
  848.         /* in order to form a more perfect union, */
  849.         /* establish justice, insure domestic     */
  850.         /* tranquility, provide for the common    */
  851.         /* defense, promote the general welfare,  */
  852.         /* and secure the blessing of liberty to  */
  853.         /* ourselves and our posterity, do ordain */
  854.         /* and establish the Constitution of the  */
  855.         /* United States of America.              */
  856.  
  857.     Or after "par 59l":
  858.  
  859.         /*   We the people of the United States, in      */
  860.         /* order to form a more perfect union, establish */
  861.         /* justice, insure domestic tranquility,         */
  862.         /* provide for the common defense, promote       */
  863.         /* the general welfare, and secure the           */
  864.         /* blessing of liberty to ourselves and our      */
  865.         /* posterity, do ordain and establish the        */
  866.         /* Constitution of the United States of America. */
  867.  
  868.     Or after "par 59lf":
  869.  
  870.         /*   We the people of the United States,  */
  871.         /* in order to form a more perfect union, */
  872.         /* establish justice, insure domestic     */
  873.         /* tranquility, provide for the common    */
  874.         /* defense, promote the general welfare,  */
  875.         /* and secure the blessing of liberty     */
  876.         /* to ourselves and our posterity, do     */
  877.         /* ordain and establish the Constitution  */
  878.         /* of the United States of America.       */
  879.  
  880.     Or after "par 59lft0":
  881.  
  882.         /*   We the people of the United States,         */
  883.         /* in order to form a more perfect union,        */
  884.         /* establish justice, insure domestic            */
  885.         /* tranquility, provide for the common           */
  886.         /* defense, promote the general welfare,         */
  887.         /* and secure the blessing of liberty            */
  888.         /* to ourselves and our posterity, do            */
  889.         /* ordain and establish the Constitution         */
  890.         /* of the United States of America.              */
  891.  
  892.     Or after "par 59j":
  893.  
  894.         /*   We  the people  of  the  United States,  in */
  895.         /* order to form a more perfect union, establish */
  896.         /* justice, insure domestic tranquility, provide */
  897.         /* for the  common defense, promote  the general */
  898.         /* welfare, and  secure the blessing  of liberty */
  899.         /* to ourselves and our posterity, do ordain and */
  900.         /* establish  the  Constitution  of  the  United */
  901.         /* States of America.                            */
  902.  
  903.     Or after "par 59jl":
  904.  
  905.         /*   We  the   people  of  the   United  States, */
  906.         /* in   order    to   form   a    more   perfect */
  907.         /* union,  establish  justice,  insure  domestic */
  908.         /* tranquility, provide for  the common defense, */
  909.         /* promote  the  general   welfare,  and  secure */
  910.         /* the  blessing  of  liberty to  ourselves  and */
  911.         /* our  posterity, do  ordain and  establish the */
  912.         /* Constitution of the United States of America. */
  913.  
  914.     Before:
  915.  
  916.         Preamble      We the people of the United States,
  917.         to the US     in order to form
  918.         Constitution  a more perfect union,
  919.                       establish justice,
  920.                       insure domestic tranquility,
  921.                       provide for the common defense,
  922.                       promote the general welfare,
  923.                       and secure the blessing of liberty
  924.                       to ourselves and our posterity,
  925.                       do ordain and establish
  926.                       the Constitution
  927.                       of the United States of America.
  928.  
  929.     After "par 52h3":
  930.  
  931.         Preamble      We the people of the United
  932.         to the US     States, in order to form a
  933.         Constitution  more perfect union, establish
  934.                       justice, insure domestic
  935.                       tranquility, provide for the
  936.                       common defense, promote the
  937.                       general welfare, and secure
  938.                       the blessing of liberty to
  939.                       ourselves and our posterity,
  940.                       do ordain and establish the
  941.                       Constitution of the United
  942.                       States of America.
  943.  
  944.     Before:
  945.  
  946.          1  We the people of the United States,
  947.          2  in order to form a more perfect union,
  948.          3  establish justice,
  949.          4  insure domestic tranquility,
  950.          5  provide for the common defense,
  951.          6  promote the general welfare,
  952.          7  and secure the blessing of liberty
  953.          8  to ourselves and our posterity,
  954.          9  do ordain and establish the Constitution
  955.         10  of the United States of America.
  956.  
  957.     After "par 59p12l":
  958.  
  959.          1  We the people of the United States, in order to
  960.          2  form a more perfect union, establish justice,
  961.          3  insure domestic tranquility, provide for the
  962.          4  common defense, promote the general welfare,
  963.          5  and secure the blessing of liberty to ourselves
  964.          6  and our posterity, do ordain and establish the
  965.          7  Constitution of the United States of America.
  966.  
  967.     Before:
  968.  
  969.         > > We the people
  970.         > > of the United States,
  971.         > > in order to form a more perfect union,
  972.         > > establish justice,
  973.         > > ensure domestic tranquility,
  974.         > > provide for the common defense,
  975.         >
  976.         > Promote the general welfare,
  977.         > and secure the blessing of liberty
  978.         > to ourselves and our posterity,
  979.         > do ordain and establish
  980.         > the Constitution of the United States of America.
  981.  
  982.     After "par 52":
  983.  
  984.         > > We the people of the United States, in
  985.         > > order to form a more perfect union,
  986.         > > establish justice, ensure domestic
  987.         > > tranquility, provide for the common
  988.         > > defense,
  989.         >
  990.         > Promote the general welfare, and secure
  991.         > the blessing of liberty to ourselves and
  992.         > our posterity, do ordain and establish
  993.         > the Constitution of the United States of
  994.         > America.
  995.  
  996.     Before:
  997.  
  998.         >   We the people
  999.         > of the United States,
  1000.         > in order to form a more perfect union,
  1001.         > establish justice,
  1002.         > ensure domestic tranquility,
  1003.         > provide for the common defense,
  1004.         >   Promote the general welfare,
  1005.         > and secure the blessing of liberty
  1006.         > to ourselves and our posterity,
  1007.         > do ordain and establish
  1008.         > the Constitution of the United States of America.
  1009.  
  1010.     After "par 52d":
  1011.  
  1012.         >   We the people of the United States,
  1013.         > in order to form a more perfect union,
  1014.         > establish justice, ensure domestic
  1015.         > tranquility, provide for the common
  1016.         > defense,
  1017.         >   Promote the general welfare, and secure
  1018.         > the blessing of liberty to ourselves and
  1019.         > our posterity, do ordain and establish
  1020.         > the Constitution of the United States of
  1021.         > America.
  1022.  
  1023.     Before:
  1024.  
  1025.         # 1. We the people of the United States.
  1026.         # 2. In order to form a more perfect union.
  1027.         # 3. Establish justice, ensure domestic
  1028.         #    tranquility.
  1029.         # 4. Provide for the common defense
  1030.         # 5. Promote the general welfare.
  1031.         # 6. And secure the blessing of liberty
  1032.         #    to ourselves and our posterity.
  1033.         # 7. Do ordain and establish the Constitution.
  1034.         # 8. Of the United States of America.
  1035.  
  1036.     After "par 37p13dh":
  1037.  
  1038.         # 1. We the people of the
  1039.         #    United States.
  1040.         # 2. In order to form a more
  1041.         #    perfect union.
  1042.         # 3. Establish justice,
  1043.         #    ensure domestic
  1044.         #    tranquility.
  1045.         # 4. Provide for the common
  1046.         #    defense
  1047.         # 5. Promote the general
  1048.         #    welfare.
  1049.         # 6. And secure the blessing
  1050.         #    of liberty to ourselves
  1051.         #    and our posterity.
  1052.         # 7. Do ordain and establish
  1053.         #    the Constitution.
  1054.         # 8. Of the United States of
  1055.         #    America.
  1056.  
  1057.     Before:
  1058.  
  1059.         /*****************************************/
  1060.         /*   We the people of the United States, */
  1061.         /* in order to form a more perfect union, */
  1062.         /* establish justice, insure domestic    */
  1063.         /* tranquility,                          */
  1064.         /*                                       */
  1065.         /*                                       */
  1066.         /*   [ provide for the common defense, ] */
  1067.         /*   [ promote the general welfare,    ] */
  1068.         /*   [ and secure the blessing of liberty ] */
  1069.         /*   [ to ourselves and our posterity, ] */
  1070.         /*   [                                 ] */
  1071.         /*                                       */
  1072.         /* do ordain and establish the Constitution */
  1073.         /* of the United States of America.       */
  1074.         /******************************************/
  1075.  
  1076.     After "par 42r":
  1077.  
  1078.         /********************************/
  1079.         /*   We the people of the       */
  1080.         /* United States, in order to   */
  1081.         /* form a more perfect union,   */
  1082.         /* establish justice, insure    */
  1083.         /* domestic tranquility,        */
  1084.         /*                              */
  1085.         /*                              */
  1086.         /*   [ provide for the common ] */
  1087.         /*   [ defense, promote the   ] */
  1088.         /*   [ general welfare, and   ] */
  1089.         /*   [ secure the blessing of ] */
  1090.         /*   [ liberty to ourselves   ] */
  1091.         /*   [ and our posterity,     ] */
  1092.         /*   [                        ] */
  1093.         /*                              */
  1094.         /* do ordain and establish the  */
  1095.         /* Constitution of the United   */
  1096.         /* States of America.           */
  1097.         /********************************/
  1098.  
  1099.     Or after "par 42re":
  1100.  
  1101.         /********************************/
  1102.         /*   We the people of the       */
  1103.         /* United States, in order to   */
  1104.         /* form a more perfect union,   */
  1105.         /* establish justice, insure    */
  1106.         /* domestic tranquility,        */
  1107.         /*                              */
  1108.         /*   [ provide for the common ] */
  1109.         /*   [ defense, promote the   ] */
  1110.         /*   [ general welfare, and   ] */
  1111.         /*   [ secure the blessing of ] */
  1112.         /*   [ liberty to ourselves   ] */
  1113.         /*   [ and our posterity,     ] */
  1114.         /*                              */
  1115.         /* do ordain and establish the  */
  1116.         /* Constitution of the United   */
  1117.         /* States of America.           */
  1118.         /********************************/
  1119.  
  1120.     Before:
  1121.  
  1122.         Joe Public writes:
  1123.         > Jane Doe writes:
  1124.         > >
  1125.         > >
  1126.         > > I can't find the source for uncompress.
  1127.         > Oh no, not again!!!
  1128.         >
  1129.         >
  1130.         > Isn't there a FAQ for this?
  1131.         >
  1132.         >
  1133.         That wasn't very helpful, Joe. Jane,
  1134.         just make a link from uncompress to compress.
  1135.  
  1136.     After "par 40q":
  1137.  
  1138.         Joe Public writes:
  1139.  
  1140.         > Jane Doe writes:
  1141.         >
  1142.         >
  1143.         > > I can't find the source for
  1144.         > > uncompress.
  1145.         >
  1146.         > Oh no, not again!!!
  1147.         >
  1148.         >
  1149.         > Isn't there a FAQ for this?
  1150.         >
  1151.  
  1152.         That wasn't very helpful, Joe.
  1153.         Jane, just make a link from
  1154.         uncompress to compress.
  1155.  
  1156.     Or after "par 40qe":
  1157.  
  1158.         Joe Public writes:
  1159.  
  1160.         > Jane Doe writes:
  1161.         >
  1162.         > > I can't find the source for
  1163.         > > uncompress.
  1164.         >
  1165.         > Oh no, not again!!!
  1166.         >
  1167.         > Isn't there a FAQ for this?
  1168.  
  1169.         That wasn't very helpful, Joe.
  1170.         Jane, just make a link from
  1171.         uncompress to compress.
  1172.  
  1173.     Or after "par 40qi":
  1174.  
  1175.         Joe Public writes:
  1176.         > Jane Doe writes:
  1177.         > >
  1178.         > >
  1179.         > > I can't find the source for
  1180.         > > uncompress.
  1181.         > Oh no, not again!!!
  1182.         >
  1183.         >
  1184.         > Isn't there a FAQ for this?
  1185.         >
  1186.         >
  1187.         That wasn't very helpful, Joe.
  1188.         Jane, just make a link from
  1189.         uncompress to compress.
  1190.  
  1191.     Or after "par 40qie":
  1192.  
  1193.         Joe Public writes:
  1194.         > Jane Doe writes:
  1195.         > > I can't find the source for
  1196.         > > uncompress.
  1197.         > Oh no, not again!!!
  1198.         >
  1199.         > Isn't there a FAQ for this?
  1200.         That wasn't very helpful, Joe.
  1201.         Jane, just make a link from
  1202.         uncompress to compress.
  1203.  
  1204.     Before:
  1205.  
  1206.         I sure hope there's still room
  1207.         in Dr. Jones' section of archaeology.
  1208.         I've heard he's the bestest.  [sic]
  1209.  
  1210.     After "par 50g":
  1211.  
  1212.         I sure hope there's still room in
  1213.         Dr. Jones' section of archaeology.  I've
  1214.         heard he's the bestest. [sic]
  1215.  
  1216.     Or after "par 50gc":
  1217.  
  1218.         I sure hope there's still room in
  1219.         Dr. Jones' section of archaeology.  I've
  1220.         heard he's the bestest.  [sic]
  1221.  
  1222.     Before:
  1223.  
  1224.         John writes:
  1225.         : Mary writes:
  1226.         : + Anastasia writes:
  1227.         : + > Hi all!
  1228.         : + Hi Ana!
  1229.         : Hi Ana & Mary!
  1230.         Please unsubscribe me from alt.hello.
  1231.  
  1232.     After "par Q+:+ q":
  1233.  
  1234.         John writes:
  1235.  
  1236.         : Mary writes:
  1237.         :
  1238.         : + Anastasia writes:
  1239.         : +
  1240.         : + > Hi all!
  1241.         : +
  1242.         : + Hi Ana!
  1243.         :
  1244.         : Hi Ana & Mary!
  1245.  
  1246.         Please unsubscribe me from alt.hello.
  1247.  
  1248.     Before:
  1249.  
  1250.         amc> The b option was added primarily to deal with
  1251.         amc> this new style of quotation
  1252.         amc> which became popular after Par 1.41 was released.
  1253.         amc>
  1254.         amc> Par still pays attention to body characters.
  1255.         amc> Par should not mistake "Par" for part of the prefix.
  1256.         amc> Par should not mistake "." for a suffix.
  1257.  
  1258.     After "par B=._A_a 50bg":
  1259.  
  1260.         amc> The b option was added primarily to
  1261.         amc> deal with this new style of quotation
  1262.         amc> which became popular after Par 1.41
  1263.         amc> was released.
  1264.         amc>
  1265.         amc> Par still pays attention to body
  1266.         amc> characters.  Par should not mistake
  1267.         amc> "Par" for part of the prefix.  Par
  1268.         amc> should not mistake "." for a suffix.
  1269.  
  1270.  
  1271. Limitations
  1272.  
  1273.     The <guess> feature guesses wrong in cases like the following:
  1274.  
  1275.         I calc'd the approx.
  1276.         Fermi level to 3 sig. digits.
  1277.  
  1278.     With <guess> = 1, par will incorrectly assume that "approx." ends a
  1279.     sentence.  If the input were:
  1280.  
  1281.         I calc'd the approx. Fermi
  1282.         level to 3 sig. digits.
  1283.  
  1284.     then par would refuse to put a line break between "approx." and
  1285.     "Fermi" in the output, mainly to avoid creating the first situation
  1286.     (in case the paragraph were to be fed back through par again).
  1287.     This non-breaking space policy does come in handy for cases like
  1288.     "Mr. Johnson" and "Jan. 1", though.
  1289.  
  1290.     The <guess> feature only goes one way.  par can preserve wide
  1291.     sentence breaks in a paragraph, or remove them, but it can't insert
  1292.     them if they aren't already in the input.
  1293.  
  1294.     If you use tabs, you may not like the way par handles (or doesn't
  1295.     handle) them.  It expands them into spaces.  I didn't let par output
  1296.     tabs because tabs don't make sense.  Not everyone's terminal has
  1297.     the same tab settings, so text files containing tabs are sometimes
  1298.     mangled.  In fact, almost every text file containing tabs gets
  1299.     mangled when something is inserted at the beginning of each line
  1300.     (when quoting e-mail or commenting out a section of a shell script,
  1301.     for example), making them a pain to edit.  In my opinion, the
  1302.     world would be a nicer place if everyone stopped using tabs, so
  1303.     I'm doing my part by not letting par output them.  (Thanks to
  1304.     ets1@cs.wustl.edu (Eric T. Stuebe) for showing me the light about
  1305.     tabs.)
  1306.  
  1307.     There is currently no way for the length of the output prefix to
  1308.     differ from the length of the input prefix.  Ditto for the suffix.
  1309.     I may consider adding this capability in a future release, but right
  1310.     now I'm not sure how I'd want it to work.
  1311.  
  1312.  
  1313. Apologies
  1314.  
  1315.     Par began in July 1993 as a small program designed to do one narrow
  1316.     task: reformat a single paragraph that might have a border on either
  1317.     side.  It was pretty clean back then.  Over the next three months,
  1318.     it very rapidly expanded to handle multiple paragraphs, offer more
  1319.     options, and take better guesses, at the cost of becoming extremely
  1320.     complex, and very unclean.  It is nowhere near the optimal design
  1321.     for the larger task it now tries to address.  Its only redeeming
  1322.     features are that it is extremely useful (I find it indispensable),
  1323.     extremely portable, and very stable (between the release of version
  1324.     1.41 on 31 Oct 1993 and the release of version 1.50 on 11 Feb 1996,
  1325.     no bugs were reported).
  1326.  
  1327.     Back in 1993 I had very little experience at writing documentation
  1328.     for users, so the documentation for Par became rather nightmarish.
  1329.     There is no separation between how-it-works (which is painfully
  1330.     complex) and how-to-use-it (which is fairly simple, if you can ever
  1331.     figure it out).
  1332.  
  1333.     Someday I ought to reexamine the problem, and redesign a new, clean
  1334.     solution from scratch.  I don't know when I might get enough free
  1335.     time to start on such a project.  Text files may be obsolete by
  1336.     then.
  1337.  
  1338.  
  1339. Bugs
  1340.  
  1341.     If I knew of any bugs, I wouldn't release the package.  Of course,
  1342.     there may be bugs that I haven't yet discovered.
  1343.  
  1344.     If you find any bugs (in the program or in the documentation), or if
  1345.     you have any suggestions, please send e-mail to:
  1346.  
  1347.         amc@cs.wustl.edu
  1348.  
  1349.     or send paper mail to:
  1350.  
  1351.         Adam M. Costello
  1352.         Campus Box 1115
  1353.         Washington University
  1354.         One Brookings Dr.
  1355.         St. Louis, MO 63130-4899
  1356.         USA
  1357.  
  1358.     When reporting a bug, please include the exact input and command
  1359.     line options used, and the version number of par, so that I can
  1360.     reproduce it.
  1361.  
  1362.     The latest release of Par is available on the Web at:
  1363.  
  1364.         http://www.cs.wustl.edu/~amc/Par/
  1365.  
  1366.     Note that all of these addresses could change anytime after August
  1367.     1996.  I'll try to leave forward pointers.
  1368.