Subject: v08i029: The JOVE text editor, Part10/13 Newsgroups: mod.sources Approved: mirror!rs Submitted by: seismo!rochester!jpayne (Jonathan Payne) Mod.sources: Volume 8, Issue 29 Archive-name: jove/Part10 #! /bin/sh # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # If all goes well, you will see the message "End of archive 10 (of 13)." # Contents: doc/jove.2 doc/recover.nr PATH=/bin:/usr/bin:/usr/ucb; export PATH echo shar: extracting "'doc/jove.2'" '(39282 characters)' if test -f 'doc/jove.2' ; then echo shar: will not over-write existing file "'doc/jove.2'" else sed 's/^X//' >doc/jove.2 <<'@//E*O*F doc/jove.2//' X.NH 1 XCommands 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: Xwords, sentences and paragraphs. X.NH 2 XWord 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. XBy convention, Xthey are all ESC commands. X.IP "ESC F" 20n XMove Forward over a word. X.IP "ESC B" 20n XMove Backward over a word. X.IP "ESC D" 20n XKill forward to the end of a word. X.IP "ESC Rubout" 20n XKill backward to the beginning of a word. X.LP XNotice how these commands form a group that parallels the character- Xbased commands, XC-F, XC-B, XC-D, Xand Rubout. X.LP XThe commands ESC F and ESC B move forward and backward over words. XThey are thus analogous to Control-F and Control-B, Xwhich move over single characters. XLike their Control- analogues, XESC F and ESC B move several words if given an argument. XESC F with a negative argument moves backward like ESC B, Xand ESC B with a negative argument moves forward. XForward motion stops right after the last letter of the word, Xwhile backward motion stops right before the first letter. X.LP XIt is easy to kill a word at a time. XESC D kills the word after point. XTo be precise, Xit kills everything from point to the place ESC F would move to. XThus, Xif point is in the middle of a word, Xonly the part after point is killed. XIf some punctuation comes after point, Xand before the next word, Xit is killed along with the word. XIf you wish to kill only the next word but not the punctuation, Xsimply do ESC F to get to the end, Xand kill the word backwards with ESC Rubout. XESC D takes arguments just like ESC F. X.LP XESC Rubout kills the word before point. XIt kills everything from point back to where ESC B would move to. XIf point is after the space in "FOO, BAR", Xthen "FOO, " is killed. XIf you wish to kill just "FOO", Xthen do a ESC B and a ESC D instead of a ESC Rubout. X.NH 2 XSentence Commands X.XS \n(PN 5n X\*(SN Sentence Commands X.XE X.LP XThe \s-2JOVE\s0 commands for manipulating sentences and paragraphs are Xmostly ESC commands, Xso as to resemble the word-handling commands. X.IP "ESC A" 20n XMove back to the beginning of the sentence. X.IP "ESC E" 20n XMove forward to the end of the sentence. X.IP "ESC K" 20n XKill forward to the end of the sentence. X.IP "C-X Rubout" 20n XKill back to the beginning of the sentence. X.LP XThe commands ESC A and ESC E move to the beginning and end of the Xcurrent sentence, Xrespectively. XThey were chosen to resemble XControl-A and Control-E, Xwhich move to the beginning and end of a line. XUnlike them, XESC A and ESC E if repeated or given numeric arguments Xmove 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 Xor by one or more spaces. XNeither ESC A nor ESC E moves past the Xend of the line or spaces which delimit the sentence. X.LP XJust as C-A and C-E have a kill command, XC-K, Xto go with them, Xso ESC A and ESC E have a corresponding kill command ESC K which kills from Xpoint to the end of the sentence. XWith minus one as an argument it Xkills back to the beginning of the sentence. XPositive arguments serve as a repeat count. X.LP XThere is a special command, XC-X Rubout for killing back to the beginning of a sentence, Xbecause this is useful when you change your Xmind in the middle of composing text. X.NH 2 XParagraph Commands X.XS \n(PN 5n X\*(SN Paragraph Commands X.XE X.LP XThe \s-2JOVE\s0 commands for handling paragraphs are X.IP "ESC [" 20n XMove back to previous paragraph beginning. X.IP "ESC ]" 20n XMove forward to next paragraph end. X.LP XESC [ moves to the beginning of the current or previous paragraph, while XESC ] moves to the end of the current or next paragraph. Paragraphs are Xdelimited by lines of differing indent, or lines with text formatter Xcommands, or blank lines. \s-2JOVE\s0 knows how to deal with most indented Xparagraphs correctly, although it can get confused by one- or two-line Xparagraphs delimited only by indentation. X.NH 2 XText Indentation Commands X.XS \n(PN 5n X\*(SN Text Indentation Commands X.XE X.LP X.IP "Tab" 20n XIndent "appropriately" in a mode-dependent fashion. X.IP "LineFeed" 20n XIs the same as Return, Xexcept it copies the indent of the line you just left. X.IP "ESC M" 20n XMoves to the line's first non-blank character. X.LP X.LP XThe way to request indentation is with the Tab command. XIts precise effect depends on the major mode. XIn \fIText\fP mode, Xit indents to the next tab stop. XIn \fIC\fP mode, Xit indents to the "right" position for C programs. X.LP XTo move over the indentation on a line, Xdo ESC M (\fIfirst-non-blank\fP). XThis command, Xgiven anywhere on a line, Xpositions the cursor at the first non-blank, non-tab character on the line. X.NH 2 XText 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) Xautomatically as you type it in. XIf 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 XEntering \fIAuto Fill\fP mode is done with ESC X \fIauto-fill-mode\fP. X>From then on, Xlines are broken automatically at spaces when they get longer than the Xdesired width. XTo leave \fIAuto Fill\fP mode, Xonce again execute ESC X \fIauto-fill-mode\fP. XWhen \fIAuto Fill\fP mode is in effect, Xthe word \fBFill\fP appears in the mode line. X.LP XIf you edit the middle of a paragraph, Xit may no longer correctly be filled. XTo refill a paragraph, Xuse the command ESC J (\fIfill-paragraph\fP). XIt causes the paragraph that point is inside to be filled. XAll the line breaks are removed and new ones inserted where necessary. X.LP XThe maximum line width for filling is in the variable \fIright-margin\fP. XBoth ESC J and auto-fill make sure that no line exceeds this width. XThe value of \fIright-margin\fP is initially 72. X.LP XNormally ESC J figures out the indent of the paragraph and uses that same Xindent when filling. If you want to change the indent of a paragraph you Xset \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 XIf you know where you want to set the right margin but you don't know the Xactual 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 Xfor the \fIleft-margin\fP variable. X.NH 2 XCase Conversion Commands X.XS \n(PN 5n X\*(SN Case Conversion Commands X.XE X.LP X.IP "ESC L" 15n XConvert following word to lower case. X.IP "ESC U" 15n XConvert following word to upper case. X.IP "ESC C" 15n XCapitalize the following word. X.LP X.LP XThe word conversion commands are most useful. XESC L converts the word after point to lower case, Xmoving past it. XThus, Xsuccessive ESC L's convert successive words. XESC U converts to all capitals instead, Xwhile ESC C puts the first letter of the word into upper case and the Xrest into lower case. XAll these commands convert several words at once if given an argument. XThey are especially convenient for Xconverting a large amount of text from all upper case to mixed case, Xbecause you can move through the test using ESC L, XESC U or ESC C on each word as appropriate. X.LP XWhen given a negative argument, Xthe word case conversion commands apply to Xthe appropriate number of words before point, Xbut do not move point. XThis is convenient when you have just typed a word in the wrong case. XYou can give the case conversion command and continue typing. X.LP XIf a word case conversion command is given in the middle of a word, Xit applies only to the part of the word which follows the cursor, Xtreating it as a whole word. X.LP XThe other case conversion functions are \fIcase-region-upper\fP and X\fIcase-region-lower\fP, Xwhich convert everything between point and mark to the specified case. XPoint and mark remain unchanged. X.NH 2 XCommands for Fixing Typos X.XS \n(PN 5n X\*(SN Commands for Fixing Typos X.XE X.LP XIn this section we describe the commands that are especially useful Xfor the times when you catch a mistake on your text after you have made it, Xor change your mind while composing text on line. X.IP "Rubout" 25n XDelete last character. X.IP "ESC Rubout" 25n XKill last word. X.IP "C-X Rubout" 25n XKill to beginning of sentence. X.IP "C-T" 25n XTranspose two characters. X.IP "C-X C-T" 25n XTranspose two lines. X.IP "ESC Minus ESC L" 25n XConvert last word to lower case. X.IP "ESC Minus ESC U" 25n XConvert last word to upper case. X.IP "ESC Minus ESC C" 25n XConvert last word to lower case with capital initial. X.LP X.NH 2 XKilling Your Mistakes X.XS \n(PN 5n X\*(SN Killing Your Mistakes X.XE X.LP XThe Rubout command is the most important correction command. XWhen used among printing (self-inserting) characters, Xit can be thought of as canceling the last character typed. X.LP XWhen your mistake is longer than a couple of characters, Xit might be more convenient to use ESC Rubout or C-X Rubout. XESC Rubout kills back to the start of the last word, Xand C-X Rubout kills back to the start of the last sentence. XC-X Rubout is particularly useful when Xyou are thinking of what to write as you type it, Xin case you change your mind about phrasing. XESC Rubout and C-X Rubout save the killed text for C-Y and ESC Y to retrieve. X.LP XESC Rubout is often useful even when you have typed only a few Xcharacters wrong, Xif you know you are confused in your typing and aren't sure what you typed. XAt such a time, Xyou cannot correct with XRubout except by looking at the screen to see what you did. XIt requires less thought to kill the whole word and start over again, Xespecially if the system is heavily loaded. X.LP XIf you were typing a command or command parameters, C-G will abort the Xcommand with no further processing. X.NH 2 XTransposition X.XS \n(PN 5n X\*(SN Transposition X.XE X.LP XThe common error of transposing two characters can be fixed Xwith the C-T (\fItranspose-characters\fP) command. XNormally, XC-T transposes the two characters on either side of the cursor Xand moves the cursor forward one character. Repeating the command Xseveral times "drags" a character to the right. X(Remember that \fIpoint\fP is considered to be between two characters, Xeven though the visible cursor in your terminal is on only one of them.) XWhen given at the end of a line, Xrather than switching the last character of the line with the line separator, Xwhich would be useless, XC-T transposes the last two characters on the line. XSo, Xif you catch your transposition error right away, Xyou can fix it with just a C-T. XIf you don't catch it so fast, Xyou must move the cursor back to between the two characters. X.LP XTo transpose two lines, Xuse the C-X C-T (\fItranspose-lines\fP) command. The line containing the Xcursor is exchanged with the line above it; the cursor is left at the Xbeginning of the line following its original position. X.NH 2 XChecking and Correcting Spelling X.XS \n(PN 5n X\*(SN Checking and Correcting Spelling X.XE X.LP XWhen you write a paper, Xyou should correct its spelling at some point close to finishing it. XTo correct the entire buffer, Xdo ESC X \fIspell-buffer\fP. XThis invokes the X.UX X.I spell Xprogram, Xwhich 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. XYou are given an opportunity to delete from that buffer any words that Xaren't really errors; Xthen \s-2JOVE\s0 looks up each misspelled word and Xremembers where it is in the buffer being corrected. XThen you can go forward to each misspelled word with C-X C-N (\fInext-error\fP) Xand backward with C-X C-P (\fIprevious-error\fP). XSee the section entitled \fIError Message Parsing\fP. X.NH 1 XFile Handling X.XS \n(PN X\*(SN File Handling X.XE X.LP XThe basic unit of stored data is the file. XEach program, Xeach paper, Xlives usually in its own file. XTo edit a program or paper, Xthe editor must be told the name of the file that contains it. XThis is called \fIvisiting\fP a file. XTo make your changes to the file permanent on disk, Xyou must \fIsave\fP the file. X.NH 2 XVisiting Files X.XS \n(PN 5n X\*(SN Visiting Files X.XE X.LP X.IP "C-X C-V" 15n XVisit a file. X.IP "C-X C-R" 15n XSame as C-X C-V. X.IP "C-X C-S" 15n XSave the visited file. X.IP "ESC ~" 15n XTell \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 Xcan edit them. X\s-2JOVE\s0 remembers the name of the file you visited. XUnless you use the multiple buffer feature of \s-2JOVE\s0, Xyou can only be visiting one file at a time. XThe name of the current selected buffer is visible in the mode line. X.LP XThe changes you make with \s-2JOVE\s0 are made in a copy inside \s-2JOVE\s0. XThe file itself is not changed. XThe changed text is not permanent until you \fIsave\fP it in a file. XThe first time you change the text, Xan asterisk appears at the end of the mode line; this indicates that the text Xcontains fresh changes which will be lost unless you save them. X.LP XTo visit a file, Xuse the command C-X C-V. XFollow the command with the name of the file you wish to visit, Xterminated by a Return. XYou can abort the command by typing C-G, Xor 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). XIf the filename you wish to visit is similar to the filename in the Xmode line (the default filename), Xyou can type C-R to insert the default and then edit it. XIf you do type a Return to finish the command, Xthe new file's text appears on the screen, Xand its name appears in the mode line. XIn addition, Xits name becomes the new default filename. X.LP XIf you wish to save the file and make your changes permanent, Xtype C-X C-S. XAfter the save is finished, XC-X C-S prints the filename and the Xnumber of characters and lines that it wrote to the file. XIf there are no changes to save (no asterisk at the end of the mode line), Xthe file is not saved; Xotherwise the changes saved and the asterisk at the end of Xthe mode line will disappear. X.LP XWhat 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 Xempty file. XIf you make any changes and save them, Xthe file is created. XIf you visit a nonexistent file unintentionally X(because you typed the wrong filename), Xgo ahead and visit the file you meant. XIf you don't save the unwanted file, Xit is not created. X.LP XIf you alter one file and then visit another in the same buffer, X\s-2JOVE\s0 offers to save the old one. XIf you answer YES, Xthe old file is saved; Xif you answer NO, Xall the changes you have made to it since the last save are lost. XYou should not type ahead after a file visiting Xcommand, Xbecause your type-ahead might answer an unexpected question Xin a way that you would regret. X.LP XSometimes you will change a buffer by accident. XEven if you undo the effect of the change by editing, X\s-2JOVE\s0 still knows that "the buffer has been changed". XYou can tell \s-2JOVE\s0 to pretend that there have been no changes with the XESC \s+2~\s0 command (\fImake-buffer-unmodified\fP). XThis command simply clears the "modified" flag which Xsays that the buffer contains changes which need to be saved. XEven if Xthe buffer really \fIis\fP changed \s-2JOVE\s0 will still act as if it were not. X.LP XIf \s-2JOVE\s0 is about to save a file and sees that the date of the version Xon disk does not match what \s-2JOVE\s0 last read or wrote, X\s-2JOVE\s0 notifies you of this fact, Xand asks what to do, because this probably means that something is wrong. XFor example, Xsomebody else may have been editing the same file. XIf this is so, Xthere is a good chance that your work Xor his work will be lost if you don't take the proper steps. XYou should first find out exactly what is going on. XIf you determine that somebody else has modified the file, Xsave your file under a different filename and then DIFF the two files Xto merge the two sets of changes. (The "patch" command is useful for Xapplying the results of context diffs directly). XAlso get in touch with the other person so that the files don't diverge Xany further. X.NH 2 XHow 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 XIf you have made several extensive changes to a file and then change Xyour mind about them, Xand you haven't yet saved them, Xyou can get rid of them by reading in the previous version of the file. XYou can do this with the C-X C-V command, Xto visit the unsaved version of the file. X.NH 2 XRecovering from system/editor crashes X.XS \n(PN 5n X\*(SN Recovering from system/editor crashes X.XE X.LP XJOVE does not have \fIAuto Save\fP mode, but it does provide a way to Xrecover your work in the event of a system or editor crash. JOVE saves Xinformation about the files you're editing every so many changes to a Xbuffer to make recovery possible. Since a relatively small amount of Xinformation is involved it's hardly even noticeable when JOVE does this. The Xvariable "sync-frequency" says how often to save the necessary Xinformation, and the default is every 50 changes. 50 is a very Xreasonable number: if you are writing a paper you will not lose more than Xthe last 50 characters you typed, which is less than the average length Xof a line. X.NH 2 XMiscellaneous File Operations X.XS \n(PN 5n X\*(SN Miscellaneous File Operations X.XE X.LP X.LP XESC X \fIwrite-file\fP writes the contents of the buffer Xinto the file , Xand then visits that file. XIt can be thought of as a way of "changing the name" of Xthe file you are visiting. XUnlike C-X C-S, X\fIwrite-file\fP saves even if the buffer has not been changed. XC-X C-W is another way of getting this command. X.LP XESC X \fIinsert-file\fP inserts the contents of into the Xbuffer at point, Xleaving point unchanged before the contents. XYou can also use C-X C-I to get this command. X.LP XESC X \fIwrite-region\fP writes the region (the text between Xpoint and mark) to the specified file. XIt does not set the visited filename. XThe buffer is not changed. X.LP XESC X \fIappend-region\fP appends the region to . XThe text is added to the end of . X.NH 1 XUsing Multiple Buffers X.XS \n(PN X\*(SN Using Multiple Buffers X.XE X.LP XWhen we speak of "the buffer", Xwhich contains the text you are editing, Xwe have given the impression that there is only one. XIn fact, Xthere may be many of them, Xeach with its own body of text. XAt any time only one buffer can be \fIselected\fP and available for editing, Xbut it isn't hard to switch to a different one. XEach buffer individually remembers which file it is visiting, Xwhat modes are in effect, Xand whether there are any changes that need saving. X.IP "C-X B" 15n XSelect or create a buffer. X.IP "C-X C-F" 15n XVisit a file in its own buffer. X.IP "C-X C-B" 15n XList the existing buffers. X.IP "C-X K" 15n XKill a buffer. X.LP XEach buffer in \s-2JOVE\s0 has a single name, Xwhich normally doesn't change. XA buffer's name can be any length. XThe name of the currently selected buffer Xand the name of the file visited in it Xare visible in the mode line when you are at top level. XA newly started \s-2JOVE\s0 has only one buffer, Xnamed \fBMain\fP, unless you specified files to edit in the Xshell command that started \s-2JOVE\s0. X.NH 2 XCreating and Selecting Buffers X.XS \n(PN 5n X\*(SN Creating and Selecting Buffers X.XE X.LP XTo create a new buffer, Xyou need only think of a name for it (say, FOO) Xand then do C-X B FOO, Xwhich is the command C-X B (\fIselect-buffer\fP) followed by the name. XThis makes a new, Xempty buffer (if one by that name didn't previously exist) Xand selects it for editing. XThe new buffer is not visiting any file, Xso if you try to save it you will be asked for the filename to use. XEach buffer has its own major mode; Xthe new buffer's major mode is \fIText\fP mode by default. X.LP XTo return to buffer FOO later after having switched to another, Xthe same command C-X B FOO is used, Xsince C-X B can tell whether a buffer named FOO exists already or not. XC-X B Main reselects the buffer Main that \s-2JOVE\s0 started out with. XJust C-X B reselects the previous buffer. XRepeated C-X B's alternate between the last two buffers selected. X.LP XYou can also read a file into its own newly created buffer, Xall with one command: C-X C-F (\fIfind-file\fP), Xfollowed by the filename. XThe name of the buffer is the last element of the file's pathname. XC-F stands for "Find", Xbecause if the specified file already resides in a buffer in your \s-2JOVE\s0, Xthat buffer is reselected. XSo you need not remember whether you have brought the file in already or not. XA buffer created by C-X C-F can be reselected later with C-X B or C-X C-F, Xwhichever you find more convenient. XNonexistent files can be created with C-X C-F just as they can with C-X C-V. X.NH 2 XUsing Existing Buffers X.XS \n(PN 5n X\*(SN Using Existing Buffers X.XE X.LP XTo get a list of all the buffers that exist, Xdo C-X C-B (\fIlist-buffers\fP). XEach buffer's type, Xname, Xand visited filename is printed. XAn asterisk before the buffer name indicates a Xbuffer which contains changes that have not been saved. The number Xthat appears at the beginning of a line in a C-X C-B listing is that Xbuffer's \fIbuffer number\fP. XYou can select a buffer by typing its number in place of its name. XIf a buffer with that number doesn't already exist, Xa new buffer is created with that number as its name. X.LP XIf several buffers have modified text in them, Xyou should save some of them with C-X C-M (\fIwrite-modified-files\fP). XThis finds all the buffers that need saving and then saves them. XSaving the buffers this way is much Xeasier and more efficient (but more dangerous) Xthan selecting each one and typing C-X C-S. XIf you give C-X C-M an argument, \s-2JOVE\s0 will ask for confirmation Xbefore saving each buffer. X.LP XESC X \fIrename-buffer\fP changes the name of the currently Xselected buffer. X.LP XESC X \fIerase-buffer\fP erases the contents of the X without deleting the buffer entirely. X.NH 2 XKilling Buffers X.XS \n(PN 5n X\*(SN Killing Buffers X.XE X.LP XAfter you use a \s-2JOVE\s0 for a while, Xit may fill up with buffers which you no longer need. XEventually you can reach a point where trying to Xcreate any more results in an "out of memory" or "out of lines" Xerror. XWhen this happens you will want to kill some buffers with the XC-X K (\fIdelete-buffer\fP) command. XYou can kill the buffer FOO by doing C-X K FOO. XIf you type C-X K JOVE will kill the previously selected buffer. XIf you try to kill a buffer that needs saving \s-2JOVE\s0 Xwill ask you to confirm it. X.LP XIf you need to kill several buffers, use the command \fIkill-some-buffers\fP. XThis prompts you with the name of each buffer and asks for confirmation Xbefore killing that buffer. X.NH 1 XControlling the Display X.XS \n(PN X\*(SN Controlling the Display X.XE X.LP XSince 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. XThe display control commands allow you to see a different part of the file. X.IP "C-L" 15n XReposition point at a specified vertical position, XOR clear and redraw the screen with point in the same place. X.IP "C-V" 15n XScroll forwards (a screen or a few lines). X.IP "ESC V" 15n XScroll backwards. X.IP "C-Z" 15n XScroll forward some lines. X.IP "ESC Z" 15n XScroll backwards some lines. X.LP X.LP XThe terminal screen is rarely large enough to display all of your Xfile. XIf the whole buffer doesn't fit on the screen, X\s-2JOVE\s0 shows a contiguous portion of it, Xcontaining X.I point. XIt continues to show approximately the same portion Xuntil point moves outside of what is displayed; Xthen \s-2JOVE\s0 chooses a new portion centered around the new X.I point. XThis is \s-2JOVE\s0's guess as to what you are most interested in seeing, Xbut if the guess is wrong, Xyou can use the display control commands to see a different portion. XThe available screen area through which you can see part of Xthe buffer is called \fIthe window\fP, Xand the choice of where in the Xbuffer to start displaying is also called \fIthe window\fP. (When Xthere is only one window, it plus the mode line and the input line take Xup the whole screen). X.LP XFirst we describe how \s-2JOVE\s0 chooses a new window position on its own. XThe goal is usually to place X.I point Xhalf way down the window. XThis is controlled by the variable \fIscroll-step\fP, Xwhose value is the number of Xlines above the bottom or below the top of the window that the line Xcontaining point is placed. XA value of 0 (the initial value) means center X.I point Xin the window. X.LP XThe basic display control command is C-L (\fIredraw-display\fP). XIn its simplest form, Xwith no argument, Xit tells \s-2JOVE\s0 to choose a new window position, Xcentering point half way from the top as usual. X.LP XC-L with a positive argument chooses a new window so as to put point Xthat many lines from the top. XAn argument of zero puts point on the very top line. XPoint does not move with respect to the text; rather, Xthe text and point move rigidly on the screen. X.LP XIf point stays on the same line, Xthe window is first cleared and then redrawn. XThus, Xtwo C-L's in a row are guaranteed to clear the current window. XESC C-L will clear and redraw the entire screen. X.LP XThe \fIscrolling\fP commands C-V, XESC V, XC-Z, Xand ESC Z, Xlet you move the whole display up or down a few lines. XC-V (\fInext-page\fP) with an Xargument shows you that many more lines at the bottom of the screen, Xmoving the text and point up together as C-L might. XC-V with a Xnegative argument shows you more lines at the top of the screen, Xas does ESC V (\fIprevious-page\fP) with a positive argument. X.LP XTo read the buffer a window at a time, Xuse the C-V command with no argument. XIt takes the last line at the bottom of the window and puts Xit at the top, Xfollowed by nearly a whole window of lines not visible before. XPoint is put at the top of the window. XThus, each C-V shows the "next page of text", Xexcept for one line of overlap to provide context. XTo move backward, Xuse ESC V without an argument, Xwhich moves a whole window backwards (again with a line of overlap). X.LP XC-Z and ESC Z scroll one line forward and one line backward, Xrespectively. XThese are convenient for moving in units of lines Xwithout having to type a numeric argument. X.NH 2 XMultiple 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 Xuse them to display parts of different files, Xor different parts of the same file. X.IP "C-X 2" 15n XDivide the current window into two smaller ones. X.IP "C-X 1" 15n XDelete all windows but the current one. X.IP "C-X D" 15n XDelete current window. X.IP "C-X N" 15n XSwitch to the next window. X.IP "C-X P" 15n XSwitch to the previous window. X.IP "C-X O" 15n XSame as C-X P. X.IP "C-X ^" 15n XMake this window bigger. X.IP "ESC C-V" 15n XScroll the other window. X.LP X.LP XWhen using \fImultiple window\fP mode, Xthe text portion of the screen Xis divided into separate parts called \fIwindows\fP, Xwhich can display different pieces of text. XEach window can display different files, Xor parts of the same file. XOnly one of the windows is X.I active; Xthat is Xthe window which the cursor is in. XEditing normally takes place in that window alone. XTo edit in another window, Xyou would give a command to move the cursor to the other window, Xand then edit there. X.LP XEach window displays a mode line for the buffer it's displaying. XThis is useful to keep track of which window corresponds with which Xfile. In addition, the mode line serves as a separator between windows. XBy setting the variable \fImode-line-should-standout\fP to "on" you can Xhave \s-2JOVE\s0 display the mode-line in reverse video (assuming your Xparticular terminal has the reverse video capability). X.LP XThe command C-X 2 (\fIsplit-current-window\fP) enters multiple window mode. XA new mode line appears across the middle of the screen, Xdividing the text display area into two halves. XBoth windows contain the same buffer and display the same position in it, Xnamely where point was at the time you issued the command. XThe cursor moves to the second window. X.LP XTo return to viewing only one window, Xuse the command C-X 1 (\fIdelete-other-windows\fP). XThe current window expands to fill the whole screen, Xand the other windows disappear until the next C-X 2. X(The buffers and their contents are unaffected by any of the Xwindow operations). X.LP XWhile there is more than one window, Xyou can use C-X N (\fInext-window\fP) to switch to the next window, Xand C-X P (\fIprevious-window\fP) to switch to the previous one. XIf you are in the bottom window and you type C-X N, Xyou will be placed in the top window, Xand the same kind of thing happens when you type C-X P in the top window, Xnamely you will be placed in the bottom window. XC-X O is the same as C-X P. XIt stands for "other window" because when there are only two windows, Xrepeated use of this command will switch between the two windows. X.LP XOften you will be editing one window while using the other just for reference. XThen, Xthe command ESC C-V (\fIpage-next-window\fP) is very useful. XIt scrolls the next window, Xas if you switched to the next window, Xtyped C-V, Xand switched back, Xwithout your having to do all that. XWith a negative argument, XESC C-V will do an ESC V in the next window. X.LP XWhen a window splits, Xboth halves are approximately the same size. XYou can redistribute the screen space between the windows with Xthe C-X ^ (\fIgrow-window\fP) command. XIt makes the currently selected window grow one line bigger, Xor as many lines as is specified with a numeric argument. XUse ESC X \fIshrink-window\fP to make the current window smaller. X.NH 2 XMultiple Windows and Multiple Buffers X.XS \n(PN 5n X\*(SN Multiple Windows and Multiple Buffers X.XE X.LP XBuffers can be selected independently in each window. XThe C-X B command selects a new buffer in whichever window contains Xthe cursor. XOther windows' buffers do not change. X.LP XYou can view the same buffer in more than one window. XAlthough the same buffer appears in both windows, Xthey have different values of point, Xso you can move around in one window while the other window Xcontinues to show the same text. XThen, Xhaving found one place you wish to refer to, you can go back into the Xother window with C-X O or C-X P to make your changes. X.LP XIf you have the same buffer in both windows, Xyou must beware of trying to visit a different file in one of Xthe windows with C-X C-V, Xbecause if you bring a new file into this buffer, Xit will replaced the old file in \fIboth\fP windows. XTo view different files in different windows, Xyou must switch buffers in one of the windows first X(with C-X B or C-X C-F, perhaps). X.LP XA convenient "combination" command for viewing something in another Xwindow is C-X 4 (\fIwindow-find\fP). XWith this command you can ask to see any specified buffer, Xfile or tag in the other window. XFollow the C-X 4 with either B and a buffer name, XF and a filename, Xor T and a tag name. XThis switches to the other window and finds there what you specified. XIf you were previously in one-window mode, Xmultiple-window mode is entered. XC-X 4 B is similar to C-X 2 C-X B. XC-X 4 F is similar to C-X 2 C-X C-F. XC-X 4 T is similar to C-X 2 C-X XT. XThe difference is one of efficiency, Xand also that C-X 4 works equally well if you are already using two windows. X.NH 1 XProcesses Under \s-2JOVE\s0 X.XS \n(PN X\*(SN Processes Under \s-2JOVE\s0 X.XE X.LP XAnother feature in \s-2JOVE\s0 is its ability to interact with X.UX Xin a useful way. XYou can run other X.UX Xcommands from \s-2JOVE\s0 and catch their output in \s-2JOVE\s0 buffers. XIn this chapter we will discuss the different Xways to run and interact with X.UX Xcommands. X.NH 2 XNon-interactive X.UX Xcommands X.XS \n(PN 5n X\*(SN Non-interactive X.XE X.LP XTo run a X.UX Xcommand from \s-2JOVE\s0 just type "C-X !" followed by the name Xof the command terminated with Return. XFor example, Xto get a list of all the users on the system, Xyou do: X.DS I XC-X ! who X.DE XThen \s-2JOVE\s0 picks a reasonable buffer in which the output from the Xcommand will be placed. XE.g., X"who" uses a buffer called \fBwho\fP; X"ps alx" uses \fBps\fP; Xand "fgrep -n foo *.c" uses \fBfgrep\fP. XIf \s-2JOVE\s0 Xwants to use a buffer that already exists it first erases the old contents. XIf the buffer it selects holds a file, Xnot output from a previous shell command, Xyou must first delete that buffer with C-X K. X.LP XOnce \s-2JOVE\s0 has picked a buffer it puts that buffer in a window so you Xcan see the command's output as it is running. XIf there is only one window \s-2JOVE\s0 will automatically make another one. XOtherwise, X\s-2JOVE\s0 Xtries to pick the most convenient window which isn't the current one. X.LP XIt's not a good idea to type anything while the command is running. XThere are two reasons for this: X.IP (i) X\s-2JOVE\s0 won't see the characters (thus won't execute them) until the Xcommand finishes, Xso you may forget what you've typed. X.IP (ii) XAlthough \s-2JOVE\s0 won't know what you've typed, Xit X.I will Xknow that you've typed something, Xand then it will try to be "smart" and not update the Xdisplay until it's interpreted what you've typed. XBut, Xof course, X\s-2JOVE\s0 won't interpret what you type until the X.UX Xcommand completes, Xso you're left with the uneasy feeling you get when you Xdon't know what the hell the computer is doing*. X.FS X*This is a bug and should be fixed, Xbut probably won't be for a while. X.FE X.LP XIf you want to interrupt the command for some reason (perhaps you Xmistyped it, or you changed your mind) you can type C-]. XTyping this Xinside \s-2JOVE\s0 while a process is running is the same as typing C-C when Xyou are outside \s-2JOVE\s0, Xnamely the process stops in a hurry. X.LP XWhen the command finishes, \s-2JOVE\s0 puts you back in the window in which Xyou started. XThen it prints a message indicating whether or not the command Xcompleted successfully in its (the command's) opinion. XThat is, Xif 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.NH 2 XLimitations of Non-Interactive Processes X.XS \n(PN 5n X\*(SN Limitations of Non-Interactive Processes X.XE X.LP XThe reason these are called non-interactive processes is that you Xcan't type any input to them; you can't interact with them; they can't Xask you questions because there is no way for you to answer. XFor example, Xyou can't run a command interpreter (a shell), or X.I mail Xor X.I crypt Xwith C-X ! because there is no way to provide it with input. XRemember that \s-2JOVE\s0 (not the process in the window) Xis listening to your keyboard, Xand \s-2JOVE\s0 waits until the process dies before it looks at Xwhat you type. X.LP XC-X ! is useful for running commands that do some output and then exit. XFor example, Xit's very useful to use with the C compiler to Xcatch compilation error messages (see Compiling C Programs), Xor with the \fIgrep\fP commands. X.NH 2 XInteractive 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 XSome versions of \s-2JOVE\s0\(dg X.FS X\(dg For example, the version provided with 4.3BSD. X.FE Xhave the capability of running interactive Xprocesses. XThis is more useful than non-interactive processes for Xcertain types of jobs: X.IP (i) XYou can go off and do some editing while the command is running. XThis is useful for commands that do sporadic output and run for fairly long Xperiods of time. X.IP (ii) XUnlike non-interactive processes, Xyou can type input to these. XIn addition, Xyou can edit what you type with the power of all the \s-2JOVE\s0 Xcommands \fIbefore\fP you send the input to the process. XThis is a really important feature, Xand is especially useful for running a shell in a window. X.IP (iii) XBecause you can continue with normal editing while one of the Xprocesses is running, Xyou can create a bunch of contexts and manage them X(select them, delete them, or temporarily put them aside) Xwith \s-2JOVE\s0's window and buffer mechanisms. X.LP XAlthough we may have given an image of processes being attached to X.I windows, Xin fact they are attached to X.I buffers. XTherefore, Xonce an \fIi-process\fP is running you can select another buffer into that window, Xor if you wish you can delete the window altogether. XIf you reselect that buffer later it will be up to date. XThat is, Xeven though the Xbuffer wasn't visible it was still receiving output from the process. XYou don't have to worry about missing anything when the buffer isn't visible. X.NH 2 XAdvantages 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 XThere are several advantages to running a shell in a window. XWhat you type isn't seen immediately by the process; Xinstead \s-2JOVE\s0 waits until Xyou type an entire line before passing it on to the process to read. XThis means that before you type Xall of \s-2JOVE\s0's editing Xcapabilities are available for fixing errors on your input line. XIf you discover an error at the beginning of the line, Xrather than erasing the whole line and starting over, Xyou can simply move to the error, Xcorrect it, Xmove back and continue typing. X.LP XAnother feature is that you have the entire history of your session in Xa \s-2JOVE\s0 buffer. XYou don't have to worry about output from a command Xmoving past the top of the screen. XIf you missed some output you can Xmove back through it with ESC V and other commands. XIn addition, Xyou can save yourself retyping a command (or a similar one) by sending Xedited versions of previous commands, or edit the output of one command Xto become a list of commands to be executed ("immediate shell scripts"). X.NH 2 XDifferences 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 Xbuffer. XMost obviously, does different things Xdepending on both your position in the buffer and on the state of the process. XIn the normal case, Xwhen point is at the end of the buffer, XReturn does what you'd expect: it inserts a line-separator and then Xsends the line to the process. XIf you are somewhere else in the buffer, Xpossibly positioned at a previous command that you want to edit, XReturn will place a copy of that line X(with the prompt discarded if there is one) Xat the end of the buffer and move you there. XThen you can edit the line and type Return as in the normal case. XIf the process has died for some reason, XReturn does nothing. XIt doesn't even insert itself. XIf that happens unexpectedly, Xyou should type ESC X \fIlist-processes\fP Xto get a list of each process and its state. XIf your process died abnormally, X\fIlist-processes\fP may help you figure out why. X.NH 2 XHow 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 XType ESC X \fIshell\fP to start up a shell. XAs with C-X !, X\s-2JOVE\s0 will Xcreate a buffer, Xcalled \fB*shell*\-1\fP, Xand select a window for this new buffer. XBut unlike C-X ! you will be left in the new window. XNow, Xthe shell process is said to be attached to \fBshell\-1\fP. @//E*O*F doc/jove.2// if test 39282 -ne "`wc -c <'doc/jove.2'`"; then echo shar: error transmitting "'doc/jove.2'" '(should have been 39282 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/recover.nr'" '(3997 characters)' if test -f 'doc/recover.nr' ; then echo shar: will not over-write existing file "'doc/recover.nr'" else sed 's/^X//' >doc/recover.nr <<'@//E*O*F doc/recover.nr//' X.TH RECOVER 1 "12 February 1986" X.ad X.SH NAME Xrecover - recover JOVE buffers after a system/editor crash X.SH SYNOPSIS Xjove -r X.SH DESCRIPTION XRECOVER lets you recover your work in the JOVE editor in the event of a Xsystem or JOVE crash. It is designed to put invoked through JOVE with the X"-r" switch. RECOVER looks for JOVE buffers that are left around and are Xowned by you. (You cannot recover other peoples' buffers, obviously.) XWhen the system is rebooted after a crash, you type "jove -r" after you've Xlogged in. If there were no buffers that were modified at the time of the Xcrash or there were but RECOVER can't get its hands on them, you will be Xinformed with the message, "There is nothing to recover." Otherwise, XRECOVER prints the date and time of the version of the buffers it has, Xand then waits for you type a command. X.LP XTo get a list of the buffers RECOVER knows about, use the X.I list Xcommand. This will list all the buffers and the files and the number of Xlines associated with them. Next to each buffer is a number. When you want Xto recover a buffer, use the X.I get Xcommand. The syntax is X.I get buffer filename Xwhere X.I buffer Xis either the buffer's name or the number at the beginning of the line. If Xyou don't type the buffer name or the filename, RECOVER will prompt you Xfor them. X.LP XIf there are a lot of buffers and you want to recover all of them, use the X.I recover Xcommand. This will recover each buffer to the name of the buffer with ".#" Xprepended to the name (so that the original isn't over-written). It asks Xfor each file and if you want to restore that buffer to that name you type X"yes". If you want to recover the file but to a different name, just type Xthat name in. If you type "no" RECOVER will skip that file and go on Xto the next one. X.LP XIf you want to look at a buffer before deciding to recover it, use the X.I print Xcommand. The syntax for this is X.I print buffer Xwhere X.I buffer Xagain is either its name or the number. You can type ^C if you want to Xabort printing the file to the terminal, and RECOVER will respond with Xan appropriate message. X.LP XWhen you're done and have all the buffers you want, type the X.I quit Xcommand to leave. You will then be asked whether it's okay to delete the Xtmp files. Most of the time that's okay and you should type "yes". When Xyou say that, JOVE removes all traces of those buffers and you won't be able Xto look at them again. (If you recovered some buffers they will still be Xaround, so don't worry.) So, if you're not sure whether you've gotten all Xthe buffers, you should answer "no" so that you'll be able to run XRECOVER again at a later time (presumably after you've figured out Xwhich ones you want to save). X.LP XIf you type ^C at any time other than when you're printing a file to the Xterminal, RECOVER will exit without a word. If you do this but wish you Xhadn't, just type "jove -r" to the shell again, and you will be put back Xwith no loss. X.SH A SAMPLE SESSION X.sp 1 X.nf X% jove -r XFound 2 buffers (last updated: Sun Apr 14 14:13:38 1985). X(Type '?' for options): list X1) buffer recover.1 "/u/staff/jpay/doc/recover.1" (120 lines) X2) buffer recover.c "/u/staff/jpay/jove/recover.c" (635 lines) X(Type '?' for options): get recover.1 recover.save X"recover.save" 53 lines, 1821 characters. X(Type '?' for options): quit XShould I delete the tmp files? yes X% X.fi X.LP XHere I "got" the buffer X.I recover.1 Xand restored it to the temporary file X.I recover.save. XIt's generally a good idea to recover buffers to temporary files and then Xcompare them to the original or at least look them over before putting them Xback in their real name. This is just in case you were restoring what you Xthought you were restoring. X.fi X.SH FILES XTMPDIR - where temporary files are stored. X.SH SEE ALSO XJOVE(1) - for this to make any sense to you. X.SH DIAGNOSTICS XRECOVER diagnostics are meant to be self-explanitory. X.SH BUGS XIt works well enough, but what an awful user interface! X.SH AUTHOR XJonathan Payne @//E*O*F doc/recover.nr// if test 3997 -ne "`wc -c <'doc/recover.nr'`"; then echo shar: error transmitting "'doc/recover.nr'" '(should have been 3997 characters)' fi fi # end of overwriting check echo shar: "End of archive 10 (of 13)." cp /dev/null ark10isdone DONE=true for I in 1 2 3 4 5 6 7 8 9 10 11 12 13; do if test -f ark${I}isdone; then echo "You have run archive ${I}." else echo "You still need to run archive ${I}." DONE=false fi done case $DONE in true) echo "You have run all 13 archives." echo 'Now read the README and Makefile.' ;; esac ## End of shell archive. exit 0