.TH hwp "" "" "Command"
.PC "WYSIWYG word processor"
\fBhwp [\-elm] [\fIdocument\^\fB]
.PP
.B hwp
is a simple WYSIWYG word processor for \*(CO and other operating systems.
It uses a
.BR curses \-based
interface to format and display what you type.
With
.BR hwp ,
you can set such simple document aspects as line length, page size,
spacing between lines, underlining, bold text, and footnotes.
It does not let you use proportionally spaced fonts, multiple columns,
or other features provided by a fully featured word processor;
.\" so what do you expect for free?
but within these limitations,
.B hwp
helps you type, format, and print simple documents without requiring that
you go through the drudgery of
.B troff
coding.
.SH "Using hwp"
To invoke
.BR hwp ,
simply type its name at the \*(CO shell prompt, followed by the name of a
document that you wish to edit, if any.
When you invoke
.BR hwp ,
your screen looks something like this:
.ie p .PH 1 1 \*(XD/hwp.eps
.el \{
.B1
  F2:File   F3:Etc.   F4:Locate    F5:Options    F6:Spell   F7:Block  F1:Help 

                This is an example of Harry Pulley's word processor  

        "hwp".  As you can see, text is automatically spaced and  

        wrapped as you type it.








                                                                                
  Title: untitled.hwp Page: 1 Line: 15                                Insert
  Press function key to activate menu.  Or press F10 to activate menu bar.      
.B2
\}
.PP
As you can see, the screen is divided into three parts:
a
.I "menu bar"
at the top of the screen, a
.I "work section"
in the center of the screen, and two information lines at the bottom.
.PP
The menu bar has seven items in it.
The first six of these items each controls a drop-down menu of related
commands; the last displays a brief message on how to use
.BR hwp .
Each of these items and its menu is discussed in detail below.
.PP
If you name a
.I document
on
.BR hwp 's
command line,
.B hwp
reads it and displays its contents in the work area.
You can edit this document or append new text to it.
If you do not name a
.I document
on
.BR hwp 's
command line, the work area is blank and you can enter new text into it.
The commands with which you can edit text are discussed below.
.PP
Editing can be performed in either of two modes:
.I Insert
or
.IR Overstrike .
In the the former mode,
.B hwp
displaces existing text to make space for new text that you
type into the document.
In the latter mode,
.B hwp
overwrites existing text with new text.
To toggle modes, press the
.B Insert
key or select the command
.B "Toggle Insertmode"
from the
.B Options
menu, as will be described below.
.PP
The two lines at the bottom of the screen give information about
.BR hwp 's
operation.
The penultimate line displays the name of the file you are editing, the
line and column where the cursor is positioned in the work area (whether
or not
.B hwp
is displaying the cursor there at this moment), and the editing mode
that
.B hwp
current is using.
The last line displays messages and prompts.
.SH "Command Menus"
Most commands are given to
.B hwp
through the items shown on the command bar at the top of the screen:
.BR File ,
.BR Etc. ,
.BR Locate ,
.BR Options ,
.BR Spell ,
.BR Block ,
and
.BR Help .
Each item (except the last) controls a menu of related commands,
any of which you can invoke by using the arrow keys.
.PP
There are two ways to invoke a menu from the command bar.
The first is to press the function key associated with that menu:
.B <F2>
for the
.B File
menu,
.B <F3>
for the
.B Edit
menu, and so on.
The other way is to press
.B <F10>
or
.B <esc>
to move the cursor into the menu bar; then press \*(LA and \*(RA to move
the cursor until the entry you want is highlighted; and then press \*(RT
to drop the menu.
.PP
Once a menu is displayed, you can press \*(DA or \*(UA to highlight
the command you want.
To select the command that is highlighted, press \*(RT.
To close a menu without selecting a command, press
.BR <esc> .
.B hwp
returns the cursor to where it had been before the menu was opened:
either to the menu bar, or to the work area.
To cancel a command, type
.BR <ctrl-C> .
.PP
The following describes each menu and its commands:
.IP \fBF2:File\fR
This invokes the following commands that manipulate files:
.RS
.IP "\fBLoad File\fR"
Load a file from disk.
The file currently being edited, if any, is removed from memory.
If that file has changes that have not yet been saved to disk,
.B hwp
asks you to confirm that you want to throw these changes away.
.IP "\fBBring in File\fR"
.B hwp
prompts you for a file, then inserts that file into the document
you are now editing, at the point where the cursor is positioned.
.IP "\fBSave File\fR"
This writes to disk the file you are editing.
If this is a new document and therefore does not have a name,
.B hwp
asks you to name the file into it should save the document.
The suffix you give your file dictates the format that
.B hwp
writes, as follows:
.IP \fB.out\fR
Write
.BR nroff \-style
output.
This format encodes a
.B bold
character with the sequence \fIc\fB\eb\fIc\fR, where
.I c
is the character to be printed; and an
.I italic
character with the sequence \fI_\fB\eb\fIc\fR.
.IP \fB.ps
PostScript output.
The output is piped through the PostScript-encoding program before being
written into the output file.
.IP \fB.hwp\fR
This saves
.BR hwp 's
formatting codes within the output file.
Use this format if you will want to re-edit and re-format a file.
.PP
If you wish to save a document simply as ASCII text, do not give it a suffix.
Note that the format in which you
.I print
a file does not affect the format in which you
.I save
it.
For example, you can print a file onto a PostScript printer, but save it
in
.B hwp
format.
.IP "\fBPrint Epson\fR"
Print the document on an Epson-style dot-matrix printer.
.IP "\fBPrint PostScript\fR"
Print the output on a PostScript printer.
.IP "\fBNew\fR"
Begin a new document.
.B hwp
removes from memory the document currently being edited, if any.
If this document has unsaved changes,
.B hwp
asks you if you wish to save them before it removes the document
from memory.
.IP "\fBQuit\fR"
Exit from
.BR hwp .
If the document being edited has unsaved changes,
.B hwp
asks you if you wish to save them before it exits.
.RE
.IP "\fBEtc.\fR"
The following commands control some miscellaneous aspects of editing text:
.RS
.IP "\fBEdit Header\fR"
Edit the document's
.IR header ,
that is, the string that is printed at the top of each page.
The escape character `%' stands for the current page number.
.IP "\fBEdit Footer\fR"
Edit the document's
.IR footer ,
that is, the string that is printed at the bottom of each page.
The escape character `%' stands for the current page number.
.IP "\fBStart Underline\fR"
Begin displaying/printing text with underlining.
Note that underlining goes only to the end of the current line.
.IP "\fBEnd Underline\fR"
End the underlining of text.
.IP "\fBStart Bold\fR"
Begin displaying/printing in boldface.
Note that boldfacing goes only to the end of the current line.
.IP "\fBEnd Bold\fR"
End the boldfacing of text.
.IP "\fBStart Superscript\fR"
The next text is a superscription \(em that is, it is printed slightly
above the normal line of text.
.IP "\fBEnd Superscript\fR"
End superscripting the text.
.IP "\fBStart Subscript\fR"
The next text is a subscription \(em that is, it is printed slightly
below the normal line of text.
.IP "\fBEnd Subscript\fR"
End superscripting the text.
.RE
.IP "\fBLocate\fR"
The following commands help you to locate a word or string within your
document:
.RS
.IP "\fBFind (case sensitive)\fR"
.B hwp
prompts you for a string, then move the cursor to the first point in the
document that exactly matches that string.
.IP "\fBFind (case insensitive)\fR"
.B hwp
prompts you for a string, then move the cursor to the first point in the
document that matches that string, without regard for the case of its
characters.
.IP "\fBFind next\fR"
Find the next occurrence of the string.
Whether the next match is case sensitive or insensitive depends upon how
you began the search
.IP "\fBGoto line number\fR"
Go to an absolute line in your document.
.B hwp
prompts you for the line to go to.
.IP "\fBGoto page number\fR"
Go to the beginning of a given page in your document.
.B hwp
prompts you for the page to go to.
.RE
.IP "\fBOptions\fR"
The following commands manipulate some aspects of page layout and editing:
.RS
.IP "\fBLine Spacing\fR"
Set the number of blank lines between each line of text.
The default is one \(em that is, the document is double-spaced.
.IP "\fBPage Length\fR"
Set the length of the page, in lines.
The default is 66, which is appropriate for a standard 11-inch page.
.IP "\fBTab Size\fR"
Set the size of the tabulation field.
The default is eight characters, which equals eight-tenths of an inch.
.IP "\fBIndentation Size\fR"
Set the width of indentation \(em that is, how far paragraphs and other
indented recede from the left edge of the page.
The default is 16 characters \(em that is, 0.8 inches for the standard margin
and 0.8 inches for indentation.
.IP "\fBLeft Margin\fR"
Set the distance at which the left edge of the text
is fixed from the left edge of the paper.
The default is eight characters \(em that is, 0.8 inches.
.IP "\fBRight Margin\fR"
Set the distance at which the right edge of the text
is fixed from the left edge of the paper (yes \(em the \fIleft\fR edge).
The default is 72 characters \(em that is, 7.2 inches.
.IP "\fBTop Blanks\fR"
Set the number of blank lines at the top of each page.
The default is five.
.IP "\fBBottom Blanks\fR"
Set the number of blank lines at the bottom of the page.
The default is five.
.IP "\fBStarting Page #\fR"
Set the number of the first page in the document.
The default is one.
.IP "\fBToggle Insertmode\fR"
Finally, this command toggles the insertion mode:
from
.B Insert
to
.BR Overstrike ,
and back.
.RE
.IP "\fBSpell\fR"
This lets you check the spellings within the document:
.RS
.IP "\fBCheck Spelling\fR"
This invokes the \*(CO command
.B spell
to check the spellings of each word in the document.
Note that if you did not install
.BR spell 's
dictionaries when you installed \*(CO onto your system, this command
will not work.
.IP "\fBNext incorrect word\fR"
This jumps the cursor to the next misspelled word in the document, should
.B spell
have found one.
.IP "\fBSkip current word\fR"
This skips the current misspelled word and jumps the cursor to the next
misspelled word in the document, should
.B spell
have found one.
You can use this to skip words that
.B spell
mistakenly identified as misspelled.
.RE
.IP "\fBBlock\fR"
This menu lets you cut, paste, and delete blocks of text:
.RS
.IP "\fBSet Mark\fR"
Mark a line of text or the beginning of a block of text.
.B hwp
highlights the line that you have marked.
If you set two marks,
.B hwp
highlights all of the text between the marked lines, to show that all
text between the two marks is ``marked.''
.IP "\fBClear Marks\fR"
Remove any marks that you might already have set.
.IP "\fBCut Block\fR"
Copy all text between two marks into a special internal buffer, and
remove it from the screen.
.IP "\fBCopy Block\fR"
Copy text from the screen into an internal buffer, but do not delete it
from the screen.
You can paste copied text back onto the screen.
.IP "\fBDelete Block\fR"
Delete the marked text \(em that is, remove it from the screen but do not
copy it into an internal buffer.
Text that is deleted cannot be pasted.
.IP "\fBPaste Text\fR"
Copy cut or copied text from the internal buffer back onto the screen.
.RE
.SH "Key Commands"
.B hwp
recognizes a number of special keystrokes.
Each keystroke has a special task:
some let you move the cursor or shift the text being displayed;
others let you edit the document;
and still others are ``hot keys'' that let you invoke some of the
document-formatting tasks that are invoked through the menus described above.
.PP
The first group of special keys moves the cursor:
.IP \*(UA
Move the cursor up a line of text.
The cursor is not shifted left or right on the line.
.IS \*(DA
Move the cursor down a line of text.
The cursor is not shifted left or right on the line.
.IP \fB<End>\fR
Move the cursor to the end of the current line.
.IP \fB<Home>\fR
Move the cursor to the beginning of the current line.
.IP \fB<Page_Up>\fR
Move the cursor up by a screen-ful of text.
.IP \fB<Page_Down>\fR
Move the cursor down by a screen-ful of text.
.PP
The next group of key commands edit the text that is displayed
in the work area:
.IP \fB<Backspace>\fR
Erase text to the left.
As text is erased,
.B hwp
wraps and adjusts the text that remains in the document.
.IP \fB<Delete>\fR
Erase text to the right.
As text is erased,
.B hwp
wraps and adjusts the text that remains in the document.
.IP \fB<Insert>\fR
Toggle the mode of text entry between
.I Insert
and
.I Overstrike
modes.
In the former mode,
.B hwp
displaces existing text to make room for new text that you type.
It automatically adjusts and wraps the text as it is displaced.
In the latter mode,
.B hwp
overwrites existing text with the new text that you type.
.IP \*(RT
If
.B hwp
is displaying one of its command menus, then pressing \*(RT
tells
.B hwp
to execute the menu entry that is highlighted.
If, however, the cursor
is in the text area of
.BR hwp 's
display, pressing \*(RT breaks the current line of text
and moves the cursor to the beginning of the next line.
.IP \fB<Tab>\fR
Insert a horizontal-tab character into the text.
.PP
The final group of key commands are ``hot keys''.
Each invokes a function performed either by another special key or by one
of the menus described above.
.B hwp
recognizes the following hot keys:
.IP \fB<ctrl-B>\fR
Toggle boldfacing of text.
This combines functions
.B "Start Bold"
and
.B "End Bold"
from menu
.B Etc.
.IP \fB<ctrl-C>\fR
Cut text.
This duplicates function
.B "Cut Block"
from menu
.BR Block .
.IP \fB<ctrl-D>\fR
Delete a block of text.
This duplicates function
.B "Delete Block"
from menu
.BR Block .
.IP \fB<ctrl-F>\fR
Search for a string.
This duplicates the
.B Find
functions in the menu
.BR Locate .
.IP \fB<ctrl-I>\fR
Insert a tab character into the text.
.IP \fB<ctrl-K>\fR
Skip current word.
This duplicates function
.B "Skip current word"
from menu
.BR Spell .
.IP \fB<ctrl-L>\fR
Redraw the screen.
Use this keystroke should the screen become scrambled for any reason.
Note that this is only key in this group that does
.I not
duplicate an action perform by a menu or another key.
.IP \fB<ctrl-N>\fR
Next word.
This duplicates function
.B "Next incorrect word"
from menu
.BR Spell .
.IP \fB<ctrl-O>\fR
Copy a block of text from the screen into the cut buffer.
This duplicates function
.B "Copy Block"
from menu
.BR Block .
.IP \fB<ctrl-P>\fR
Paste a block of text.
This duplicates function
.B "Paste Block"
from menu
.BR Block .
.IP \fB<ctrl-Q>\fR
Quit
.BR hwp .
This duplicates function
.B Quit
from menu
.BR File .
.IP \fB<ctrl-S>\fR
Write to disk the file you are now editing.
This duplicates the
.B "Save File"
function from the menu
.BR File .
.IP \fB<ctrl-T>\fR
Toggle mode of text input, between
.I Insert
and
.I Overstrike
modes.
This duplicates the action of the \fB<Insert>\fR key.
.IP \fB<ctrl-U>\fR
Toggle underlining.
This combines functions
.B "Start Underline"
and
.B "End Underline"
from menu
.B Etc.
.IP \fB<ctrl-X>\fR
Set a mark.
This duplicates function
.B "Set Mark"
from menu
.BR Block .
.SH "Printing Text"
To print the document that is displayed on your screen, select either
.B "Print Epson"
or
.B "Print PostScript"
from the
.B File
menu.
This immediately formats the document and spools it for printing on the
type of printer you selected.
If you save the document into a file that has the suffix
.BR .hwp ,
you can spool that file from the \*(CO shell, just as you ordinarily do.
.PP
If you select a PostScript printer,
.B hwp
filters its output through the \*(CO command
.BR prps ,
which transforms its output into PostScript, then spools the document
to the spooler
.BR lp .
It produces monospaced output printed in 10-point Courier font.
If you have not set up
.B lp
to print on your system, you may wish either to do so, or to
recompile
.BR hwp .
For details on how to compile
.BR hwp ,
see below.
.SH "Command-line Option"
.B hwp
recognizes one command-line option:
.BR \-elm .
Use this option to output text without formatting.
This lets you use
.B hwp
as the default editor for the
.B elm
mailer.
.SH "Recompiling hwp"
As noted above, you can recompile
.B hwp
to change some of its default behaviors.
.PP
.BR hwp 's
default behaviors are set by the following macros within file
.BR hwp.c :
.IP \fBPSFILTER\fR
By default,
.B hwp
outputs
.BR nroff \-style
text:
that is, an underscored character is indicated by the escape sequence
``_\eb\fIc\fR'', and boldfacing by the escape sequence ``\fIc_c\fR''.
.B PSFILTER
names the program that
.B hwp
invokes to cook this output into PostScript format.
.IP \fBSPOOLER\fR
This names the program that
.B hwp
invokes to spool its output to your printer.
.IP \fBUNTABER\fR
This names the program that
.B hwp
invokes by default to transform tab characters into strings of space
characters.
.PP
.B hwp
has defaults for all of these macros.
The easiest (and best) way to modify these defaults is to modify the macro
.B CFLAGS
within the file
.BR Makefile.Coh .
At present, this macro reads as follows:
.DM
	CFLAGS=		-O -DSPOOLER="\e"lp\e"" -DCOHERENT -DPSFILTER="\e"prps -b -h\e"" -s
.DE
.PP
As you can see,
.B CFLAGS
sets macro
.B SPOOLER
to the \*(CO command 
.BR lp ;
and sets
.B PSFILTER
to the \*(CO command
.BR "prps \-b \-h" .
To modify
.BR hwp 's
default behaviors, modify this macro.
For details on how
.BR cc 's
option
.B \-D
works, see the Lexicon entry for
.BR cc .
.SH "See Also"
.B
commands,
nroff,
pr,
prps,
troff
.R
.SH Notes
.B hwp
was written by Harry C. Pulley, IV (hpulley@uoguelph.ca).
This manual page was written by Fred Butzen (fred@lepanto.mwc.com).
.PP
.B hwp
is copyright \(co 1993,1994 by Harry C. Pulley, IV.
It may be freely distributed and modified provided that this copyright
notice is not removed.
This program is offered ``as is'':
the author is not responsible in any manner whatsoever for any damage
or problems this program may cause.
.I "Caveat utilitor!"
