home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / par / part02 < prev    next >
Encoding:
Text File  |  1993-11-09  |  57.3 KB  |  2,196 lines

  1. Newsgroups: comp.sources.misc
  2. From: amc@wuecl.wustl.edu (Adam Costello)
  3. Subject: v40i125:  par - paragraph reformatter, v1.41, Part02/03
  4. Message-ID: <1993Nov9.184144.1091@sparky.sterling.com>
  5. X-Md4-Signature: 643af4d61bf38e66862669fb628d279d
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Tue, 9 Nov 1993 18:41:44 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: amc@wuecl.wustl.edu (Adam Costello)
  12. Posting-number: Volume 40, Issue 125
  13. Archive-name: par/part02
  14. Environment: ANSI-C
  15. Supersedes: par131: Volume 39, Issue 83-85
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of shell archive."
  24. # Contents:  Par141 Par141/protoMakefile Par141/charset.c Par141/par.1
  25. # Wrapped by amc@siesta on Sun Oct 31 01:25:36 1993
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test ! -d 'Par141' ; then
  28.     echo shar: Creating directory \"'Par141'\"
  29.     mkdir 'Par141'
  30. fi
  31. if test -f 'Par141/protoMakefile' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'Par141/protoMakefile'\"
  33. else
  34. echo shar: Extracting \"'Par141/protoMakefile'\" \(2663 characters\)
  35. sed "s/^X//" >'Par141/protoMakefile' <<'END_OF_FILE'
  36. X# *********************
  37. X# * protoMakefile     *
  38. X# * for Par 1.41      *
  39. X# * Copyright 1993 by *
  40. X# * Adam M. Costello  *
  41. X# *********************
  42. X
  43. X
  44. X#####
  45. X##### Instructions
  46. X#####
  47. X
  48. X# If you have no make command (or equivalent), you can easily tell by
  49. X# looking at this file what make would do.  It would compile each .c file
  50. X# into a .o file, then link all the .o files into the executable par.  You
  51. X# can do this manually.  Then you should go look for a version of make for
  52. X# your system, since it will come in handy in the future.
  53. X
  54. X# If you do have make, you can either copy this file to Makefile, edit the
  55. X# definitions of CC, LINK1, LINK2, RM, and JUNK, and then run make; or,
  56. X# better yet, create a short script which looks something like:
  57. X#
  58. X# #!/bin/sh
  59. X# make -f protoMakefile CC="cc -c" LINK1="cc" LINK2="-o" RM="rm" JUNK="" $*
  60. X#
  61. X# (Alter this to use commands and values appropriate for your compiler
  62. X# and shell).  The advantage of the second method is that the script will
  63. X# probably work on the next release of Par.
  64. X
  65. X#####
  66. X##### Configuration
  67. X#####
  68. X
  69. X# Define CC so that the command
  70. X#
  71. X# $(CC) foo.c
  72. X#
  73. X# compiles the ANSI C source file "foo.c" into the object file "foo.o".  You
  74. X# may assume that foo.c uses no floating point math.
  75. X#
  76. X# If your operating system or your compiler's exit() function automatically
  77. X# frees all memory allocated by malloc() when a process terminates, then you
  78. X# can choose to trade away space efficiency for time efficiency by defining
  79. X# DONTFREE.
  80. X#
  81. X# Example (for Solaris 2.2):
  82. X# CC = cc -c -O -s -Xc -DDONTFREE
  83. X
  84. XCC =
  85. X
  86. X# Define LINK1 and LINK2 so that the command
  87. X#
  88. X# $(LINK1) foo1.o foo2.o foo3.o $(LINK2) foo
  89. X#
  90. X# links the object files "foo1.o", "foo2.o", "foo3.o" into the executable
  91. X# file "foo".  You may assume that none of the .o files use floating point
  92. X# math.
  93. X#
  94. X# Example (for Solaris 2.2):
  95. X# LINK1 = cc -s
  96. X# LINK2 = -o
  97. X
  98. XLINK1 =
  99. XLINK2 =
  100. X
  101. X# Define RM so that the command
  102. X#
  103. X# $(RM) foo1 foo2 foo3
  104. X#
  105. X# removes the files "foo1", "foo2", and "foo3", and preferrably doesn't
  106. X# complain if they don't exist.
  107. X#
  108. X# Example (for Solaris 2.2):
  109. X# RM = rm -f
  110. X
  111. XRM =
  112. X
  113. X# Define JUNK to be a list of additional files, other than par and $(OBJS),
  114. X# that you want to be removed by "make clean".
  115. X
  116. XJUNK =
  117. X
  118. X#####
  119. X##### Guts (you shouldn't need to touch this part)
  120. X#####
  121. X
  122. XOBJS = buffer.o charset.o errmsg.o par.o reformat.o
  123. X
  124. X.c.o:
  125. X    $(CC) $<
  126. X
  127. Xpar: $(OBJS)
  128. X    $(LINK1) $(OBJS) $(LINK2) par
  129. X
  130. Xbuffer.o: buffer.c buffer.h errmsg.h
  131. X
  132. Xcharset.o: charset.c charset.h errmsg.h buffer.h
  133. X
  134. Xerrmsg.o: errmsg.c errmsg.h
  135. X
  136. Xpar.o: par.c charset.h errmsg.h buffer.h reformat.h
  137. X
  138. Xreformat.o: reformat.c reformat.h errmsg.h buffer.h
  139. X
  140. Xclean:
  141. X    $(RM) par $(OBJS) $(JUNK)
  142. END_OF_FILE
  143. if test 2663 -ne `wc -c <'Par141/protoMakefile'`; then
  144.     echo shar: \"'Par141/protoMakefile'\" unpacked with wrong size!
  145. fi
  146. # end of 'Par141/protoMakefile'
  147. fi
  148. if test -f 'Par141/charset.c' -a "${1}" != "-c" ; then 
  149.   echo shar: Will not clobber existing file \"'Par141/charset.c'\"
  150. else
  151. echo shar: Extracting \"'Par141/charset.c'\" \(7439 characters\)
  152. sed "s/^X//" >'Par141/charset.c' <<'END_OF_FILE'
  153. X/*********************/
  154. X/* charset.c         */
  155. X/* for Par 1.41      */
  156. X/* Copyright 1993 by */
  157. X/* Adam M. Costello  */
  158. X/*********************/
  159. X
  160. X/* This is ANSI C code. */
  161. X
  162. X
  163. X/* Because this is ANSI C code, we can't assume that there are only 256 */
  164. X/* characters.  Therefore, we can't use bit vectors to represent sets   */
  165. X/* without the risk of consuming large amounts of memory.  Therefore,   */
  166. X/* this code is much more complicated than might be expected.           */
  167. X
  168. X
  169. X#include "charset.h"  /* Makes sure we're consistent with the.  */
  170. X                      /* prototypes.  Also includes "errmsg.h". */
  171. X#include "buffer.h"   /* Also includes <stddef.h>.              */
  172. X
  173. X#include <ctype.h>
  174. X#include <string.h>
  175. X#include <stdlib.h>
  176. X#include <stdio.h>
  177. X
  178. X
  179. X#undef NULL
  180. X#define NULL ((void *) 0)
  181. X
  182. X#ifdef DONTFREE
  183. X#define free(ptr)
  184. X#endif
  185. X
  186. X
  187. Xtypedef unsigned char csflag_t;
  188. X
  189. Xstruct charset {
  190. X  char *inlist;    /* Characters in inlist are in the set.                */
  191. X  char *outlist;   /* Characters in outlist are not in the set.           */
  192. X                   /* inlist and outlist must have no common characters.  */
  193. X                   /* inlist and outlist may be NULL, which acts like "". */
  194. X  csflag_t flags;  /* Characters in neither list are in the set if they   */
  195. X                   /* belong to any of the classes indicated by flags.    */
  196. X};
  197. X
  198. X/* The following may be bitwise-OR'd together */
  199. X/* to set the flags field of a charset:       */
  200. X
  201. Xstatic const csflag_t CS_UCASE = 1,  /* Includes all upper case letters. */
  202. X                      CS_LCASE = 2,  /* Includes all lower case letters. */
  203. X                      CS_DIGIT = 4,  /* Includes all decimal digits.     */
  204. X                      CS_NUL   = 8;  /* Includes the NUL character.      */
  205. X
  206. X
  207. Xstatic int appearsin(char c, const char *str)
  208. X
  209. X/* Returns 0 if c is '\0' or str is NULL or c     */
  210. X/* does not appear in *str.  Otherwise returns 1. */
  211. X{
  212. X  return c && str && strchr(str,c);
  213. X}
  214. X
  215. X
  216. Xstatic int hexdigtoint(char c)
  217. X
  218. X/* Returns the value represented by the hexadecimal */
  219. X/* digit c, or -1 if c is not a hexadecimal digit.  */
  220. X{
  221. X  const char *p, * const hexdigits = "0123456789ABCDEF";
  222. X
  223. X  if (!c) return -1;
  224. X  p = strchr(hexdigits, toupper(c));
  225. X  return p ? p - hexdigits : -1;
  226. X
  227. X  /* We can't do things like c - '0' or c - 'A' because we can't depend     */
  228. X  /* on the order of the characters in ANSI C.  Nor can we do things like   */
  229. X  /* hexdigtoint[c] because we don't know how large such an array might be. */
  230. X}
  231. X
  232. X
  233. Xcharset *parsecharset(const char *str, errmsg_t errmsg)
  234. X{
  235. X  charset *cset = NULL;
  236. X  buffer *cbuf = NULL;
  237. X  const char *p, * const singleescapes = "_sbqQx";
  238. X  int hex1, hex2;
  239. X  char ch;
  240. X
  241. X  cset = malloc(sizeof (charset));
  242. X  if (!cset) {
  243. X    strcpy(errmsg,outofmem);
  244. X    goto pcserror;
  245. X  }
  246. X  cset->inlist = cset->outlist = NULL;
  247. X  cset->flags = 0;
  248. X
  249. X  cbuf = newbuffer(sizeof (char), errmsg);
  250. X  if (*errmsg) goto pcserror;
  251. X
  252. X  for (p = str;  *p;  ++p)
  253. X    if (*p == '_') {
  254. X      ++p;
  255. X      if (appearsin(*p, singleescapes)) {
  256. X        if      (*p == '_') ch = '_' ;
  257. X        else if (*p == 's') ch = ' ' ;
  258. X        else if (*p == 'b') ch = '\\';
  259. X        else if (*p == 'q') ch = '\'';
  260. X        else if (*p == 'Q') ch = '\"';
  261. X        else /*  *p == 'x'  */ {
  262. X          hex1 = hexdigtoint(p[1]);
  263. X          hex2 = hexdigtoint(p[2]);
  264. X          if (hex1 < 0  ||  hex2 < 0) goto pcsbadstr;
  265. X          ch = 16 * hex1 + hex2;
  266. X          p += 2;
  267. X        }
  268. X        if (!ch)
  269. X          cset->flags |= CS_NUL;
  270. X        else {
  271. X          additem(cbuf, &ch, errmsg);
  272. X          if (*errmsg) goto pcserror;
  273. X        }
  274. X      }
  275. X      else {
  276. X        if      (*p == 'A') cset->flags |= CS_UCASE;
  277. X        else if (*p == 'a') cset->flags |= CS_LCASE;
  278. X        else if (*p == '0') cset->flags |= CS_DIGIT;
  279. X        else goto pcsbadstr;
  280. X      }
  281. X    }
  282. X    else {
  283. X      additem(cbuf,p,errmsg);
  284. X      if (*errmsg) goto pcserror;
  285. X    }
  286. X  ch = '\0';
  287. X  additem(cbuf, &ch, errmsg);
  288. X  if (*errmsg) goto pcserror;
  289. X  cset->inlist = copyitems(cbuf,errmsg);
  290. X  if (*errmsg) goto pcserror;
  291. X
  292. Xpcscleanup:
  293. X
  294. X  if (cbuf) freebuffer(cbuf);
  295. X  return cset;
  296. X
  297. Xpcsbadstr:
  298. X
  299. X  sprintf(errmsg, "Bad charset syntax: %.*s\n", errmsg_size - 22, str);
  300. X
  301. Xpcserror:
  302. X
  303. X  if (cset) freecharset(cset);
  304. X  cset = NULL;
  305. X  goto pcscleanup;
  306. X}
  307. X
  308. X
  309. Xvoid freecharset(charset *cset)
  310. X{
  311. X  if (cset->inlist) free(cset->inlist);
  312. X  if (cset->outlist) free(cset->outlist);
  313. X  free(cset);
  314. X}
  315. X
  316. X
  317. Xint csmember(char c, const charset *cset)
  318. X{
  319. X  return    appearsin(c, cset->inlist)
  320. X         ||    !appearsin(c, cset->outlist)
  321. X            && (    cset->flags & CS_LCASE && islower(c)
  322. X                ||  cset->flags & CS_UCASE && isupper(c)
  323. X                ||  cset->flags & CS_DIGIT && isdigit(c)
  324. X                ||  cset->flags & CS_NUL   && !c         );
  325. X}
  326. X
  327. X
  328. Xstatic charset *csud(
  329. X  int u, const charset *cset1, const charset *cset2, errmsg_t errmsg
  330. X)
  331. X/* Returns the union of cset1 and cset2 if u is 1, or the set    */
  332. X/* difference cset1 - cset2 if u is 0.  Returns NULL on failure. */
  333. X{
  334. X  charset *csu;
  335. X  buffer *inbuf = NULL, *outbuf = NULL;
  336. X  char *lists[4], **list, *p, nullchar = '\0';
  337. X
  338. X  csu = malloc(sizeof (charset));
  339. X  if (!csu) {
  340. X    strcpy(errmsg,outofmem);
  341. X    goto csuderror;
  342. X  }
  343. X  inbuf = newbuffer(sizeof (char), errmsg);
  344. X  if (*errmsg) goto csuderror;
  345. X  outbuf = newbuffer(sizeof (char), errmsg);
  346. X  if (*errmsg) goto csuderror;
  347. X  csu->inlist = csu->outlist = NULL;
  348. X  csu->flags =  u  ?  cset1->flags |  cset2->flags
  349. X                   :  cset1->flags & ~cset2->flags;
  350. X
  351. X  lists[0] = cset1->inlist;
  352. X  lists[1] = cset1->outlist;
  353. X  lists[2] = cset2->inlist;
  354. X  lists[3] = cset2->outlist;
  355. X
  356. X  for (list = lists;  list < lists + 4;  ++list)
  357. X    if (*list)
  358. X      for (p = *list;  *p;  ++p)
  359. X        if (u  ?  csmember(*p, cset1) ||  csmember(*p, cset2)
  360. X               :  csmember(*p, cset1) && !csmember(*p, cset2)) {
  361. X          if (!csmember(*p, csu)) {
  362. X            additem(inbuf,p,errmsg);
  363. X            if (*errmsg) goto csuderror;
  364. X          }
  365. X        }
  366. X        else
  367. X          if (csmember(*p, csu)) {
  368. X            additem(outbuf,p,errmsg);
  369. X            if (*errmsg) goto csuderror;
  370. X          }
  371. X
  372. X  additem(inbuf, &nullchar, errmsg);
  373. X  if (*errmsg) goto csuderror;
  374. X  additem(outbuf, &nullchar, errmsg);
  375. X  if (*errmsg) goto csuderror;
  376. X  csu->inlist = copyitems(inbuf,errmsg);
  377. X  if (*errmsg) goto csuderror;
  378. X  csu->outlist = copyitems(outbuf,errmsg);
  379. X  if (*errmsg) goto csuderror;
  380. X
  381. Xcsudcleanup:
  382. X
  383. X  if (inbuf) freebuffer(inbuf);
  384. X  if (outbuf) freebuffer(outbuf);
  385. X  return csu;
  386. X
  387. Xcsuderror:
  388. X
  389. X  if (csu) freecharset(csu);
  390. X  csu = NULL;
  391. X  goto csudcleanup;
  392. X}
  393. X
  394. X
  395. Xcharset *csunion(const charset *cset1, const charset *cset2, errmsg_t errmsg)
  396. X{
  397. X  return csud(1,cset1,cset2,errmsg);
  398. X}
  399. X
  400. X
  401. Xcharset *csdiff(const charset *cset1, const charset *cset2, errmsg_t errmsg)
  402. X{
  403. X  return csud(0,cset1,cset2,errmsg);
  404. X}
  405. X
  406. X
  407. Xvoid csadd(charset *cset1, const charset *cset2, errmsg_t errmsg)
  408. X{
  409. X  charset *csu;
  410. X
  411. X  csu = csunion(cset1,cset2,errmsg);
  412. X  if (*errmsg) return;
  413. X  csswap(csu,cset1);
  414. X  freecharset(csu);
  415. X}
  416. X
  417. X
  418. Xvoid csremove(charset *cset1, const charset *cset2, errmsg_t errmsg)
  419. X{
  420. X  charset *csu;
  421. X
  422. X  csu = csdiff(cset1,cset2,errmsg);
  423. X  if (*errmsg) return;
  424. X  csswap(csu,cset1);
  425. X  freecharset(csu);
  426. X}
  427. X
  428. X
  429. Xcharset *cscopy(const charset *cset, errmsg_t errmsg)
  430. X{
  431. X  charset emptycharset = { NULL, NULL, 0 };
  432. X
  433. X  return csunion(cset, &emptycharset, errmsg);
  434. X}
  435. X
  436. X
  437. Xvoid csswap(charset *cset1, charset *cset2)
  438. X{
  439. X  charset tmp;
  440. X
  441. X  tmp = *cset1;
  442. X  *cset1 = *cset2;
  443. X  *cset2 = tmp;
  444. X}
  445. END_OF_FILE
  446. if test 7439 -ne `wc -c <'Par141/charset.c'`; then
  447.     echo shar: \"'Par141/charset.c'\" unpacked with wrong size!
  448. fi
  449. # end of 'Par141/charset.c'
  450. fi
  451. if test -f 'Par141/par.1' -a "${1}" != "-c" ; then 
  452.   echo shar: Will not clobber existing file \"'Par141/par.1'\"
  453. else
  454. echo shar: Extracting \"'Par141/par.1'\" \(43989 characters\)
  455. sed "s/^X//" >'Par141/par.1' <<'END_OF_FILE'
  456. X.\"*********************
  457. X.\"* par.1             *
  458. X.\"* for Par 1.41      *
  459. X.\"* Copyright 1993 by *
  460. X.\"* Adam M. Costello  *
  461. X.\"*********************
  462. X.\"
  463. X.\" This is nroff -man (or troff -man) code.
  464. X.\"
  465. X.TH par 1 "31 October 1993" "Par 1.41" "USER COMMANDS"
  466. X.SH NAME
  467. Xpar \- filter for reformatting paragraphs
  468. X.SH SYNOPSIS
  469. X.ds O \fR[\fP
  470. X.ds C \fR]\fP
  471. X.de OP
  472. X.BI \*O\ \\$1 \\$2\ \*C
  473. X..
  474. X.TP .5i
  475. X.B par
  476. X.na
  477. X.OP help
  478. X.OP version
  479. X.OP B opset
  480. X.OP P opset
  481. X.OP Q opset
  482. X.OP h \*Ohang\*C
  483. X.OP p \*Oprefix\*C
  484. X.OP r \*Orepeat\*C
  485. X.OP s \*Osuffix\*C
  486. X.OP w \*Owidth\*C
  487. X.OP c \*Ocap\*C
  488. X.OP d \*Odiv\*C
  489. X.OP E \*OErr\*C
  490. X.OP e \*Oexpel\*C
  491. X.OP f \*Ofit\*C
  492. X.OP g \*Oguess\*C
  493. X.OP j \*Ojust\*C
  494. X.OP l \*Olast\*C
  495. X.OP q \*Oquote\*C
  496. X.OP R \*OReport\*C
  497. X.OP t \*Otouch\*C
  498. X.br
  499. X.ad
  500. X.SH DESCRIPTION
  501. X.ie t .ds Q ``
  502. X.el .ds Q ""
  503. X.ie t .ds U ''
  504. X.el .ds U ""
  505. X.de IT
  506. X.LP
  507. X\h'-\w'\\$1\ 'u'\\$1\ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  508. X..
  509. X.LP
  510. X.B par
  511. Xis a filter which copies its input to its output, changing
  512. Xall white characters (except newlines) to spaces, and
  513. Xreformatting each paragraph.  Paragraphs are separated
  514. Xby protected, blank, and bodiless lines (see the
  515. X.SM TERMINOLOGY
  516. Xsection for definitions), and optionally
  517. Xdelimited by indentation (see the
  518. X.B d
  519. Xoption in the
  520. X.SM OPTIONS
  521. Xsection).
  522. X.LP
  523. XEach output paragraph is generated from the
  524. Xcorresponding input paragraph as follows:
  525. X.RS
  526. X.LP
  527. X.IT 1) An optional prefix and/or suffix
  528. Xis removed from each input line.
  529. X.IT 2) The remainder is divided into
  530. Xwords (separated by spaces).
  531. X.IT 3) The words are joined into lines
  532. Xto make an eye-pleasing paragraph.
  533. X.IT 4) The prefixes and suffixes are reattached.
  534. X.RE
  535. X.LP
  536. XIf there are suffixes, spaces are inserted before
  537. Xthem so that they all end in the same column.
  538. X.SH QUICK START
  539. X.LP
  540. X.B par
  541. Xis necessarily complex.  For those who wish to
  542. Xuse it immediately and understand it later,
  543. Xassign the following environment variables:
  544. X.TP "\w'PARQUOTE 'u"
  545. X.SM PARBODY
  546. X= ._A_a
  547. X.TP
  548. X.SM PARINIT
  549. X= Rgqr
  550. X.TP
  551. X.SM PARQUOTE
  552. X= _s>|
  553. X.LP
  554. XThe greater-than sign and the vertical bar in the value of
  555. X.SM PARQUOTE
  556. Xwill probably have to be escaped or quoted to
  557. Xprevent your shell from interpreting them.
  558. X.SH TERMINOLOGY
  559. X.LP
  560. XMiscellaneous terms:
  561. X.RS
  562. X.IP "charset syntax"
  563. XA way of representing a set of characters as a string.
  564. XThe set includes exactly those characters which
  565. Xappear in the string, except that the underscore (_)
  566. Xis an escape character.  Whenever it appears, it
  567. Xmust begin one of the following escape sequences:
  568. X.RS 1.5i
  569. X.IT __\ = an underscore
  570. X.IT _s\ = a space
  571. X.IT _b\ = a backslash (\e)
  572. X.IT _q\ = a single quote (')
  573. X.IT _Q\ = a double quote (")
  574. X.IT _A\ = all upper case letters
  575. X.IT _a\ = all lower case letters
  576. X.IT _0\ = all decimal digits
  577. X.IT _x\fIhh\fP\ = the character represented
  578. Xby the two hexadecimal digits
  579. X.I hh
  580. X(which may be upper or lower case)
  581. X.RE
  582. X.IP
  583. XThe NUL character must not appear in the string, but
  584. Xit may be included in the set with the _x00 sequence.
  585. X.IP error
  586. XA condition which causes
  587. X.B par
  588. Xto abort.  See the
  589. X.SM DIAGNOSTICS
  590. Xsection.
  591. X.IP IP
  592. XInput paragraph.
  593. X.IP OP
  594. XOutput paragraph.
  595. X.IP parameter
  596. XA symbol which may take on unsigned integral values.  There
  597. Xare several parameters whose values affect the behavior of
  598. X.BR par .
  599. XParameters can be assigned values
  600. Xusing command line options.
  601. X.RE
  602. X.LP
  603. XTypes of characters:
  604. X.RS
  605. X.IP "alphanumeric character"
  606. XAn upper case letter, lower case letter, or decimal digit.
  607. X.IP "body character"
  608. XA member of the set of characters defined by the
  609. X.SM PARBODY
  610. Xenvironment variable (see the
  611. X.SM ENVIRONMENT
  612. Xsection).
  613. X.IP "protective character"
  614. XA member  of the set of characters defined by the
  615. X.SM PARPROTECT
  616. Xenvironment variable (see the
  617. X.SM ENVIRONMENT
  618. Xsection).
  619. X.IP "quote character"
  620. XA member of the set of characters defined by the
  621. X.SM PARQUOTE
  622. Xenvironment variable (see the
  623. X.SM ENVIRONMENT
  624. Xsection).
  625. X.IP "terminal character"
  626. XA period, question mark, exclamation point, or colon.
  627. X.IP "white character"
  628. XA space, formfeed, newline, carriage
  629. Xreturn, tab, or vertical tab.
  630. X.RE
  631. X.LP
  632. XFunctions:
  633. X.RS
  634. X.IP comprelen
  635. XThe comprelen of a non-empty sequence of lines is the
  636. Xlength of the longest string of non-body characters
  637. Xappearing at the beginning of every line in the set.
  638. X.IP comsuflen
  639. XGiven a non-empty sequence
  640. X.I S
  641. Xof lines, let
  642. X.I p
  643. Xbe the comprelen of
  644. X.IR S .
  645. XLet
  646. X.I T
  647. Xbe the set of lines which result from stripping the first
  648. X.I p
  649. Xcharacters from each line in
  650. X.IR S .
  651. XLet
  652. X.I c
  653. Xbe the longest string of non-body characters
  654. Xappearing at the end of every line in
  655. X.IR T .
  656. XStrip
  657. X.I c
  658. Xof all initial spaces except the last.  The length of
  659. X.I c
  660. Xis the comsuflen of
  661. X.IR S .
  662. X.IP "fallback prelen (suflen)"
  663. XThe fallback prelen (suflen) of an IP is: the comprelen
  664. X(comsuflen) of the IP, if the IP contains at least two
  665. Xlines; otherwise, the comprelen (comsuflen) of the
  666. Xblock containing the IP, if the block contains at least
  667. Xtwo lines; otherwise, the length of the longer of the
  668. Xprefixes (suffixes) of the bodiless lines just above and
  669. Xbelow the block, if the segment containing the block
  670. Xhas any bodiless lines; otherwise, 0.  (See below for
  671. Xthe definitions of block, segment, and bodiless line.)
  672. X.IP "augmented fallback prelen"
  673. XLet
  674. X.I fp
  675. Xbe the fallback prelen of an IP.  If the
  676. XIP contains more than one line, or if
  677. X.I quote
  678. Xis 0, then the augmented fallback prelen of the IP is simply
  679. X.IR fp .
  680. XOtherwise, it is
  681. X.I fp
  682. Xplus the number of quote characters
  683. Ximmediately following the first
  684. X.I fp
  685. Xcharacters of the line.
  686. X.IP quoteprefix
  687. XThe quoteprefix of a line is the longest string of quote
  688. Xcharacters appearing at the beginning of the line, after
  689. Xthis string has been stripped of any trailing spaces.
  690. X.RE
  691. X.LP
  692. XTypes of lines:
  693. X.RS
  694. X.IP "blank line"
  695. XAn empty line, or a line whose first character is
  696. Xnot protective and which contains only spaces.
  697. X.IP "protected line"
  698. XAn input line whose first character is protective.
  699. X.IP "bodiless line"
  700. XA line which is order k bodiless for some k.
  701. X.IP "order \fIk\fP bodiless line"
  702. XThere is no such thing as an order 0 bodiless line.  Suppose
  703. X.I S
  704. Xis a a contiguous subsequence of a segment (see below)
  705. Xcontaining at least two lines, containing no order
  706. X.IR k \-1
  707. Xbodiless lines, bounded above and below by order
  708. X.IR k \-1
  709. Xbodiless lines and/or the beginning/end of the segment.  Let
  710. X.I p
  711. Xand
  712. X.I s
  713. Xbe the comprelen and comsuflen of
  714. X.IR S .
  715. XAny member of
  716. X.I S
  717. Xwhich, if stripped of its first
  718. X.I p
  719. Xand last
  720. X.I s
  721. Xcharacters, would be blank (or, if the parameter
  722. X.I repeat
  723. Xis non-zero, would consist of the
  724. Xsame character repeated at least
  725. X.I repeat
  726. Xtimes), is order
  727. X.I k
  728. Xbodiless.  The first
  729. X.I p
  730. Xcharacters of the bodiless line
  731. Xcomprise its prefix; the last
  732. X.I s
  733. Xcharacters comprise its suffix.  The character which repeats
  734. Xin the middle is called its repeat character.  If the middle
  735. Xis empty, the space is taken to be its repeat character.
  736. X.IP "vacant line"
  737. XA bodiless line whose repeat character is the space.
  738. X.IP "superfluous line"
  739. XOnly blank and vacant lines may be superfluous.  If
  740. Xcontiguous vacant lines lie at the beginning or end
  741. Xof a segment, they are all superfluous.  But if they
  742. Xlie between two non-vacant lines within a segment,
  743. Xthen all are superfluous except one\(emthe one which
  744. Xcontains the fewest non-spaces.  In case of a tie,
  745. Xthe first of the tied lines is chosen.  Similarly, if
  746. Xcontiguous blank lines lie outside of any segments
  747. Xat the beginning or end of the input, they are all
  748. Xsuperfluous.  But if they lie between two segments and/or
  749. Xprotected lines, then all are superfluous except the first.
  750. X.RE
  751. X.LP
  752. XGroups of lines:
  753. X.RS
  754. X.IP segment
  755. XA contiguous sequence of input lines containing no protected
  756. Xor blank lines, bounded above and below by protected
  757. Xlines, blank lines, and/or the beginning/end of the input.
  758. X.IP block
  759. XA contiguous subsequence of a segment containing no
  760. Xbodiless lines, bounded above and below by bodiless
  761. Xlines and/or the beginning/end of the segment.
  762. X.RE
  763. X.LP
  764. XTypes of words:
  765. X.RS
  766. X.IP "capitalized word"
  767. XIf the parameter
  768. X.I cap
  769. Xis 0, a capitalized word is one which contains
  770. Xat least one alphanumeric character, whose first
  771. Xalphanumeric character is not a lower case letter.  If
  772. X.I cap
  773. Xis 1, every word is considered a capitalized word.  (See the
  774. X.B c
  775. Xoption in the
  776. X.SM OPTIONS
  777. Xsection.)
  778. X.IP "curious word"
  779. XA word which contains a terminal character
  780. X.I c
  781. Xsuch that there are no alphanumeric
  782. Xcharacters in the word after
  783. X.IR c ,
  784. Xbut there is at least one alphanumeric
  785. Xcharacter in the word before
  786. X.IR c .
  787. X.RE
  788. X.SH OPTIONS
  789. X.LP
  790. XAny command line argument may begin with one minus
  791. Xsign (\-) which is ignored.  Generally, more
  792. Xthan one option may appear in a single command
  793. Xline argument, but there are exceptions:  The
  794. X.BR help ,
  795. X.BR version ,
  796. X.BR B ,
  797. X.BR P ,
  798. Xand
  799. X.B Q
  800. Xoptions must have whole arguments all to themselves.
  801. X.TP 1i
  802. X.B help
  803. XCauses all remaining arguments to be ignored.  No
  804. Xinput is read.  A usage message is printed on the
  805. Xoutput briefly describing the options used by
  806. X.BR par .
  807. X.TP
  808. X.B version
  809. XCauses all remaining arguments to be ignored.  No input
  810. Xis read.  \*Qpar 1.41\*U is printed on the output.  Of
  811. Xcourse, this will change in future releases of Par.
  812. X.TP
  813. X.BI B opset
  814. X.I op
  815. Xis a single character, either an equal sign
  816. X(=), a plus sign (+), or a minus sign (-).
  817. X.I set
  818. Xis a string using charset syntax.  If
  819. X.I op
  820. Xis an equal sign, the set of body characters
  821. Xis set to the character set defined by
  822. X.IR set .
  823. XIf
  824. X.I op
  825. Xis a plus/minus sign, the characters in the set defined by
  826. X.I set
  827. Xare added/removed to/from the existing
  828. Xset of body characters defined by the
  829. X.SM PARBODY
  830. Xenvironment variable and any previous B options.  It
  831. Xis okay to add characters that are already in the
  832. Xset or to remove characters that are not in the set.
  833. X.TP
  834. X.BI P opset
  835. XJust like the
  836. X.B B
  837. Xoption, except that it applies to
  838. Xthe set of protective characters.
  839. X.TP
  840. X.BI Q opset
  841. XJust like the
  842. X.B B
  843. Xoption, except that it applies
  844. Xto the set of quote characters.
  845. X.LP
  846. XAll remaining options are used to set values of
  847. Xparameters.  Values set by command line options hold for all
  848. Xparagraphs.  Unset parameters are given default values.  Any
  849. Xparameters whose default values depend on the IP (namely
  850. X.I prefix
  851. Xand
  852. X.IR suffix ),
  853. Xif left unset, are recomputed separately for each paragraph.
  854. X.LP
  855. XThe approximate role of each
  856. Xvariable is described here.  See the
  857. X.SM DETAILS
  858. Xsection for the rest of the story.
  859. X.LP
  860. XThe first five parameters,
  861. X.IR hang ,
  862. X.IR prefix ,
  863. X.IR repeat ,
  864. X.IR suffix ,
  865. Xand
  866. X.IR width ,
  867. Xmay be set to any unsigned decimal integer less than 10000.
  868. X.TP 1i
  869. X.BI h\fR[ hang\fR]
  870. XMainly affects the default values of
  871. X.I prefix
  872. Xand
  873. X.IR suffix .
  874. XDefaults to 0.  If the
  875. X.B h
  876. Xoption is given without a number, the
  877. Xvalue 1 is inferred.  (See also the
  878. X.B p
  879. Xand
  880. X.B s
  881. Xoptions.)
  882. X.TP
  883. X.BI p\fR[ prefix\fR]
  884. XThe first
  885. X.I prefix
  886. Xcharacters of each line of the OP are copied from the first
  887. X.I prefix
  888. Xcharacters of the corresponding line
  889. Xof the IP.  If there are more than
  890. X.IR hang +1
  891. Xlines in the IP, the default value is the comprelen
  892. Xof all the lines in the IP except the first
  893. X.I hang
  894. Xof them.  Otherwise, the default value is the
  895. Xaugmented fallback prelen of the IP.  If the
  896. X.B p
  897. Xoption is given without a number,
  898. X.I prefix
  899. Xis unset, even if it had been set earlier.  (See also the
  900. X.B h
  901. Xand
  902. X.B q
  903. Xoptions.)
  904. X.TP
  905. X.BI r\fR[ repeat\fR]
  906. XIf
  907. X.I repeat
  908. Xis non-zero, bodiless lines have the number of
  909. Xinstances of their repeat characters increased
  910. Xor decreased until the length of the line is
  911. X.IR width .
  912. XThe exact value of
  913. X.I repeat
  914. Xaffects the definition of bodiless
  915. Xline.  Defaults to 0.  If the
  916. X.B r
  917. Xoption is given without a number, the
  918. Xvalue 3 is inferred.  (See also the
  919. X.B w
  920. Xoption.)
  921. X.TP
  922. X.BI s\fR[ suffix\fR]
  923. XThe last
  924. X.I suffix
  925. Xcharacters of each line of the OP are copied from the last
  926. X.I suffix
  927. Xcharacters of the corresponding line
  928. Xof the IP.  If there are more than
  929. X.IR hang +1
  930. Xlines in the IP, the default value is the comsuflen
  931. Xof all the lines of the IP except the first
  932. X.I hang
  933. Xof them.  Otherwise, the default value is
  934. Xthe fallback suflen of the IP.  If the
  935. X.B s
  936. Xoption is given without a number,
  937. X.I suffix
  938. Xis unset, even if it had been set earlier.  (See also the
  939. X.B h
  940. Xoption.)
  941. X.TP
  942. X.BI w\fR[ width\fR]
  943. XNo line in the OP may contain more than
  944. X.I width
  945. Xcharacters, not including the trailing
  946. Xnewlines.  Defaults to 72.  If the
  947. X.B w
  948. Xoption is given without a number, the value 79 is inferred.
  949. X.LP
  950. XThe remaining twelve parameters,
  951. X.IR cap ,
  952. X.IR div ,
  953. X.IR Err ,
  954. X.IR expel ,
  955. X.IR fit ,
  956. X.IR guess ,
  957. X.IR invis ,
  958. X.IR just ,
  959. X.IR last ,
  960. X.IR quote ,
  961. X.IR Report ,
  962. Xand
  963. X.IR touch ,
  964. Xmay be set to either 0 or 1.  If the number is
  965. Xabsent in the option, the value 1 is inferred.
  966. X.TP 1i
  967. X.BI c\fR[ cap\fR]
  968. XIf
  969. X.I cap
  970. Xis 1, all words are considered capitalized.  This
  971. Xcurrently affects only the application of the
  972. X.B g
  973. Xoption.  Defaults to 0.
  974. X.TP
  975. X.BI d\fR[ div\fR]
  976. XIf
  977. X.I div
  978. Xis 0, each block becames an IP.  If
  979. X.I div
  980. Xis 1, each block is subdivided into IPs as follows:  Let
  981. X.I p
  982. Xbe the comprelen of the block.
  983. XLet a line's status be 1 if its
  984. X.RI ( p +1)st
  985. Xcharacter is a space, 0 otherwise.  Every line in the
  986. Xblock whose status is the same as the status of the
  987. Xfirst line will begin a new paragraph.  Defaults to 0.
  988. X.TP
  989. X.BI E\fR[ Err\fR]
  990. XIf
  991. X.I Err
  992. Xis 1, messages to the user (caused by the
  993. X.B help
  994. Xand
  995. X.B version
  996. Xoptions, or by errors) are sent to the error stream
  997. Xinstead of the output stream.  Defaults to 0.
  998. X.TP
  999. X.BI e\fR[ expel\fR]
  1000. XIf
  1001. X.I expel
  1002. Xis 1, superfluous lines are withheld
  1003. Xfrom the output.  Defaults to 0.
  1004. X.TP
  1005. X.BI f\fR[ fit\fR]
  1006. XIf
  1007. X.I fit
  1008. Xis 1 and
  1009. X.I just
  1010. Xis 0,
  1011. X.B par
  1012. Xtries to make the lines in the OP as nearly the
  1013. Xsame length as possible, even if it means making
  1014. Xthe OP narrower.  Defaults to 0.  (See also the
  1015. X.B j
  1016. Xoption.)
  1017. X.TP
  1018. X.BI g\fR[ guess\fR]
  1019. XIf
  1020. X.I guess
  1021. Xis 1, then when
  1022. X.B par
  1023. Xis choosing line breaks, whenever it encounters a curious
  1024. Xword followed by a capitalized word, it takes one of two
  1025. Xspecial actions.  If the two words are separated by a
  1026. Xsingle space in the input, they will be merged into one
  1027. Xword with an embedded non-breaking space.  If the two words
  1028. Xare separated by more than one space, or by a line break,
  1029. X.B par
  1030. Xwill insure that they are separated by two spaces,
  1031. Xor by a line break, in the output.  Defaults to 0.
  1032. X.TP
  1033. X.BI i\fR[ invis\fR]
  1034. XIf
  1035. X.I invis
  1036. Xis 1, then vacant lines inserted because
  1037. X.I quote
  1038. Xis 1 are invisible; that is, they are not output.  If
  1039. X.I quote
  1040. Xis 0,
  1041. X.I invis
  1042. Xhas no effect.  Defaults to 0.  (See also the
  1043. X.B q
  1044. Xoption.)
  1045. X.TP
  1046. X.BI j\fR[ just\fR]
  1047. XIf
  1048. X.I just
  1049. Xis 1,
  1050. X.B par
  1051. Xjustifies the OP, inserting spaces between words
  1052. Xso that all lines in the OP have length
  1053. X.I width
  1054. X(except the last, if
  1055. X.I last
  1056. Xis 0).  Defaults to 0.  (See also the
  1057. X.BR w ,
  1058. X.BR l ,
  1059. Xand
  1060. X.B f
  1061. Xoptions.)
  1062. X.TP
  1063. X.BI l\fR[ last\fR]
  1064. XIf
  1065. X.I last
  1066. Xis 1,
  1067. X.B par
  1068. Xtries to make the last line of the OP about
  1069. Xthe same length as the others.  Defaults to 0.
  1070. X.TP
  1071. X.BI q\fR[ quote\fR]
  1072. XIf
  1073. X.I quote
  1074. Xis 1, then before each segment
  1075. Xis scanned for bodiless lines,
  1076. X.B par
  1077. Xsupplies vacant lines between different quotation nesting
  1078. Xlevels as follows:  For each pair of adjacent lines in
  1079. Xthe segment, (scanned from the top down) which have
  1080. Xdifferent quoteprefixes, one of two actions is taken.  If
  1081. X.I invis
  1082. Xis 0, and either line consists entirely of quote
  1083. Xcharacters and spaces (or is empty), that line
  1084. Xis truncated to the longest common prefix of the
  1085. Xtwo lines (both are truncated if both qualify).
  1086. XOtherwise, a line consisting of the longest common
  1087. Xprefix of the two lines is inserted between them.
  1088. X.I quote
  1089. Xalso affects the default value of
  1090. X.IR prefix .
  1091. XDefaults to 0.  (See also the
  1092. X.B p
  1093. Xand
  1094. X.B i
  1095. Xoptions.)
  1096. X.TP
  1097. X.BI R\fR[ Report\fR]
  1098. XIf
  1099. X.I Report
  1100. Xis 1, it is considered an error for
  1101. Xan input word to contain more than
  1102. X.IR L \ =
  1103. X.RI ( width \ -
  1104. X.IR prefix \ -
  1105. X.IR suffix )
  1106. Xcharacters.  Otherwise, such
  1107. Xwords are chopped after each
  1108. X.IR L th
  1109. Xcharacter into shorter words.  Defaults to 0.  It
  1110. Xis recommended that this option be included in
  1111. X.SM PARINIT
  1112. X(see the
  1113. X.SM ENVIRONMENT
  1114. Xsection).
  1115. X.TP
  1116. X.BI t\fR[ touch\fR]
  1117. XHas no effect if
  1118. X.I suffix
  1119. Xis 0 or
  1120. X.I just
  1121. Xis 1.  Otherwise, if
  1122. X.I touch
  1123. Xis 0, all lines in the OP have length
  1124. X.IR width .
  1125. XIf
  1126. X.I touch
  1127. Xis 1, the length of the lines is decreased until the
  1128. Xsuffixes touch the body of the OP.  Defaults to the logical
  1129. X.SM OR
  1130. Xof
  1131. X.I fit
  1132. Xand
  1133. X.IR last .
  1134. X(See also the
  1135. X.BR s ,
  1136. X.BR j ,
  1137. X.BR w ,
  1138. X.BR f ,
  1139. Xand
  1140. X.B l
  1141. Xoptions.)
  1142. X.LP
  1143. XIf the value of any parameter is set more
  1144. Xthan once, the last value is used.  When
  1145. Xunset parameters are assigned default values,
  1146. X.I hang
  1147. Xand
  1148. X.I quote
  1149. Xare assigned before
  1150. X.IR prefix ,
  1151. Xand
  1152. X.I fit
  1153. Xand
  1154. X.I last
  1155. Xare assigned before
  1156. X.I touch
  1157. X(because of the dependencies).
  1158. X.LP
  1159. XIt is an error if
  1160. X.I width
  1161. X<=
  1162. X.I prefix
  1163. X+
  1164. X.IR suffix .
  1165. X.SH ENVIRONMENT
  1166. X.TP 1i
  1167. X.SM PARBODY
  1168. XDetermines the initial set of body characters
  1169. X(which are used for determining comprelens
  1170. Xand comsuflens), using charset syntax.  If
  1171. X.SM PARBODY
  1172. Xis not set, the set of body characters is initially empty.
  1173. X.TP
  1174. X.SM PARINIT
  1175. XIf set,
  1176. X.B par
  1177. Xwill read command line options from
  1178. X.SM PARINIT
  1179. Xbefore it reads them from the command line.
  1180. XWithin the value of
  1181. X.SM PARINIT\s0,
  1182. Xarguments are separated by white characters.
  1183. X.TP
  1184. X.SM PARPROTECT
  1185. XDetermines the set of protective
  1186. Xcharacters, using charset syntax.  If
  1187. X.SM PARPROTECT
  1188. Xis not set, the set of protective
  1189. Xcharacters is initially empty.
  1190. X.TP
  1191. X.SM PARQUOTE
  1192. XDetermines the set of quote
  1193. Xcharacters, using charset syntax.  If
  1194. X.SM PARQUOTE
  1195. Xis not set, the set of quote characters initially
  1196. Xcontains only the greater-than sign (>) and the space.
  1197. X.LP
  1198. XIf a
  1199. X.SM NUL
  1200. Xcharacter appears in the value of an environment variable,
  1201. Xit and the rest of the string will not be seen by
  1202. X.BR par .
  1203. X.SH DETAILS
  1204. X.LP
  1205. XLines are terminated by newline characters, but the
  1206. Xnewlines are not considered to be included in the lines.
  1207. XIf the last character of the input is a non-newline,
  1208. Xa newline will be inferred immediately after it (but
  1209. Xif the input is empty, no newline will be inferred;
  1210. Xthe number of input lines will be 0).  Thus, the
  1211. Xinput can always be viewed as a sequence of lines.
  1212. X.LP
  1213. XProtected lines are copied unchanged from the input to the
  1214. Xoutput.  All other input lines, as they are read, have any
  1215. X.SM NUL
  1216. Xcharacters removed, and every white character
  1217. X(except newlines) turned into a space.
  1218. X.LP
  1219. XBlank lines in the input are transformed
  1220. Xinto empty lines in the output.
  1221. X.LP
  1222. XIf
  1223. X.I repeat
  1224. Xis 0, all bodiless lines are vacant, and they are all
  1225. Xsimply stripped of trailing spaces before being output.  If
  1226. X.I repeat
  1227. Xis 1, only vacant lines whose suffixes have length
  1228. X0 are treated that way; other bodiless lines have
  1229. Xthe number of instances of their repeat characters
  1230. Xincreased or decreased until the length of the line is
  1231. X.IR width .
  1232. X.LP
  1233. XIf
  1234. X.I expel
  1235. Xis 1, superfluous lines are not output.  If
  1236. X.I quote
  1237. Xand
  1238. X.I invis
  1239. Xare both 1, there may be invisible
  1240. Xlines; they are not output.
  1241. X.LP
  1242. XThe input is divided into segments, which are
  1243. Xdivided into blocks, which are divided into
  1244. XIPs.  The exact process depends on the values of
  1245. X.I quote
  1246. Xand
  1247. X.I div
  1248. X(see
  1249. X.B q
  1250. Xand
  1251. X.B d
  1252. Xin the
  1253. X.SM OPTIONS
  1254. Xsection).  The remainder of this section describes
  1255. Xthe process which is applied independently to
  1256. Xeach IP to construct the corresponding OP.
  1257. X.LP
  1258. XAfter the values of the parameters are determined (see the
  1259. X.SM OPTIONS
  1260. Xsection), the first
  1261. X.I prefix
  1262. Xcharacters and the last
  1263. X.I suffix
  1264. Xcharacters of each input line are removed and remembered.
  1265. XIt is an error for any line to contain fewer than
  1266. X.IR prefix \ +\  suffix
  1267. Xcharacters.
  1268. X.LP
  1269. XThe remaining text is treated as a sequence of
  1270. Xcharacters, not lines.  The text is broken into
  1271. Xwords, which are separated by spaces.  That is, a
  1272. Xword is a maximal sub-sequence of non-spaces.  If
  1273. X.I guess
  1274. Xis 1, some words might be merged (see
  1275. X.B g
  1276. Xin the
  1277. X.SM OPTIONS
  1278. Xsection).  The first word includes any
  1279. Xspaces that preceed it on the same line.
  1280. X.LP
  1281. XLet
  1282. X.I L
  1283. X=
  1284. X.I width
  1285. X\-
  1286. X.I prefix
  1287. X\-
  1288. X.IR suffix .
  1289. X.LP
  1290. XIf
  1291. X.I Report
  1292. Xis 0, some words may get chopped up at this point (see
  1293. X.B R
  1294. Xin the
  1295. X.SM
  1296. XOPTIONS
  1297. Xsection).
  1298. X.LP
  1299. XThe words are reassembled, preserving
  1300. Xtheir order, into lines.  If
  1301. X.I just
  1302. Xis 0, adjacent words within a line are separated
  1303. Xby a single space, (or sometimes two if
  1304. X.I guess
  1305. Xis 1), and line breaks are chosen so that
  1306. Xthe paragraph satisfies the following properties:
  1307. X.RS 1i
  1308. X.IT 1) No line contains more than
  1309. X.I L
  1310. Xcharacters.
  1311. X.IT 2) If
  1312. X.I fit
  1313. Xis 1, the difference between the lengths of the
  1314. Xshortest and longest lines is as small as possible.
  1315. X.IT 3) The shortest line is as long as
  1316. Xpossible, subject to properties 1 and 2.
  1317. X.IT 4) Let
  1318. X.I target
  1319. Xbe
  1320. X.I L
  1321. Xif
  1322. X.I fit
  1323. Xis 0, or the length of the longest line if
  1324. X.I fit
  1325. Xis 1.  The sum of the squares of the differences between
  1326. X.I target
  1327. Xand the lengths of the lines is as small as
  1328. Xpossible, subject to properties 1, 2, and 3.
  1329. X.RE
  1330. X.RS .5i
  1331. X.LP
  1332. XIf
  1333. X.I last
  1334. Xis 0, the last line does not count as a line for
  1335. Xthe purposes of properties 2, 3, and 4 above.
  1336. X.LP
  1337. XIf all the words fit on a single line, the
  1338. Xproperties as worded above don't make much
  1339. Xsense.  In that case, no line breaks are inserted.
  1340. X.RE
  1341. X.LP
  1342. XIf
  1343. X.I just
  1344. Xis 1, adjacent words within a line are
  1345. Xseparated by one space (or sometimes two if
  1346. X.I guess
  1347. Xis 1) plus zero or more extra spaces.  The value of
  1348. X.I fit
  1349. Xis disregarded, and line breaks are chosen so that
  1350. Xthe paragraph satisfies the following properties:
  1351. X.RS 1i
  1352. X.IT 1) Every line contains exactly
  1353. X.I L
  1354. Xcharacters.
  1355. X.IT 2) The largest inter-word gap is as small as
  1356. Xpossible, subject to property 1.  (An inter-word gap
  1357. Xconsists only of the extra spaces, not the regular spaces.)
  1358. X.IT 3) The sum of the squares of the lengths
  1359. Xof the inter-word gaps is as small as
  1360. Xpossible, subject to properties 1 and 2.
  1361. X.RE
  1362. X.RS .5i
  1363. X.LP
  1364. XIf
  1365. X.I last
  1366. Xis 0, the last line does not count as a line
  1367. Xfor the purposes of property 1, and it does
  1368. Xnot require or contain any extra spaces.
  1369. X.LP
  1370. XExtra spaces are distributed as uniformly as
  1371. Xpossible among the inter-word gaps in each line.
  1372. X.LP
  1373. XIn a justified paragraph, every line must
  1374. Xcontain at least two words, but that's not
  1375. Xalways possible to accomplish.  If the paragraph
  1376. Xcannot be justified, it is considered an error.
  1377. X.RE
  1378. X.LP
  1379. XIf the number of lines in the
  1380. Xresulting paragraph is less than
  1381. X.IR hang ,
  1382. Xempty lines are added at the end
  1383. Xto bring the number of lines up to
  1384. X.IR hang .
  1385. X.LP
  1386. XIf
  1387. X.I just
  1388. Xis 0 and
  1389. X.I touch
  1390. Xis 1,
  1391. X.I L
  1392. Xis changed to be the length of the longest line.
  1393. X.LP
  1394. XIf
  1395. X.I suffix
  1396. Xis not 0, each line is padded at the end
  1397. Xwith spaces to bring its length up to
  1398. X.IR L .
  1399. X.LP
  1400. XTo each line is prepended
  1401. X.I prefix
  1402. Xcharacters.  Let
  1403. X.I n
  1404. Xbe the number of lines in the IP, let
  1405. X.I afp
  1406. Xbe the augmented fallback prelen of the IP, and let
  1407. X.I fs
  1408. Xbe the fallback suflen of the IP.  The
  1409. Xcharacters which are prepended to the
  1410. X.IR i th
  1411. Xline are chosen as follows:
  1412. X.RS
  1413. X.LP
  1414. X.IT 1) If
  1415. X.I i
  1416. X<=
  1417. X.IR n ,
  1418. Xthe characters are copied from the ones
  1419. Xthat were removed from the beginning of the
  1420. X.IR n th
  1421. Xinput line.
  1422. X.IT 2) If
  1423. X.I i
  1424. X>
  1425. X.I n
  1426. X>
  1427. X.IR hang ,
  1428. Xthe characters are copied from the ones that were
  1429. Xremoved from the beginning of the last input line.
  1430. X.IT 3) If
  1431. X.I i
  1432. X>
  1433. X.I n
  1434. Xand
  1435. X.I n
  1436. X<=
  1437. X.IR hang ,
  1438. Xthe first
  1439. X.RI min( afp , prefix )
  1440. Xof the characters are copied from the ones
  1441. Xthat were removed from the beginning of the
  1442. Xlast input line, and the rest are all spaces.
  1443. X.RE
  1444. X.LP
  1445. XThen to each line is appended
  1446. X.I suffix
  1447. Xcharacters.  The characters which are appended to the
  1448. X.IR i th
  1449. Xline are chosen as follows:
  1450. X.RS
  1451. X.LP
  1452. X.IT 1) If
  1453. X.I i
  1454. X<=
  1455. X.IR n ,
  1456. Xthe characters are copied from the ones
  1457. Xthat were removed from the end of the
  1458. X.IR n th
  1459. Xinput line.
  1460. X.IT 2) If
  1461. X.I i
  1462. X>
  1463. X.I n
  1464. X>
  1465. X.IR hang ,
  1466. Xthe characters are copied from the ones that
  1467. Xwere removed from the end of the last input line.
  1468. X.IT 3) If
  1469. X.I i
  1470. X>
  1471. X.I n
  1472. Xand
  1473. X.I n
  1474. X<=
  1475. X.IR hang ,
  1476. Xthe first
  1477. X.RI min( fs , suffix )
  1478. Xof the characters are copied from the ones
  1479. Xthat were removed from the beginning of the
  1480. Xlast input line, and the rest are all spaces.
  1481. X.RE
  1482. X.LP
  1483. XFinally, the lines are printed to the output as the OP.
  1484. X.SH DIAGNOSTICS
  1485. X.LP
  1486. XIf there are no errors,
  1487. X.B par
  1488. Xreturns
  1489. X.SM EXIT_SUCCESS
  1490. X(see
  1491. X.BR <stdlib.h> ).
  1492. X.LP
  1493. XIf there is an error, an error message
  1494. Xwill be printed to the output, and
  1495. X.B par
  1496. Xwill return
  1497. X.SM EXIT_FAILURE\s0\.
  1498. XIf the error is local to a single paragraph, the preceeding
  1499. Xparagraphs will have been output before the error
  1500. Xwas detected.  Line numbers in error messages are
  1501. Xlocal to the IP in which the error occurred.  All
  1502. Xerror messages begin with \*Qpar\ error:\*U on a line
  1503. Xby itself.  Error messages concerning command line
  1504. Xor environment variable syntax are accompanied by
  1505. Xthe same usage message that the help option produces.
  1506. X.LP
  1507. XOf course, trying to print an error message would be
  1508. Xfutile if an error resulted from an output function, so
  1509. X.B par
  1510. Xdoesn't bother doing any error checking on output functions.
  1511. X.SH EXAMPLES
  1512. X.de VS
  1513. X.RS -.5i
  1514. X.LP
  1515. X.nf
  1516. X.ps -1p
  1517. X.vs -2p
  1518. X.cs R 20
  1519. X..
  1520. X.de VE
  1521. X.cs R
  1522. X.vs
  1523. X.ps
  1524. X.fi
  1525. X.RE
  1526. X..
  1527. X.de CM
  1528. X\&\*Q\fB\\$1\fP\\*U:
  1529. X..
  1530. X.LP
  1531. XThe superiority of
  1532. X.BR par 's
  1533. Xdynamic programming algorithm over a
  1534. Xgreedy algorithm (such as the one used by
  1535. X.BR fmt )
  1536. Xcan be seen in the following example:
  1537. X.LP
  1538. XOriginal paragraph (note that
  1539. Xeach line begins with 8 spaces):
  1540. X.VS
  1541. X        We the people of the United States,
  1542. X        in order to form a more perfect union,
  1543. X        establish justice,
  1544. X        insure domestic tranquility,
  1545. X        provide for the common defense,
  1546. X        promote the general welfare,
  1547. X        and secure the blessing of liberty
  1548. X        to ourselves and our posterity,
  1549. X        do ordain and establish the Constitution
  1550. X        of the United States of America.
  1551. X.VE
  1552. X.LP
  1553. XAfter a greedy algorithm with width = 39:
  1554. X.VS
  1555. X        We the people of the United
  1556. X        States, in order to form a more
  1557. X        perfect union, establish
  1558. X        justice, insure domestic
  1559. X        tranquility, provide for the
  1560. X        common defense, promote the
  1561. X        general welfare, and secure the
  1562. X        blessing of liberty to
  1563. X        ourselves and our posterity, do
  1564. X        ordain and establish the
  1565. X        Constitution of the United
  1566. X        States of America.
  1567. X.VE
  1568. X.LP
  1569. XAfter
  1570. X.CM "par 39"
  1571. X.VS
  1572. X        We the people of the United
  1573. X        States, in order to form a
  1574. X        more perfect union, establish
  1575. X        justice, insure domestic
  1576. X        tranquility, provide for the
  1577. X        common defense, promote the
  1578. X        general welfare, and secure
  1579. X        the blessing of liberty to
  1580. X        ourselves and our posterity,
  1581. X        do ordain and establish the
  1582. X        Constitution of the United
  1583. X        States of America.
  1584. X.VE
  1585. X.LP
  1586. XThe line breaks chosen by
  1587. X.B par
  1588. Xare clearly more eye-pleasing.
  1589. X.LP
  1590. X.B par
  1591. Xis most useful in conjunction with the text-filtering
  1592. Xfeatures of an editor, such as the ! commands of
  1593. X.BR vi .
  1594. X.LP
  1595. XThe rest of this section is a series of
  1596. Xbefore-and-after pictures showing some typical uses of
  1597. X.BR par .
  1598. XIn all cases, no environment variables are set.
  1599. X.LP
  1600. XBefore:
  1601. X.VS
  1602. X        /*   We the people of the United States, */
  1603. X        /* in order to form a more perfect union, */
  1604. X        /* establish justice, */
  1605. X        /* insure domestic tranquility, */
  1606. X        /* provide for the common defense, */
  1607. X        /* promote the general welfare, */
  1608. X        /* and secure the blessing of liberty */
  1609. X        /* to ourselves and our posterity, */
  1610. X        /* do ordain and establish the Constitution */
  1611. X        /* of the United States of America. */
  1612. X.VE
  1613. X.LP
  1614. XAfter
  1615. X.CM "par 59"
  1616. X.VS
  1617. X        /*   We the people of the United States, in      */
  1618. X        /* order to form a more perfect union, establish */
  1619. X        /* justice, insure domestic tranquility, provide */
  1620. X        /* for the common defense, promote the general   */
  1621. X        /* welfare, and secure the blessing of liberty   */
  1622. X        /* to ourselves and our posterity, do ordain     */
  1623. X        /* and establish the Constitution of the United  */
  1624. X        /* States of America.                            */
  1625. X.VE
  1626. X.LP
  1627. XOr after
  1628. X.CM "par 59f"
  1629. X.VS
  1630. X        /*   We the people of the United States,  */
  1631. X        /* in order to form a more perfect union, */
  1632. X        /* establish justice, insure domestic     */
  1633. X        /* tranquility, provide for the common    */
  1634. X        /* defense, promote the general welfare,  */
  1635. X        /* and secure the blessing of liberty to  */
  1636. X        /* ourselves and our posterity, do ordain */
  1637. X        /* and establish the Constitution of the  */
  1638. X        /* United States of America.              */
  1639. X.VE
  1640. X.LP
  1641. XOr after
  1642. X.CM "par 59l"
  1643. X.VS
  1644. X        /*   We the people of the United States, in      */
  1645. X        /* order to form a more perfect union, establish */
  1646. X        /* justice, insure domestic tranquility,         */
  1647. X        /* provide for the common defense, promote       */
  1648. X        /* the general welfare, and secure the           */
  1649. X        /* blessing of liberty to ourselves and our      */
  1650. X        /* posterity, do ordain and establish the        */
  1651. X        /* Constitution of the United States of America. */
  1652. X.VE
  1653. X.LP
  1654. XOr after
  1655. X.CM "par 59lf"
  1656. X.VS
  1657. X        /*   We the people of the United States,  */
  1658. X        /* in order to form a more perfect union, */
  1659. X        /* establish justice, insure domestic     */
  1660. X        /* tranquility, provide for the common    */
  1661. X        /* defense, promote the general welfare,  */
  1662. X        /* and secure the blessing of liberty     */
  1663. X        /* to ourselves and our posterity, do     */
  1664. X        /* ordain and establish the Constitution  */
  1665. X        /* of the United States of America.       */
  1666. X.VE
  1667. X.LP
  1668. XOr after
  1669. X.CM "par 59lft0"
  1670. X.VS
  1671. X        /*   We the people of the United States,         */
  1672. X        /* in order to form a more perfect union,        */
  1673. X        /* establish justice, insure domestic            */
  1674. X        /* tranquility, provide for the common           */
  1675. X        /* defense, promote the general welfare,         */
  1676. X        /* and secure the blessing of liberty            */
  1677. X        /* to ourselves and our posterity, do            */
  1678. X        /* ordain and establish the Constitution         */
  1679. X        /* of the United States of America.              */
  1680. X.VE
  1681. X.LP
  1682. XOr after
  1683. X.CM "par 59j"
  1684. X.VS
  1685. X        /*   We  the people  of  the  United States,  in */
  1686. X        /* order to form a more perfect union, establish */
  1687. X        /* justice, insure domestic tranquility, provide */
  1688. X        /* for the  common defense, promote  the general */
  1689. X        /* welfare, and  secure the blessing  of liberty */
  1690. X        /* to ourselves and our posterity, do ordain and */
  1691. X        /* establish  the  Constitution  of  the  United */
  1692. X        /* States of America.                            */
  1693. X.VE
  1694. X.LP
  1695. XOr after
  1696. X.CM "par 59jl"
  1697. X.VS
  1698. X        /*   We  the   people  of  the   United  States, */
  1699. X        /* in   order    to   form   a    more   perfect */
  1700. X        /* union,  establish  justice,  insure  domestic */
  1701. X        /* tranquility, provide for  the common defense, */
  1702. X        /* promote  the  general   welfare,  and  secure */
  1703. X        /* the  blessing  of  liberty to  ourselves  and */
  1704. X        /* our  posterity, do  ordain and  establish the */
  1705. X        /* Constitution of the United States of America. */
  1706. X.VE
  1707. X.LP
  1708. XBefore:
  1709. X.VS
  1710. X        Preamble      We the people of the United States,
  1711. X        to the US     in order to form
  1712. X        Constitution  a more perfect union,
  1713. X                      establish justice,
  1714. X                      insure domestic tranquility,
  1715. X                      provide for the common defense,
  1716. X                      promote the general welfare,
  1717. X                      and secure the blessing of liberty
  1718. X                      to ourselves and our posterity,
  1719. X                      do ordain and establish
  1720. X                      the Constitution
  1721. X                      of the United States of America.
  1722. X.VE
  1723. X.LP
  1724. XAfter
  1725. X.CM "par 52h3"
  1726. X.VS
  1727. X        Preamble      We the people of the United
  1728. X        to the US     States, in order to form a
  1729. X        Constitution  more perfect union, establish
  1730. X                      justice, insure domestic
  1731. X                      tranquility, provide for the
  1732. X                      common defense, promote the
  1733. X                      general welfare, and secure
  1734. X                      the blessing of liberty to
  1735. X                      ourselves and our posterity,
  1736. X                      do ordain and establish the
  1737. X                      Constitution of the United
  1738. X                      States of America.
  1739. X.VE
  1740. X.LP
  1741. XBefore:
  1742. X.VS
  1743. X         1  We the people of the United States,
  1744. X         2  in order to form a more perfect union,
  1745. X         3  establish justice,
  1746. X         4  insure domestic tranquility,
  1747. X         5  provide for the common defense,
  1748. X         6  promote the general welfare,
  1749. X         7  and secure the blessing of liberty
  1750. X         8  to ourselves and our posterity,
  1751. X         9  do ordain and establish the Constitution
  1752. X        10  of the United States of America.
  1753. X.VE
  1754. X.LP
  1755. XAfter
  1756. X.CM "par 59p12l"
  1757. X.VS
  1758. X         1  We the people of the United States, in order to
  1759. X         2  form a more perfect union, establish justice,
  1760. X         3  insure domestic tranquility, provide for the
  1761. X         4  common defense, promote the general welfare,
  1762. X         5  and secure the blessing of liberty to ourselves
  1763. X         6  and our posterity, do ordain and establish the
  1764. X         7  Constitution of the United States of America.
  1765. X.VE
  1766. X.LP
  1767. XBefore:
  1768. X.VS
  1769. X        > > We the people
  1770. X        > > of the United States,
  1771. X        > > in order to form a more perfect union,
  1772. X        > > establish justice,
  1773. X        > > ensure domestic tranquility,
  1774. X        > > provide for the common defense,
  1775. X        >
  1776. X        > Promote the general welfare,
  1777. X        > and secure the blessing of liberty
  1778. X        > to ourselves and our posterity,
  1779. X        > do ordain and establish
  1780. X        > the Constitution of the United States of America.
  1781. X.VE
  1782. X.LP
  1783. XAfter
  1784. X.CM "par 52"
  1785. X.VS
  1786. X        > > We the people of the United States, in
  1787. X        > > order to form a more perfect union,
  1788. X        > > establish justice, ensure domestic
  1789. X        > > tranquility, provide for the common
  1790. X        > > defense,
  1791. X        >
  1792. X        > Promote the general welfare, and secure
  1793. X        > the blessing of liberty to ourselves and
  1794. X        > our posterity, do ordain and establish
  1795. X        > the Constitution of the United States of
  1796. X        > America.
  1797. X.VE
  1798. X.LP
  1799. XBefore:
  1800. X.VS
  1801. X        >   We the people
  1802. X        > of the United States,
  1803. X        > in order to form a more perfect union,
  1804. X        > establish justice,
  1805. X        > ensure domestic tranquility,
  1806. X        > provide for the common defense,
  1807. X        >   Promote the general welfare,
  1808. X        > and secure the blessing of liberty
  1809. X        > to ourselves and our posterity,
  1810. X        > do ordain and establish
  1811. X        > the Constitution of the United States of America.
  1812. X.VE
  1813. X.LP
  1814. XAfter
  1815. X.CM "par 52d"
  1816. X.VS
  1817. X        >   We the people of the United States,
  1818. X        > in order to form a more perfect union,
  1819. X        > establish justice, ensure domestic
  1820. X        > tranquility, provide for the common
  1821. X        > defense,
  1822. X        >   Promote the general welfare, and secure
  1823. X        > the blessing of liberty to ourselves and
  1824. X        > our posterity, do ordain and establish
  1825. X        > the Constitution of the United States of
  1826. X        > America.
  1827. X.VE
  1828. X.LP
  1829. XBefore:
  1830. X.VS
  1831. X        # 1. We the people of the United States.
  1832. X        # 2. In order to form a more perfect union.
  1833. X        # 3. Establish justice, ensure domestic
  1834. X        #    tranquility.
  1835. X        # 4. Provide for the common defense
  1836. X        # 5. Promote the general welfare.
  1837. X        # 6. And secure the blessing of liberty
  1838. X        #    to ourselves and our posterity.
  1839. X        # 7. Do ordain and establish the Constitution.
  1840. X        # 8. Of the United States of America.
  1841. X.VE
  1842. X.LP
  1843. XAfter
  1844. X.CM "par 37p13dh"
  1845. X.VS
  1846. X        # 1. We the people of the
  1847. X        #    United States.
  1848. X        # 2. In order to form a more
  1849. X        #    perfect union.
  1850. X        # 3. Establish justice,
  1851. X        #    ensure domestic
  1852. X        #    tranquility.
  1853. X        # 4. Provide for the common
  1854. X        #    defense
  1855. X        # 5. Promote the general
  1856. X        #    welfare.
  1857. X        # 6. And secure the blessing
  1858. X        #    of liberty to ourselves
  1859. X        #    and our posterity.
  1860. X        # 7. Do ordain and establish
  1861. X        #    the Constitution.
  1862. X        # 8. Of the United States of
  1863. X        #    America.
  1864. X.VE
  1865. X.LP
  1866. XBefore:
  1867. X.VS
  1868. X        /*****************************************/
  1869. X        /*   We the people of the United States, */
  1870. X        /* in order to form a more perfect union, */
  1871. X        /* establish justice, insure domestic    */
  1872. X        /* tranquility,                          */
  1873. X        /*                                       */
  1874. X        /*                                       */
  1875. X        /*   [ provide for the common defense, ] */
  1876. X        /*   [ promote the general welfare,    ] */
  1877. X        /*   [ and secure the blessing of liberty ] */
  1878. X        /*   [ to ourselves and our posterity, ] */
  1879. X        /*   [                                 ] */
  1880. X        /*                                       */
  1881. X        /* do ordain and establish the Constitution */
  1882. X        /* of the United States of America.       */
  1883. X        /******************************************/
  1884. X.VE
  1885. X.LP
  1886. XAfter
  1887. X.CM "par 42r"
  1888. X.VS
  1889. X        /********************************/
  1890. X        /*   We the people of the       */
  1891. X        /* United States, in order to   */
  1892. X        /* form a more perfect union,   */
  1893. X        /* establish justice, insure    */
  1894. X        /* domestic tranquility,        */
  1895. X        /*                              */
  1896. X        /*                              */
  1897. X        /*   [ provide for the common ] */
  1898. X        /*   [ defense, promote the   ] */
  1899. X        /*   [ general welfare, and   ] */
  1900. X        /*   [ secure the blessing of ] */
  1901. X        /*   [ liberty to ourselves   ] */
  1902. X        /*   [ and our posterity,     ] */
  1903. X        /*   [                        ] */
  1904. X        /*                              */
  1905. X        /* do ordain and establish the  */
  1906. X        /* Constitution of the United   */
  1907. X        /* States of America.           */
  1908. X        /********************************/
  1909. X.VE
  1910. X.LP
  1911. XOr after
  1912. X.CM "par 42re"
  1913. X.VS
  1914. X        /********************************/
  1915. X        /*   We the people of the       */
  1916. X        /* United States, in order to   */
  1917. X        /* form a more perfect union,   */
  1918. X        /* establish justice, insure    */
  1919. X        /* domestic tranquility,        */
  1920. X        /*                              */
  1921. X        /*   [ provide for the common ] */
  1922. X        /*   [ defense, promote the   ] */
  1923. X        /*   [ general welfare, and   ] */
  1924. X        /*   [ secure the blessing of ] */
  1925. X        /*   [ liberty to ourselves   ] */
  1926. X        /*   [ and our posterity,     ] */
  1927. X        /*                              */
  1928. X        /* do ordain and establish the  */
  1929. X        /* Constitution of the United   */
  1930. X        /* States of America.           */
  1931. X        /********************************/
  1932. X.VE
  1933. X.LP
  1934. XBefore:
  1935. X.VS
  1936. X        Joe Public writes:
  1937. X        > Jane Doe writes:
  1938. X        > >
  1939. X        > >
  1940. X        > > I can't find the source for uncompress.
  1941. X        > Oh no, not again!!!
  1942. X        >
  1943. X        >
  1944. X        > Isn't there a FAQ for this?
  1945. X        >
  1946. X        >
  1947. X        That wasn't very helpful, Joe. Jane,
  1948. X        just make a link from uncompress to compress.
  1949. X.VE
  1950. X.LP
  1951. XAfter
  1952. X.CM "par 40q"
  1953. X.VS
  1954. X        Joe Public writes:
  1955. X
  1956. X        > Jane Doe writes:
  1957. X        >
  1958. X        >
  1959. X        > > I can't find the source for
  1960. X        > > uncompress.
  1961. X        >
  1962. X        > Oh no, not again!!!
  1963. X        >
  1964. X        >
  1965. X        > Isn't there a FAQ for this?
  1966. X        >
  1967. X
  1968. X        That wasn't very helpful, Joe.
  1969. X        Jane, just make a link from
  1970. X        uncompress to compress.
  1971. X.VE
  1972. X.LP
  1973. XOr after
  1974. X.CM "par 40qe"
  1975. X.VS
  1976. X        Joe Public writes:
  1977. X
  1978. X        > Jane Doe writes:
  1979. X        >
  1980. X        > > I can't find the source for
  1981. X        > > uncompress.
  1982. X        >
  1983. X        > Oh no, not again!!!
  1984. X        >
  1985. X        > Isn't there a FAQ for this?
  1986. X
  1987. X        That wasn't very helpful, Joe.
  1988. X        Jane, just make a link from
  1989. X        uncompress to compress.
  1990. X.VE
  1991. X.LP
  1992. XOr after
  1993. X.CM "par 40qi"
  1994. X.VS
  1995. X        Joe Public writes:
  1996. X        > Jane Doe writes:
  1997. X        > >
  1998. X        > >
  1999. X        > > I can't find the source for
  2000. X        > > uncompress.
  2001. X        > Oh no, not again!!!
  2002. X        >
  2003. X        >
  2004. X        > Isn't there a FAQ for this?
  2005. X        >
  2006. X        >
  2007. X        That wasn't very helpful, Joe.
  2008. X        Jane, just make a link from
  2009. X        uncompress to compress.
  2010. X.VE
  2011. X.LP
  2012. XOr after
  2013. X.CM "par 40qie"
  2014. X.VS
  2015. X        Joe Public writes:
  2016. X        > Jane Doe writes:
  2017. X        > > I can't find the source for
  2018. X        > > uncompress.
  2019. X        > Oh no, not again!!!
  2020. X        >
  2021. X        > Isn't there a FAQ for this?
  2022. X        That wasn't very helpful, Joe.
  2023. X        Jane, just make a link from
  2024. X        uncompress to compress.
  2025. X.VE
  2026. X.LP
  2027. XBefore:
  2028. X.VS
  2029. X        I sure hope there's still room
  2030. X        in Dr. Jones' section of archaeology.
  2031. X        I've heard he's the bestest.  [sic]
  2032. X.VE
  2033. X.LP
  2034. XAfter
  2035. X.CM "par 50g"
  2036. X.VS
  2037. X        I sure hope there's still room in
  2038. X        Dr. Jones' section of archaeology.  I've
  2039. X        heard he's the bestest. [sic]
  2040. X.VE
  2041. X.LP
  2042. XOr after
  2043. X.CM "par 50gc"
  2044. X.VS
  2045. X        I sure hope there's still room in
  2046. X        Dr. Jones' section of archaeology.  I've
  2047. X        heard he's the bestest.  [sic]
  2048. X.VE
  2049. X.LP
  2050. XBefore:
  2051. X.VS
  2052. X        John writes:
  2053. X        : Mary writes:
  2054. X        : + Anastasia writes:
  2055. X        : + > Hi all!
  2056. X        : + Hi Ana!
  2057. X        : Hi Ana & Mary!
  2058. X        Please unsubscribe me from alt.hello.
  2059. X.VE
  2060. X.LP
  2061. XAfter
  2062. X.CM "par Q+:+ q"
  2063. X.VS
  2064. X        John writes:
  2065. X
  2066. X        : Mary writes:
  2067. X        :
  2068. X        : + Anastasia writes:
  2069. X        : +
  2070. X        : + > Hi all!
  2071. X        : +
  2072. X        : + Hi Ana!
  2073. X        :
  2074. X        : Hi Ana & Mary!
  2075. X
  2076. X        Please unsubscribe me from alt.hello.
  2077. X.VE
  2078. X.SH SEE ALSO
  2079. X.LP
  2080. X.B par.doc
  2081. X.SH LIMITATIONS
  2082. X.LP
  2083. XThe
  2084. X.I guess
  2085. Xfeature guesses wrong in cases like the following:
  2086. X.VS
  2087. X        I calc'd the approx.
  2088. X        Fermi level to 3 sig. digits.
  2089. X.VE
  2090. X.LP
  2091. XWith
  2092. X.I guess
  2093. X= 1,
  2094. X.B par
  2095. Xwill incorrectly assume that \*Qapprox.\*U
  2096. Xends a sentence.  If the input were:
  2097. X.VS
  2098. X        I calc'd the approx. Fermi
  2099. X        level to 3 sig. digits.
  2100. X.VE
  2101. X.LP
  2102. Xthen
  2103. X.B par
  2104. Xwould refuse to put a line break between
  2105. X\*Qapprox.\*U and \*QFermi\*U in the output,
  2106. Xmainly to avoid creating the first situation (in
  2107. Xcase the paragraph were to be fed back through
  2108. X.B par
  2109. Xagain).  This non-breaking space policy does come in handy
  2110. Xfor cases like \*QMr.\ Johnson\*U and \*QJan.\ 1\*U, though.
  2111. X.LP
  2112. XThe
  2113. X.I guess
  2114. Xfeature only goes one way.
  2115. X.B par
  2116. Xcan preserve wide sentence breaks in a
  2117. Xparagraph, or remove them, but it can't insert
  2118. Xthem if they aren't already in the input.
  2119. X.LP
  2120. XIf you use tabs, you probably won't like the way
  2121. X.B par
  2122. Xhandles (or doesn't handle) them.  It turns them into
  2123. Xspaces.  I didn't bother trying to make sense of tabs
  2124. Xbecause they don't make sense to begin with.  Not everyone's
  2125. Xterminal has the same tab settings, so text files containing
  2126. Xtabs are sometimes mangled.  In fact, almost every text
  2127. Xfile containing tabs gets mangled when something is
  2128. Xinserted at the beginning of each line (when quoting
  2129. Xe-mail or commenting out a section of a shell script, for
  2130. Xexample), making them a pain to edit.  In my opinion, the
  2131. Xworld would be a nicer place if everyone stopped using
  2132. Xtabs (so I'm doing my part by not supporting them in
  2133. X.BR par .)
  2134. XIf you find yourself editing a file containing tabs, the
  2135. Xfirst thing you should do is run the whole file through
  2136. X.BR expand ,
  2137. Xa standard
  2138. X.SM UNIX
  2139. Xcommand (if there is such a thing) that
  2140. Xreplaces tabs with spaces while preserving the
  2141. Xappearance of the file.  If you're not in a
  2142. X.SM UNIX
  2143. Xenvironment, then hopefully someone has ported
  2144. X.B expand
  2145. Xto your system.  (Thanks to ets1@cs.wustl.edu (Eric
  2146. XT. Stuebe) for showing me the light about tabs.)
  2147. X.LP
  2148. XThere is currently no way for the length of the
  2149. Xoutput prefix to differ from the length of the
  2150. Xinput prefix.  Ditto for the suffix.  I may consider
  2151. Xadding this capability in a future release, but
  2152. Xright now I'm not sure how I'd want it to work.
  2153. X.SH BUGS
  2154. X.LP
  2155. XIf I knew of any bugs, I wouldn't release the package.  Of
  2156. Xcourse, there may be bugs that I haven't yet discovered.
  2157. X.LP
  2158. XIf you find any bugs (in the program or
  2159. Xin the documentation), or if you have
  2160. Xany suggestions, please send e-mail to:
  2161. X.RS
  2162. X.LP
  2163. Xamc@ecl.wustl.edu
  2164. X.RE
  2165. X.LP
  2166. Xor send paper mail to:
  2167. X.RS
  2168. X.LP
  2169. X.nf
  2170. XAdam M. Costello
  2171. XCampus Box 1045
  2172. XWashington University
  2173. XOne Brookings Dr.
  2174. XSt. Louis, MO 63130
  2175. XUSA
  2176. X.fi
  2177. X.RE
  2178. X.LP
  2179. XNote that both addresses could
  2180. Xchange anytime after June 1994.
  2181. X.LP
  2182. XWhen reporting a bug, please include the exact input and
  2183. Xcommand line options used, and the version number of
  2184. X.BR par ,
  2185. Xso that I can reproduce it.
  2186. END_OF_FILE
  2187. if test 43989 -ne `wc -c <'Par141/par.1'`; then
  2188.     echo shar: \"'Par141/par.1'\" unpacked with wrong size!
  2189. fi
  2190. # end of 'Par141/par.1'
  2191. fi
  2192. echo shar: End of shell archive.
  2193. exit 0
  2194.  
  2195. exit 0 # Just in case...
  2196.