home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume14
/
jove4.9
/
part17
< prev
next >
Wrap
Text File
|
1988-04-27
|
41KB
|
1,168 lines
Subject: v14i073: Jove, an emacs variant, version 4.9, Part17/21
Newsgroups: comp.sources.unix
Sender: sources
Approved: rsalz@uunet.UU.NET
Submitted-by: Jonathan Payne <jpayne@cs.rochester.edu>
Posting-number: Volume 14, Issue 73
Archive-name: jove4.9/part17
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 17 (of 21)."
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './doc/jove.2' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./doc/jove.2'\"
else
echo shar: Extracting \"'./doc/jove.2'\" \(39282 characters\)
sed "s/^X//" >'./doc/jove.2' <<'END_OF_FILE'
X.NH 1
Commands for English Text
X.XS \n(PN
X\*(SN Commands for English Text
X.XE
X.LP
X\s-2JOVE\s0 has many commands that work on the basic units of English text:
words, sentences and paragraphs.
X.NH 2
Word Commands
X.XS \n(PN 5n
X\*(SN Word Commands
X.XE
X.LP
X\s-2JOVE\s0 has commands for moving over or operating on words.
By convention,
they are all ESC commands.
X.IP "ESC F" 20n
Move Forward over a word.
X.IP "ESC B" 20n
Move Backward over a word.
X.IP "ESC D" 20n
Kill forward to the end of a word.
X.IP "ESC Rubout" 20n
Kill backward to the beginning of a word.
X.LP
Notice how these commands form a group that parallels the character-
based commands,
C-F,
C-B,
C-D,
and Rubout.
X.LP
The commands ESC F and ESC B move forward and backward over words.
They are thus analogous to Control-F and Control-B,
which move over single characters.
Like their Control- analogues,
ESC F and ESC B move several words if given an argument.
ESC F with a negative argument moves backward like ESC B,
and ESC B with a negative argument moves forward.
Forward motion stops right after the last letter of the word,
while backward motion stops right before the first letter.
X.LP
It is easy to kill a word at a time.
ESC D kills the word after point.
To be precise,
it kills everything from point to the place ESC F would move to.
Thus,
if point is in the middle of a word,
only the part after point is killed.
If some punctuation comes after point,
and before the next word,
it is killed along with the word.
If you wish to kill only the next word but not the punctuation,
simply do ESC F to get to the end,
and kill the word backwards with ESC Rubout.
ESC D takes arguments just like ESC F.
X.LP
ESC Rubout kills the word before point.
It kills everything from point back to where ESC B would move to.
If point is after the space in "FOO, BAR",
then "FOO, " is killed.
If you wish to kill just "FOO",
then do a ESC B and a ESC D instead of a ESC Rubout.
X.NH 2
Sentence Commands
X.XS \n(PN 5n
X\*(SN Sentence Commands
X.XE
X.LP
The \s-2JOVE\s0 commands for manipulating sentences and paragraphs are
mostly ESC commands,
so as to resemble the word-handling commands.
X.IP "ESC A" 20n
Move back to the beginning of the sentence.
X.IP "ESC E" 20n
Move forward to the end of the sentence.
X.IP "ESC K" 20n
Kill forward to the end of the sentence.
X.IP "C-X Rubout" 20n
Kill back to the beginning of the sentence.
X.LP
The commands ESC A and ESC E move to the beginning and end of the
current sentence,
respectively.
They were chosen to resemble
Control-A and Control-E,
which move to the beginning and end of a line.
Unlike them,
ESC A and ESC E if repeated or given numeric arguments
move over successive sentences.
X\s-2JOVE\s0 considers a sentence to end wherever there is a ".",
X"?", or "!" followed by the end of a line
or by one or more spaces.
Neither ESC A nor ESC E moves past the
end of the line or spaces which delimit the sentence.
X.LP
Just as C-A and C-E have a kill command,
C-K,
to go with them,
so ESC A and ESC E have a corresponding kill command ESC K which kills from
point to the end of the sentence.
With minus one as an argument it
kills back to the beginning of the sentence.
Positive arguments serve as a repeat count.
X.LP
There is a special command,
C-X Rubout for killing back to the beginning of a sentence,
because this is useful when you change your
mind in the middle of composing text.
X.NH 2
Paragraph Commands
X.XS \n(PN 5n
X\*(SN Paragraph Commands
X.XE
X.LP
The \s-2JOVE\s0 commands for handling paragraphs are
X.IP "ESC [" 20n
Move back to previous paragraph beginning.
X.IP "ESC ]" 20n
Move forward to next paragraph end.
X.LP
ESC [ moves to the beginning of the current or previous paragraph, while
ESC ] moves to the end of the current or next paragraph. Paragraphs are
delimited by lines of differing indent, or lines with text formatter
commands, or blank lines. \s-2JOVE\s0 knows how to deal with most indented
paragraphs correctly, although it can get confused by one- or two-line
paragraphs delimited only by indentation.
X.NH 2
Text Indentation Commands
X.XS \n(PN 5n
X\*(SN Text Indentation Commands
X.XE
X.LP
X.IP "Tab" 20n
Indent "appropriately" in a mode-dependent fashion.
X.IP "LineFeed" 20n
Is the same as Return,
except it copies the indent of the line you just left.
X.IP "ESC M" 20n
Moves to the line's first non-blank character.
X.LP
X.LP
The way to request indentation is with the Tab command.
Its precise effect depends on the major mode.
In \fIText\fP mode,
it indents to the next tab stop.
In \fIC\fP mode,
it indents to the "right" position for C programs.
X.LP
To move over the indentation on a line,
do ESC M (\fIfirst-non-blank\fP).
This command,
given anywhere on a line,
positions the cursor at the first non-blank, non-tab character on the line.
X.NH 2
Text Filling
X.XS \n(PN 5n
X\*(SN Text Filling
X.XE
X.LP
X\fIAuto Fill\fP mode causes text to be \fIfilled\fP
X(broken up into lines that fit in a specified width)
automatically as you type it in.
If you alter existing text so that it is no longer properly filled,
X\s-2JOVE\s0 can fill it again if you ask.
X.LP
Entering \fIAuto Fill\fP mode is done with ESC X \fIauto-fill-mode\fP.
XFrom then on,
lines are broken automatically at spaces when they get longer than the
desired width.
To leave \fIAuto Fill\fP mode,
once again execute ESC X \fIauto-fill-mode\fP.
When \fIAuto Fill\fP mode is in effect,
the word \fBFill\fP appears in the mode line.
X.LP
If you edit the middle of a paragraph,
it may no longer correctly be filled.
To refill a paragraph,
use the command ESC J (\fIfill-paragraph\fP).
It causes the paragraph that point is inside to be filled.
All the line breaks are removed and new ones inserted where necessary.
X.LP
The maximum line width for filling is in the variable \fIright-margin\fP.
Both ESC J and auto-fill make sure that no line exceeds this width.
The value of \fIright-margin\fP is initially 78.
X.LP
Normally ESC J figures out the indent of the paragraph and uses that same
indent when filling. If you want to change the indent of a paragraph you
set \fIleft-margin\fP to the new position and type C-U\ ESC\ J.
X\fIfill-paragraph\fP, when supplied a numeric argument, uses the value of
X\fIleft-margin\fP.
X.LP
If you know where you want to set the right margin but you don't know the
actual value, move to where you want to set the value and use the
X\fIright-margin-here\fP command. \fIleft-margin-here\fP does the same
for the \fIleft-margin\fP variable.
X.NH 2
Case Conversion Commands
X.XS \n(PN 5n
X\*(SN Case Conversion Commands
X.XE
X.LP
X.IP "ESC L" 15n
Convert following word to lower case.
X.IP "ESC U" 15n
Convert following word to upper case.
X.IP "ESC C" 15n
Capitalize the following word.
X.LP
X.LP
The word conversion commands are most useful.
ESC L converts the word after point to lower case,
moving past it.
Thus,
successive ESC L's convert successive words.
ESC U converts to all capitals instead,
while ESC C puts the first letter of the word into upper case and the
rest into lower case.
All these commands convert several words at once if given an argument.
They are especially convenient for
converting a large amount of text from all upper case to mixed case,
because you can move through the test using ESC L,
ESC U or ESC C on each word as appropriate.
X.LP
When given a negative argument,
the word case conversion commands apply to
the appropriate number of words before point,
but do not move point.
This is convenient when you have just typed a word in the wrong case.
You can give the case conversion command and continue typing.
X.LP
If a word case conversion command is given in the middle of a word,
it applies only to the part of the word which follows the cursor,
treating it as a whole word.
X.LP
The other case conversion functions are \fIcase-region-upper\fP and
X\fIcase-region-lower\fP,
which convert everything between point and mark to the specified case.
Point and mark remain unchanged.
X.NH 2
Commands for Fixing Typos
X.XS \n(PN 5n
X\*(SN Commands for Fixing Typos
X.XE
X.LP
In this section we describe the commands that are especially useful
for the times when you catch a mistake on your text after you have made it,
or change your mind while composing text on line.
X.IP "Rubout" 25n
Delete last character.
X.IP "ESC Rubout" 25n
Kill last word.
X.IP "C-X Rubout" 25n
Kill to beginning of sentence.
X.IP "C-T" 25n
Transpose two characters.
X.IP "C-X C-T" 25n
Transpose two lines.
X.IP "ESC Minus ESC L" 25n
Convert last word to lower case.
X.IP "ESC Minus ESC U" 25n
Convert last word to upper case.
X.IP "ESC Minus ESC C" 25n
Convert last word to lower case with capital initial.
X.LP
X.NH 2
Killing Your Mistakes
X.XS \n(PN 5n
X\*(SN Killing Your Mistakes
X.XE
X.LP
The Rubout command is the most important correction command.
When used among printing (self-inserting) characters,
it can be thought of as canceling the last character typed.
X.LP
When your mistake is longer than a couple of characters,
it might be more convenient to use ESC Rubout or C-X Rubout.
ESC Rubout kills back to the start of the last word,
and C-X Rubout kills back to the start of the last sentence.
C-X Rubout is particularly useful when
you are thinking of what to write as you type it,
in case you change your mind about phrasing.
ESC Rubout and C-X Rubout save the killed text for C-Y and ESC Y to retrieve.
X.LP
ESC Rubout is often useful even when you have typed only a few
characters wrong,
if you know you are confused in your typing and aren't sure what you typed.
At such a time,
you cannot correct with
Rubout except by looking at the screen to see what you did.
It requires less thought to kill the whole word and start over again,
especially if the system is heavily loaded.
X.LP
If you were typing a command or command parameters, C-G will abort the
command with no further processing.
X.NH 2
Transposition
X.XS \n(PN 5n
X\*(SN Transposition
X.XE
X.LP
The common error of transposing two characters can be fixed
with the C-T (\fItranspose-characters\fP) command.
Normally,
C-T transposes the two characters on either side of the cursor
and moves the cursor forward one character. Repeating the command
several times "drags" a character to the right.
X(Remember that \fIpoint\fP is considered to be between two characters,
even though the visible cursor in your terminal is on only one of them.)
When given at the end of a line,
rather than switching the last character of the line with the line separator,
which would be useless,
C-T transposes the last two characters on the line.
So,
if you catch your transposition error right away,
you can fix it with just a C-T.
If you don't catch it so fast,
you must move the cursor back to between the two characters.
X.LP
To transpose two lines,
use the C-X C-T (\fItranspose-lines\fP) command. The line containing the
cursor is exchanged with the line above it; the cursor is left at the
beginning of the line following its original position.
X.NH 2
Checking and Correcting Spelling
X.XS \n(PN 5n
X\*(SN Checking and Correcting Spelling
X.XE
X.LP
When you write a paper,
you should correct its spelling at some point close to finishing it.
To correct the entire buffer,
do ESC X \fIspell-buffer\fP.
This invokes the
X.UX
X.I spell
program,
which prints a list of all the misspelled words.
X\s-2JOVE\s0 catches the list and places it in a
X\s-2JOVE\s0 buffer called \fBSpell\fP.
You are given an opportunity to delete from that buffer any words that
aren't really errors;
then \s-2JOVE\s0 looks up each misspelled word and
remembers where it is in the buffer being corrected.
Then you can go forward to each misspelled word with C-X C-N (\fInext-error\fP)
and backward with C-X C-P (\fIprevious-error\fP).
See the section entitled \fIError Message Parsing\fP.
X.NH 1
File Handling
X.XS \n(PN
X\*(SN File Handling
X.XE
X.LP
The basic unit of stored data is the file.
Each program,
each paper,
lives usually in its own file.
To edit a program or paper,
the editor must be told the name of the file that contains it.
This is called \fIvisiting\fP a file.
To make your changes to the file permanent on disk,
you must \fIsave\fP the file.
X.NH 2
Visiting Files
X.XS \n(PN 5n
X\*(SN Visiting Files
X.XE
X.LP
X.IP "C-X C-V" 15n
Visit a file.
X.IP "C-X C-R" 15n
Same as C-X C-V.
X.IP "C-X C-S" 15n
Save the visited file.
X.IP "ESC ~" 15n
Tell \s-2JOVE\s0 to forget that the buffer has been changed.
X.LP
X.LP
X\fIVisiting\fP a file means copying its contents into \s-2JOVE\s0 where you
can edit them.
X\s-2JOVE\s0 remembers the name of the file you visited.
Unless you use the multiple buffer feature of \s-2JOVE\s0,
you can only be visiting one file at a time.
The name of the current selected buffer is visible in the mode line.
X.LP
The changes you make with \s-2JOVE\s0 are made in a copy inside \s-2JOVE\s0.
The file itself is not changed.
The changed text is not permanent until you \fIsave\fP it in a file.
The first time you change the text,
an asterisk appears at the end of the mode line; this indicates that the text
contains fresh changes which will be lost unless you save them.
X.LP
To visit a file,
use the command C-X C-V.
Follow the command with the name of the file you wish to visit,
terminated by a Return.
You can abort the command by typing C-G,
or edit the filename with many of the standard \s-2JOVE\s0 commands
X(e.g., C-A, C-E, C-F, ESC F, ESC Rubout).
If the filename you wish to visit is similar to the filename in the
mode line (the default filename),
you can type C-R to insert the default and then edit it.
If you do type a Return to finish the command,
the new file's text appears on the screen,
and its name appears in the mode line.
In addition,
its name becomes the new default filename.
X.LP
If you wish to save the file and make your changes permanent,
type C-X C-S.
After the save is finished,
C-X C-S prints the filename and the
number of characters and lines that it wrote to the file.
If there are no changes to save (no asterisk at the end of the mode line),
the file is not saved;
otherwise the changes saved and the asterisk at the end of
the mode line will disappear.
X.LP
What if you want to create a file? Just visit it.
X\s-2JOVE\s0 prints
X\fI(New file)\fP but aside from that behaves as if you had visited an existing
empty file.
If you make any changes and save them,
the file is created.
If you visit a nonexistent file unintentionally
X(because you typed the wrong filename),
go ahead and visit the file you meant.
If you don't save the unwanted file,
it is not created.
X.LP
If you alter one file and then visit another in the same buffer,
X\s-2JOVE\s0 offers to save the old one.
If you answer YES,
the old file is saved;
if you answer NO,
all the changes you have made to it since the last save are lost.
You should not type ahead after a file visiting
command,
because your type-ahead might answer an unexpected question
in a way that you would regret.
X.LP
Sometimes you will change a buffer by accident.
Even if you undo the effect of the change by editing,
X\s-2JOVE\s0 still knows that "the buffer has been changed".
You can tell \s-2JOVE\s0 to pretend that there have been no changes with the
ESC \s+2~\s0 command (\fImake-buffer-unmodified\fP).
This command simply clears the "modified" flag which
says that the buffer contains changes which need to be saved.
Even if
the buffer really \fIis\fP changed \s-2JOVE\s0 will still act as if it were not.
X.LP
If \s-2JOVE\s0 is about to save a file and sees that the date of the version
on disk does not match what \s-2JOVE\s0 last read or wrote,
X\s-2JOVE\s0 notifies you of this fact,
and asks what to do, because this probably means that something is wrong.
For example,
somebody else may have been editing the same file.
If this is so,
there is a good chance that your work
or his work will be lost if you don't take the proper steps.
You should first find out exactly what is going on.
If you determine that somebody else has modified the file,
save your file under a different filename and then DIFF the two files
to merge the two sets of changes. (The "patch" command is useful for
applying the results of context diffs directly).
Also get in touch with the other person so that the files don't diverge
any further.
X.NH 2
How to Undo Drastic Changes to a File
X.XS \n(PN 5n
X\*(SN How to Undo Drastic Changes to a File
X.XE
X.LP
If you have made several extensive changes to a file and then change
your mind about them,
and you haven't yet saved them,
you can get rid of them by reading in the previous version of the file.
You can do this with the C-X C-V command,
to visit the unsaved version of the file.
X.NH 2
Recovering from system/editor crashes
X.XS \n(PN 5n
X\*(SN Recovering from system/editor crashes
X.XE
X.LP
JOVE does not have \fIAuto Save\fP mode, but it does provide a way to
recover your work in the event of a system or editor crash. JOVE saves
information about the files you're editing every so many changes to a
buffer to make recovery possible. Since a relatively small amount of
information is involved it's hardly even noticeable when JOVE does this. The
variable "sync-frequency" says how often to save the necessary
information, and the default is every 50 changes. 50 is a very
reasonable number: if you are writing a paper you will not lose more than
the last 50 characters you typed, which is less than the average length
of a line.
X.NH 2
Miscellaneous File Operations
X.XS \n(PN 5n
X\*(SN Miscellaneous File Operations
X.XE
X.LP
X.LP
ESC X \fIwrite-file\fP <file><return> writes the contents of the buffer
into the file <file>,
and then visits that file.
It can be thought of as a way of "changing the name" of
the file you are visiting.
Unlike C-X C-S,
X\fIwrite-file\fP saves even if the buffer has not been changed.
C-X C-W is another way of getting this command.
X.LP
ESC X \fIinsert-file\fP <file><return> inserts the contents of <file> into the
buffer at point,
leaving point unchanged before the contents.
You can also use C-X C-I to get this command.
X.LP
ESC X \fIwrite-region\fP <file><return> writes the region (the text between
point and mark) to the specified file.
It does not set the visited filename.
The buffer is not changed.
X.LP
ESC X \fIappend-region\fP <file><return> appends the region to <file>.
The text is added to the end of <file>.
X.NH 1
Using Multiple Buffers
X.XS \n(PN
X\*(SN Using Multiple Buffers
X.XE
X.LP
When we speak of "the buffer",
which contains the text you are editing,
we have given the impression that there is only one.
In fact,
there may be many of them,
each with its own body of text.
At any time only one buffer can be \fIselected\fP and available for editing,
but it isn't hard to switch to a different one.
Each buffer individually remembers which file it is visiting,
what modes are in effect,
and whether there are any changes that need saving.
X.IP "C-X B" 15n
Select or create a buffer.
X.IP "C-X C-F" 15n
Visit a file in its own buffer.
X.IP "C-X C-B" 15n
List the existing buffers.
X.IP "C-X K" 15n
Kill a buffer.
X.LP
Each buffer in \s-2JOVE\s0 has a single name,
which normally doesn't change.
A buffer's name can be any length.
The name of the currently selected buffer
and the name of the file visited in it
are visible in the mode line when you are at top level.
A newly started \s-2JOVE\s0 has only one buffer,
named \fBMain\fP, unless you specified files to edit in the
shell command that started \s-2JOVE\s0.
X.NH 2
Creating and Selecting Buffers
X.XS \n(PN 5n
X\*(SN Creating and Selecting Buffers
X.XE
X.LP
To create a new buffer,
you need only think of a name for it (say, FOO)
and then do C-X B FOO<return>,
which is the command C-X B (\fIselect-buffer\fP) followed by the name.
This makes a new,
empty buffer (if one by that name didn't previously exist)
and selects it for editing.
The new buffer is not visiting any file,
so if you try to save it you will be asked for the filename to use.
Each buffer has its own major mode;
the new buffer's major mode is \fIText\fP mode by default.
X.LP
To return to buffer FOO later after having switched to another,
the same command C-X B FOO<return> is used,
since C-X B can tell whether a buffer named FOO exists already or not.
C-X B Main<return> reselects the buffer Main that \s-2JOVE\s0 started out with.
Just C-X B<return> reselects the previous buffer.
Repeated C-X B<return>'s alternate between the last two buffers selected.
X.LP
You can also read a file into its own newly created buffer,
all with one command: C-X C-F (\fIfind-file\fP),
followed by the filename.
The name of the buffer is the last element of the file's pathname.
C-F stands for "Find",
because if the specified file already resides in a buffer in your \s-2JOVE\s0,
that buffer is reselected.
So you need not remember whether you have brought the file in already or not.
A buffer created by C-X C-F can be reselected later with C-X B or C-X C-F,
whichever you find more convenient.
Nonexistent files can be created with C-X C-F just as they can with C-X C-V.
X.NH 2
Using Existing Buffers
X.XS \n(PN 5n
X\*(SN Using Existing Buffers
X.XE
X.LP
To get a list of all the buffers that exist,
do C-X C-B (\fIlist-buffers\fP).
Each buffer's type,
name,
and visited filename is printed.
An asterisk before the buffer name indicates a
buffer which contains changes that have not been saved. The number
that appears at the beginning of a line in a C-X C-B listing is that
buffer's \fIbuffer number\fP.
You can select a buffer by typing its number in place of its name.
If a buffer with that number doesn't already exist,
a new buffer is created with that number as its name.
X.LP
If several buffers have modified text in them,
you should save some of them with C-X C-M (\fIwrite-modified-files\fP).
This finds all the buffers that need saving and then saves them.
Saving the buffers this way is much
easier and more efficient (but more dangerous)
than selecting each one and typing C-X C-S.
If you give C-X C-M an argument, \s-2JOVE\s0 will ask for confirmation
before saving each buffer.
X.LP
ESC X \fIrename-buffer\fP <new name><return> changes the name of the currently
selected buffer.
X.LP
ESC X \fIerase-buffer\fP <buffer name><return> erases the contents of the
X<buffer name> without deleting the buffer entirely.
X.NH 2
Killing Buffers
X.XS \n(PN 5n
X\*(SN Killing Buffers
X.XE
X.LP
After you use a \s-2JOVE\s0 for a while,
it may fill up with buffers which you no longer need.
Eventually you can reach a point where trying to
create any more results in an "out of memory" or "out of lines"
error.
When this happens you will want to kill some buffers with the
C-X K (\fIdelete-buffer\fP) command.
You can kill the buffer FOO by doing C-X K FOO<return>.
If you type C-X K <return> JOVE will kill the previously selected buffer.
If you try to kill a buffer that needs saving \s-2JOVE\s0
will ask you to confirm it.
X.LP
If you need to kill several buffers, use the command \fIkill-some-buffers\fP.
This prompts you with the name of each buffer and asks for confirmation
before killing that buffer.
X.NH 1
Controlling the Display
X.XS \n(PN
X\*(SN Controlling the Display
X.XE
X.LP
Since only part of a large file will fit on the screen,
X\s-2JOVE\s0 tries to show the part that is likely to be interesting.
The display control commands allow you to see a different part of the file.
X.IP "C-L" 15n
Reposition point at a specified vertical position,
OR clear and redraw the screen with point in the same place.
X.IP "C-V" 15n
Scroll forwards (a screen or a few lines).
X.IP "ESC V" 15n
Scroll backwards.
X.IP "C-Z" 15n
Scroll forward some lines.
X.IP "ESC Z" 15n
Scroll backwards some lines.
X.LP
X.LP
The terminal screen is rarely large enough to display all of your
file.
If the whole buffer doesn't fit on the screen,
X\s-2JOVE\s0 shows a contiguous portion of it,
containing
X.I point.
It continues to show approximately the same portion
until point moves outside of what is displayed;
then \s-2JOVE\s0 chooses a new portion centered around the new
X.I point.
This is \s-2JOVE\s0's guess as to what you are most interested in seeing,
but if the guess is wrong,
you can use the display control commands to see a different portion.
The available screen area through which you can see part of
the buffer is called \fIthe window\fP,
and the choice of where in the
buffer to start displaying is also called \fIthe window\fP. (When
there is only one window, it plus the mode line and the input line take
up the whole screen).
X.LP
First we describe how \s-2JOVE\s0 chooses a new window position on its own.
The goal is usually to place
X.I point
half way down the window.
This is controlled by the variable \fIscroll-step\fP,
whose value is the number of
lines above the bottom or below the top of the window that the line
containing point is placed.
A value of 0 (the initial value) means center
X.I point
in the window.
X.LP
The basic display control command is C-L (\fIredraw-display\fP).
In its simplest form,
with no argument,
it tells \s-2JOVE\s0 to choose a new window position,
centering point half way from the top as usual.
X.LP
C-L with a positive argument chooses a new window so as to put point
that many lines from the top.
An argument of zero puts point on the very top line.
Point does not move with respect to the text; rather,
the text and point move rigidly on the screen.
X.LP
If point stays on the same line,
the window is first cleared and then redrawn.
Thus,
two C-L's in a row are guaranteed to clear the current window.
ESC C-L will clear and redraw the entire screen.
X.LP
The \fIscrolling\fP commands C-V,
ESC V,
C-Z,
and ESC Z,
let you move the whole display up or down a few lines.
C-V (\fInext-page\fP) with an
argument shows you that many more lines at the bottom of the screen,
moving the text and point up together as C-L might.
C-V with a
negative argument shows you more lines at the top of the screen,
as does ESC V (\fIprevious-page\fP) with a positive argument.
X.LP
To read the buffer a window at a time,
use the C-V command with no argument.
It takes the last line at the bottom of the window and puts
it at the top,
followed by nearly a whole window of lines not visible before.
Point is put at the top of the window.
Thus, each C-V shows the "next page of text",
except for one line of overlap to provide context.
To move backward,
use ESC V without an argument,
which moves a whole window backwards (again with a line of overlap).
X.LP
C-Z and ESC Z scroll one line forward and one line backward,
respectively.
These are convenient for moving in units of lines
without having to type a numeric argument.
X.NH 2
Multiple Windows
X.XS \n(PN 5n
X\*(SN Multiple Windows
X.XE
X.LP
X\s-2JOVE\s0 allows you to split the screen into two or more \fIwindows\fP and
use them to display parts of different files,
or different parts of the same file.
X.IP "C-X 2" 15n
Divide the current window into two smaller ones.
X.IP "C-X 1" 15n
Delete all windows but the current one.
X.IP "C-X D" 15n
Delete current window.
X.IP "C-X N" 15n
Switch to the next window.
X.IP "C-X P" 15n
Switch to the previous window.
X.IP "C-X O" 15n
Same as C-X P.
X.IP "C-X ^" 15n
Make this window bigger.
X.IP "ESC C-V" 15n
Scroll the other window.
X.LP
X.LP
When using \fImultiple window\fP mode,
the text portion of the screen
is divided into separate parts called \fIwindows\fP,
which can display different pieces of text.
Each window can display different files,
or parts of the same file.
Only one of the windows is
X.I active;
that is
the window which the cursor is in.
Editing normally takes place in that window alone.
To edit in another window,
you would give a command to move the cursor to the other window,
and then edit there.
X.LP
Each window displays a mode line for the buffer it's displaying.
This is useful to keep track of which window corresponds with which
file. In addition, the mode line serves as a separator between windows.
By setting the variable \fImode-line-should-standout\fP to "on" you can
have \s-2JOVE\s0 display the mode-line in reverse video (assuming your
particular terminal has the reverse video capability).
X.LP
The command C-X 2 (\fIsplit-current-window\fP) enters multiple window mode.
A new mode line appears across the middle of the screen,
dividing the text display area into two halves.
Both windows contain the same buffer and display the same position in it,
namely where point was at the time you issued the command.
The cursor moves to the second window.
X.LP
To return to viewing only one window,
use the command C-X 1 (\fIdelete-other-windows\fP).
The current window expands to fill the whole screen,
and the other windows disappear until the next C-X 2.
X(The buffers and their contents are unaffected by any of the
window operations).
X.LP
While there is more than one window,
you can use C-X N (\fInext-window\fP) to switch to the next window,
and C-X P (\fIprevious-window\fP) to switch to the previous one.
If you are in the bottom window and you type C-X N,
you will be placed in the top window,
and the same kind of thing happens when you type C-X P in the top window,
namely you will be placed in the bottom window.
C-X O is the same as C-X P.
It stands for "other window" because when there are only two windows,
repeated use of this command will switch between the two windows.
X.LP
Often you will be editing one window while using the other just for reference.
Then,
the command ESC C-V (\fIpage-next-window\fP) is very useful.
It scrolls the next window,
as if you switched to the next window,
typed C-V,
and switched back,
without your having to do all that.
With a negative argument,
ESC C-V will do an ESC V in the next window.
X.LP
When a window splits,
both halves are approximately the same size.
You can redistribute the screen space between the windows with
the C-X ^ (\fIgrow-window\fP) command.
It makes the currently selected window grow one line bigger,
or as many lines as is specified with a numeric argument.
Use ESC X \fIshrink-window\fP to make the current window smaller.
X.NH 2
Multiple Windows and Multiple Buffers
X.XS \n(PN 5n
X\*(SN Multiple Windows and Multiple Buffers
X.XE
X.LP
Buffers can be selected independently in each window.
The C-X B command selects a new buffer in whichever window contains
the cursor.
Other windows' buffers do not change.
X.LP
You can view the same buffer in more than one window.
Although the same buffer appears in both windows,
they have different values of point,
so you can move around in one window while the other window
continues to show the same text.
Then,
having found one place you wish to refer to, you can go back into the
other window with C-X O or C-X P to make your changes.
X.LP
If you have the same buffer in both windows,
you must beware of trying to visit a different file in one of
the windows with C-X C-V,
because if you bring a new file into this buffer,
it will replaced the old file in \fIboth\fP windows.
To view different files in different windows,
you must switch buffers in one of the windows first
X(with C-X B or C-X C-F, perhaps).
X.LP
A convenient "combination" command for viewing something in another
window is C-X 4 (\fIwindow-find\fP).
With this command you can ask to see any specified buffer,
file or tag in the other window.
Follow the C-X 4 with either B and a buffer name,
F and a filename,
or T and a tag name.
This switches to the other window and finds there what you specified.
If you were previously in one-window mode,
multiple-window mode is entered.
C-X 4 B is similar to C-X 2 C-X B.
C-X 4 F is similar to C-X 2 C-X C-F.
C-X 4 T is similar to C-X 2 C-X
T.
The difference is one of efficiency,
and also that C-X 4 works equally well if you are already using two windows.
X.NH 1
Processes Under \s-2JOVE\s0
X.XS \n(PN
X\*(SN Processes Under \s-2JOVE\s0
X.XE
X.LP
Another feature in \s-2JOVE\s0 is its ability to interact with
X.UX
in a useful way.
You can run other
X.UX
commands from \s-2JOVE\s0 and catch their output in \s-2JOVE\s0 buffers.
In this chapter we will discuss the different
ways to run and interact with
X.UX
commands.
X.NH 2
Non-interactive
X.UX
commands
X.XS \n(PN 5n
X\*(SN Non-interactive
X.XE
X.LP
To run a
X.UX
command from \s-2JOVE\s0 just type "C-X !" followed by the name
of the command terminated with Return.
For example,
to get a list of all the users on the system,
you do:
X.DS I
C-X ! who<return>
X.DE
Then \s-2JOVE\s0 picks a reasonable buffer in which the output from the
command will be placed.
E.g.,
X"who" uses a buffer called \fBwho\fP;
X"ps alx" uses \fBps\fP;
and "fgrep -n foo *.c" uses \fBfgrep\fP.
If \s-2JOVE\s0
wants to use a buffer that already exists it first erases the old contents.
If the buffer it selects holds a file,
not output from a previous shell command,
you must first delete that buffer with C-X K.
X.LP
Once \s-2JOVE\s0 has picked a buffer it puts that buffer in a window so you
can see the command's output as it is running.
If there is only one window \s-2JOVE\s0 will automatically make another one.
Otherwise,
X\s-2JOVE\s0
tries to pick the most convenient window which isn't the current one.
X.LP
It's not a good idea to type anything while the command is running.
There are two reasons for this:
X.IP (i)
X\s-2JOVE\s0 won't see the characters (thus won't execute them) until the
command finishes,
so you may forget what you've typed.
X.IP (ii)
Although \s-2JOVE\s0 won't know what you've typed,
it
X.I will
know that you've typed something,
and then it will try to be "smart" and not update the
display until it's interpreted what you've typed.
But,
of course,
X\s-2JOVE\s0 won't interpret what you type until the
X.UX
command completes,
so you're left with the uneasy feeling you get when you
don't know what the hell the computer is doing*.
X.FS
X*This is a bug and should be fixed,
but probably won't be for a while.
X.FE
X.LP
If you want to interrupt the command for some reason (perhaps you
mistyped it, or you changed your mind) you can type C-].
Typing this
inside \s-2JOVE\s0 while a process is running is the same as typing C-C when
you are outside \s-2JOVE\s0,
namely the process stops in a hurry.
X.LP
When the command finishes, \s-2JOVE\s0 puts you back in the window in which
you started.
Then it prints a message indicating whether or not the command
completed successfully in its (the command's) opinion.
That is,
if the command had what it considers an error
X(or you interrupt it with C-])
X\s-2JOVE\s0 will print an appropriate message.
X
X.NH 2
Limitations of Non-Interactive Processes
X.XS \n(PN 5n
X\*(SN Limitations of Non-Interactive Processes
X.XE
X.LP
The reason these are called non-interactive processes is that you
can't type any input to them; you can't interact with them; they can't
ask you questions because there is no way for you to answer.
For example,
you can't run a command interpreter (a shell), or
X.I mail
or
X.I crypt
with C-X ! because there is no way to provide it with input.
Remember that \s-2JOVE\s0 (not the process in the window)
is listening to your keyboard,
and \s-2JOVE\s0 waits until the process dies before it looks at
what you type.
X.LP
C-X ! is useful for running commands that do some output and then exit.
For example,
it's very useful to use with the C compiler to
catch compilation error messages (see Compiling C Programs),
or with the \fIgrep\fP commands.
X.NH 2
Interactive Processes \(em Run a Shell in a Window
X.XS \n(PN 5n
X\*(SN Interactive Processes \(em Run a Shell in a Window
X.XE
X.LP
Some versions of \s-2JOVE\s0\(dg
X.FS
X\(dg For example, the version provided with 4.3BSD.
X.FE
have the capability of running interactive
processes.
This is more useful than non-interactive processes for
certain types of jobs:
X.IP (i)
You can go off and do some editing while the command is running.
This is useful for commands that do sporadic output and run for fairly long
periods of time.
X.IP (ii)
Unlike non-interactive processes,
you can type input to these.
In addition,
you can edit what you type with the power of all the \s-2JOVE\s0
commands \fIbefore\fP you send the input to the process.
This is a really important feature,
and is especially useful for running a shell in a window.
X.IP (iii)
Because you can continue with normal editing while one of the
processes is running,
you can create a bunch of contexts and manage them
X(select them, delete them, or temporarily put them aside)
with \s-2JOVE\s0's window and buffer mechanisms.
X.LP
Although we may have given an image of processes being attached to
X.I windows,
in fact they are attached to
X.I buffers.
Therefore,
once an \fIi-process\fP is running you can select another buffer into that window,
or if you wish you can delete the window altogether.
If you reselect that buffer later it will be up to date.
That is,
even though the
buffer wasn't visible it was still receiving output from the process.
You don't have to worry about missing anything when the buffer isn't visible.
X.NH 2
Advantages of Running Processes in \s-2JOVE\s0 Windows.
X.XS \n(PN 5n
X\*(SN Advantages of Running Processes in \s-2JOVE\s0 Windows.
X.XE
X.LP
There are several advantages to running a shell in a window.
What you type isn't seen immediately by the process;
instead \s-2JOVE\s0 waits until
you type an entire line before passing it on to the process to read.
This means that before you type <return>
all of \s-2JOVE\s0's editing
capabilities are available for fixing errors on your input line.
If you discover an error at the beginning of the line,
rather than erasing the whole line and starting over,
you can simply move to the error,
correct it,
move back and continue typing.
X.LP
Another feature is that you have the entire history of your session in
a \s-2JOVE\s0 buffer.
You don't have to worry about output from a command
moving past the top of the screen.
If you missed some output you can
move back through it with ESC V and other commands.
In addition,
you can save yourself retyping a command (or a similar one) by sending
edited versions of previous commands, or edit the output of one command
to become a list of commands to be executed ("immediate shell scripts").
X.NH 2
Differences between Normal and I-process Buffers
X.XS \n(PN 5n
X\*(SN Differences between Normal and I-process Buffers
X.XE
X.LP
X\s-2JOVE\s0 behaves differently in several ways when you are in an \fIi-process\fP
buffer.
Most obviously, <return> does different things
depending on both your position in the buffer and on the state of the process.
In the normal case,
when point is at the end of the buffer,
Return does what you'd expect: it inserts a line-separator and then
sends the line to the process.
If you are somewhere else in the buffer,
possibly positioned at a previous command that you want to edit,
Return will place a copy of that line
X(with the prompt discarded if there is one)
at the end of the buffer and move you there.
Then you can edit the line and type Return as in the normal case.
If the process has died for some reason,
Return does nothing.
It doesn't even insert itself.
If that happens unexpectedly,
you should type ESC X \fIlist-processes\fP<return>
to get a list of each process and its state.
If your process died abnormally,
X\fIlist-processes\fP may help you figure out why.
X.NH 2
How to Run a Shell in a Window
X.XS \n(PN 5n
X\*(SN How to Run a Shell in a Window
X.XE
X.LP
Type ESC X \fIshell\fP<return> to start up a shell.
As with C-X !,
X\s-2JOVE\s0 will
create a buffer,
called \fB*shell*\-1\fP,
and select a window for this new buffer.
But unlike C-X ! you will be left in the new window.
Now,
the shell process is said to be attached to \fBshell\-1\fP.
END_OF_FILE
if test 39282 -ne `wc -c <'./doc/jove.2'`; then
echo shar: \"'./doc/jove.2'\" unpacked with wrong size!
fi
# end of './doc/jove.2'
fi
echo shar: End of archive 17 \(of 21\).
cp /dev/null ark17isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 21 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0