|
|
1.1 root 1: .\" @(#)jove.2 6.1 (Berkeley) 5/30/86
2: .\"
3: .NH 1
4: Commands for English Text
5: .XS \n(PN
6: \*(SN Commands for English Text
7: .XE
8: .LP
9: \s-2JOVE\s0 has many commands that work on the basic units of English text:
10: words, sentences and paragraphs.
11: .NH 2
12: Word Commands
13: .XS \n(PN 5n
14: \*(SN Word Commands
15: .XE
16: .LP
17: \s-2JOVE\s0 has commands for moving over or operating on words.
18: By convention,
19: they are all ESC commands.
20: .IP "ESC F" 20n
21: Move Forward over a word.
22: .IP "ESC B" 20n
23: Move Backward over a word.
24: .IP "ESC D" 20n
25: Kill forward to the end of a word.
26: .IP "ESC Rubout" 20n
27: Kill backward to the beginning of a word.
28: .LP
29: Notice how these commands form a group that parallels the character-
30: based commands,
31: C-F,
32: C-B,
33: C-D,
34: and Rubout.
35: .LP
36: The commands ESC F and ESC B move forward and backward over words.
37: They are thus analogous to Control-F and Control-B,
38: which move over single characters.
39: Like their Control- analogues,
40: ESC F and ESC B move several words if given an argument.
41: ESC F with a negative argument moves backward like ESC B,
42: and ESC B with a negative argument moves forward.
43: Forward motion stops right after the last letter of the word,
44: while backward motion stops right before the first letter.
45: .LP
46: It is easy to kill a word at a time.
47: ESC D kills the word after point.
48: To be precise,
49: it kills everything from point to the place ESC F would move to.
50: Thus,
51: if point is in the middle of a word,
52: only the part after point is killed.
53: If some punctuation comes after point,
54: and before the next word,
55: it is killed along with the word.
56: If you wish to kill only the next word but not the punctuation,
57: simply do ESC F to get to the end,
58: and kill the word backwards with ESC Rubout.
59: ESC D takes arguments just like ESC F.
60: .LP
61: ESC Rubout kills the word before point.
62: It kills everything from point back to where ESC B would move to.
63: If point is after the space in "FOO, BAR",
64: then "FOO, " is killed.
65: If you wish to kill just "FOO",
66: then do a ESC B and a ESC D instead of a ESC Rubout.
67: .NH 2
68: Sentence Commands
69: .XS \n(PN 5n
70: \*(SN Sentence Commands
71: .XE
72: .LP
73: The \s-2JOVE\s0 commands for manipulating sentences and paragraphs are
74: mostly ESC commands,
75: so as to resemble the word-handling commands.
76: .IP "ESC A" 20n
77: Move back to the beginning of the sentence.
78: .IP "ESC E" 20n
79: Move forward to the end of the sentence.
80: .IP "ESC K" 20n
81: Kill forward to the end of the sentence.
82: .IP "C-X Rubout" 20n
83: Kill back to the beginning of the sentence.
84: .LP
85: The commands ESC A and ESC E move to the beginning and end of the
86: current sentence,
87: respectively.
88: They were chosen to resemble
89: Control-A and Control-E,
90: which move to the beginning and end of a line.
91: Unlike them,
92: ESC A and ESC E if repeated or given numeric arguments
93: move over successive sentences.
94: \s-2JOVE\s0 considers a sentence to end wherever there is a ".",
95: "?", or "!" followed by the end of a line
96: or by one or more spaces.
97: Neither ESC A nor ESC E moves past the
98: end of the line or spaces which delimit the sentence.
99: .LP
100: Just as C-A and C-E have a kill command,
101: C-K,
102: to go with them,
103: so ESC A and ESC E have a corresponding kill command ESC K which kills from
104: point to the end of the sentence.
105: With minus one as an argument it
106: kills back to the beginning of the sentence.
107: Positive arguments serve as a repeat count.
108: .LP
109: There is a special command,
110: C-X Rubout for killing back to the beginning of a sentence,
111: because this is useful when you change your
112: mind in the middle of composing text.
113: .NH 2
114: Paragraph Commands
115: .XS \n(PN 5n
116: \*(SN Paragraph Commands
117: .XE
118: .LP
119: The \s-2JOVE\s0 commands for handling paragraphs are
120: .IP "ESC [" 20n
121: Move back to previous paragraph beginning.
122: .IP "ESC ]" 20n
123: Move forward to next paragraph end.
124: .LP
125: ESC [ moves to the beginning of the current or previous paragraph, while
126: ESC ] moves to the end of the current or next paragraph. Paragraphs are
127: delimited by lines of differing indent, or lines with text formatter
128: commands, or blank lines. \s-2JOVE\s0 knows how to deal with most indented
129: paragraphs correctly, although it can get confused by one- or two-line
130: paragraphs delimited only by indentation.
131: .NH 2
132: Text Indentation Commands
133: .XS \n(PN 5n
134: \*(SN Text Indentation Commands
135: .XE
136: .LP
137: .IP "Tab" 20n
138: Indent "appropriately" in a mode-dependent fashion.
139: .IP "LineFeed" 20n
140: Is the same as Return,
141: except it copies the indent of the line you just left.
142: .IP "ESC M" 20n
143: Moves to the line's first non-blank character.
144: .LP
145: .LP
146: The way to request indentation is with the Tab command.
147: Its precise effect depends on the major mode.
148: In \fIText\fP mode,
149: it indents to the next tab stop.
150: In \fIC\fP mode,
151: it indents to the "right" position for C programs.
152: .LP
153: To move over the indentation on a line,
154: do ESC M (\fIfirst-non-blank\fP).
155: This command,
156: given anywhere on a line,
157: positions the cursor at the first non-blank, non-tab character on the line.
158: .NH 2
159: Text Filling
160: .XS \n(PN 5n
161: \*(SN Text Filling
162: .XE
163: .LP
164: \fIAuto Fill\fP mode causes text to be \fIfilled\fP
165: (broken up into lines that fit in a specified width)
166: automatically as you type it in.
167: If you alter existing text so that it is no longer properly filled,
168: \s-2JOVE\s0 can fill it again if you ask.
169: .LP
170: Entering \fIAuto Fill\fP mode is done with ESC X \fIauto-fill-mode\fP.
171: From then on,
172: lines are broken automatically at spaces when they get longer than the
173: desired width.
174: To leave \fIAuto Fill\fP mode,
175: once again execute ESC X \fIauto-fill-mode\fP.
176: When \fIAuto Fill\fP mode is in effect,
177: the word \fBFill\fP appears in the mode line.
178: .LP
179: If you edit the middle of a paragraph,
180: it may no longer correctly be filled.
181: To refill a paragraph,
182: use the command ESC J (\fIfill-paragraph\fP).
183: It causes the paragraph that point is inside to be filled.
184: All the line breaks are removed and new ones inserted where necessary.
185: .LP
186: The maximum line width for filling is in the variable \fIright-margin\fP.
187: Both ESC J and auto-fill make sure that no line exceeds this width.
188: The value of \fIright-margin\fP is initially 72.
189: .LP
190: Normally ESC J figures out the indent of the paragraph and uses that same
191: indent when filling. If you want to change the indent of a paragraph you
192: set \fIleft-margin\fP to the new position and type C-U\ ESC\ J.
193: \fIfill-paragraph\fP, when supplied a numeric argument, uses the value of
194: \fIleft-margin\fP.
195: .LP
196: If you know where you want to set the right margin but you don't know the
197: actual value, move to where you want to set the value and use the
198: \fIright-margin-here\fP command. \fIleft-margin-here\fP does the same
199: for the \fIleft-margin\fP variable.
200: .NH 2
201: Case Conversion Commands
202: .XS \n(PN 5n
203: \*(SN Case Conversion Commands
204: .XE
205: .LP
206: .IP "ESC L" 15n
207: Convert following word to lower case.
208: .IP "ESC U" 15n
209: Convert following word to upper case.
210: .IP "ESC C" 15n
211: Capitalize the following word.
212: .LP
213: .LP
214: The word conversion commands are most useful.
215: ESC L converts the word after point to lower case,
216: moving past it.
217: Thus,
218: successive ESC L's convert successive words.
219: ESC U converts to all capitals instead,
220: while ESC C puts the first letter of the word into upper case and the
221: rest into lower case.
222: All these commands convert several words at once if given an argument.
223: They are especially convenient for
224: converting a large amount of text from all upper case to mixed case,
225: because you can move through the test using ESC L,
226: ESC U or ESC C on each word as appropriate.
227: .LP
228: When given a negative argument,
229: the word case conversion commands apply to
230: the appropriate number of words before point,
231: but do not move point.
232: This is convenient when you have just typed a word in the wrong case.
233: You can give the case conversion command and continue typing.
234: .LP
235: If a word case conversion command is given in the middle of a word,
236: it applies only to the part of the word which follows the cursor,
237: treating it as a whole word.
238: .LP
239: The other case conversion functions are \fIcase-region-upper\fP and
240: \fIcase-region-lower\fP,
241: which convert everything between point and mark to the specified case.
242: Point and mark remain unchanged.
243: .NH 2
244: Commands for Fixing Typos
245: .XS \n(PN 5n
246: \*(SN Commands for Fixing Typos
247: .XE
248: .LP
249: In this section we describe the commands that are especially useful
250: for the times when you catch a mistake on your text after you have made it,
251: or change your mind while composing text on line.
252: .IP "Rubout" 25n
253: Delete last character.
254: .IP "ESC Rubout" 25n
255: Kill last word.
256: .IP "C-X Rubout" 25n
257: Kill to beginning of sentence.
258: .IP "C-T" 25n
259: Transpose two characters.
260: .IP "C-X C-T" 25n
261: Transpose two lines.
262: .IP "ESC Minus ESC L" 25n
263: Convert last word to lower case.
264: .IP "ESC Minus ESC U" 25n
265: Convert last word to upper case.
266: .IP "ESC Minus ESC C" 25n
267: Convert last word to lower case with capital initial.
268: .LP
269: .NH 2
270: Killing Your Mistakes
271: .XS \n(PN 5n
272: \*(SN Killing Your Mistakes
273: .XE
274: .LP
275: The Rubout command is the most important correction command.
276: When used among printing (self-inserting) characters,
277: it can be thought of as canceling the last character typed.
278: .LP
279: When your mistake is longer than a couple of characters,
280: it might be more convenient to use ESC Rubout or C-X Rubout.
281: ESC Rubout kills back to the start of the last word,
282: and C-X Rubout kills back to the start of the last sentence.
283: C-X Rubout is particularly useful when
284: you are thinking of what to write as you type it,
285: in case you change your mind about phrasing.
286: ESC Rubout and C-X Rubout save the killed text for C-Y and ESC Y to retrieve.
287: .LP
288: ESC Rubout is often useful even when you have typed only a few
289: characters wrong,
290: if you know you are confused in your typing and aren't sure what you typed.
291: At such a time,
292: you cannot correct with
293: Rubout except by looking at the screen to see what you did.
294: It requires less thought to kill the whole word and start over again,
295: especially if the system is heavily loaded.
296: .LP
297: If you were typing a command or command parameters, C-G will abort the
298: command with no further processing.
299: .NH 2
300: Transposition
301: .XS \n(PN 5n
302: \*(SN Transposition
303: .XE
304: .LP
305: The common error of transposing two characters can be fixed
306: with the C-T (\fItranspose-characters\fP) command.
307: Normally,
308: C-T transposes the two characters on either side of the cursor
309: and moves the cursor forward one character. Repeating the command
310: several times "drags" a character to the right.
311: (Remember that \fIpoint\fP is considered to be between two characters,
312: even though the visible cursor in your terminal is on only one of them.)
313: When given at the end of a line,
314: rather than switching the last character of the line with the line separator,
315: which would be useless,
316: C-T transposes the last two characters on the line.
317: So,
318: if you catch your transposition error right away,
319: you can fix it with just a C-T.
320: If you don't catch it so fast,
321: you must move the cursor back to between the two characters.
322: .LP
323: To transpose two lines,
324: use the C-X C-T (\fItranspose-lines\fP) command. The line containing the
325: cursor is exchanged with the line above it; the cursor is left at the
326: beginning of the line following its original position.
327: .NH 2
328: Checking and Correcting Spelling
329: .XS \n(PN 5n
330: \*(SN Checking and Correcting Spelling
331: .XE
332: .LP
333: When you write a paper,
334: you should correct its spelling at some point close to finishing it.
335: To correct the entire buffer,
336: do ESC X \fIspell-buffer\fP.
337: This invokes the
338: .UX
339: .I spell
340: program,
341: which prints a list of all the misspelled words.
342: \s-2JOVE\s0 catches the list and places it in a
343: \s-2JOVE\s0 buffer called \fBSpell\fP.
344: You are given an opportunity to delete from that buffer any words that
345: aren't really errors;
346: then \s-2JOVE\s0 looks up each misspelled word and
347: remembers where it is in the buffer being corrected.
348: Then you can go forward to each misspelled word with C-X C-N (\fInext-error\fP)
349: and backward with C-X C-P (\fIprevious-error\fP).
350: See the section entitled \fIError Message Parsing\fP.
351: .NH 1
352: File Handling
353: .XS \n(PN
354: \*(SN File Handling
355: .XE
356: .LP
357: The basic unit of stored data is the file.
358: Each program,
359: each paper,
360: lives usually in its own file.
361: To edit a program or paper,
362: the editor must be told the name of the file that contains it.
363: This is called \fIvisiting\fP a file.
364: To make your changes to the file permanent on disk,
365: you must \fIsave\fP the file.
366: .NH 2
367: Visiting Files
368: .XS \n(PN 5n
369: \*(SN Visiting Files
370: .XE
371: .LP
372: .IP "C-X C-V" 15n
373: Visit a file.
374: .IP "C-X C-R" 15n
375: Same as C-X C-V.
376: .IP "C-X C-S" 15n
377: Save the visited file.
378: .IP "ESC ~" 15n
379: Tell \s-2JOVE\s0 to forget that the buffer has been changed.
380: .LP
381: .LP
382: \fIVisiting\fP a file means copying its contents into \s-2JOVE\s0 where you
383: can edit them.
384: \s-2JOVE\s0 remembers the name of the file you visited.
385: Unless you use the multiple buffer feature of \s-2JOVE\s0,
386: you can only be visiting one file at a time.
387: The name of the current selected buffer is visible in the mode line.
388: .LP
389: The changes you make with \s-2JOVE\s0 are made in a copy inside \s-2JOVE\s0.
390: The file itself is not changed.
391: The changed text is not permanent until you \fIsave\fP it in a file.
392: The first time you change the text,
393: an asterisk appears at the end of the mode line; this indicates that the text
394: contains fresh changes which will be lost unless you save them.
395: .LP
396: To visit a file,
397: use the command C-X C-V.
398: Follow the command with the name of the file you wish to visit,
399: terminated by a Return.
400: You can abort the command by typing C-G,
401: or edit the filename with many of the standard \s-2JOVE\s0 commands
402: (e.g., C-A, C-E, C-F, ESC F, ESC Rubout).
403: If the filename you wish to visit is similar to the filename in the
404: mode line (the default filename),
405: you can type C-R to insert the default and then edit it.
406: If you do type a Return to finish the command,
407: the new file's text appears on the screen,
408: and its name appears in the mode line.
409: In addition,
410: its name becomes the new default filename.
411: .LP
412: If you wish to save the file and make your changes permanent,
413: type C-X C-S.
414: After the save is finished,
415: C-X C-S prints the filename and the
416: number of characters and lines that it wrote to the file.
417: If there are no changes to save (no asterisk at the end of the mode line),
418: the file is not saved;
419: otherwise the changes saved and the asterisk at the end of
420: the mode line will disappear.
421: .LP
422: What if you want to create a file? Just visit it.
423: \s-2JOVE\s0 prints
424: \fI(New file)\fP but aside from that behaves as if you had visited an existing
425: empty file.
426: If you make any changes and save them,
427: the file is created.
428: If you visit a nonexistent file unintentionally
429: (because you typed the wrong filename),
430: go ahead and visit the file you meant.
431: If you don't save the unwanted file,
432: it is not created.
433: .LP
434: If you alter one file and then visit another in the same buffer,
435: \s-2JOVE\s0 offers to save the old one.
436: If you answer YES,
437: the old file is saved;
438: if you answer NO,
439: all the changes you have made to it since the last save are lost.
440: You should not type ahead after a file visiting
441: command,
442: because your type-ahead might answer an unexpected question
443: in a way that you would regret.
444: .LP
445: Sometimes you will change a buffer by accident.
446: Even if you undo the effect of the change by editing,
447: \s-2JOVE\s0 still knows that "the buffer has been changed".
448: You can tell \s-2JOVE\s0 to pretend that there have been no changes with the
449: ESC \s+2~\s0 command (\fImake-buffer-unmodified\fP).
450: This command simply clears the "modified" flag which
451: says that the buffer contains changes which need to be saved.
452: Even if
453: the buffer really \fIis\fP changed \s-2JOVE\s0 will still act as if it were not.
454: .LP
455: If \s-2JOVE\s0 is about to save a file and sees that the date of the version
456: on disk does not match what \s-2JOVE\s0 last read or wrote,
457: \s-2JOVE\s0 notifies you of this fact,
458: and asks what to do, because this probably means that something is wrong.
459: For example,
460: somebody else may have been editing the same file.
461: If this is so,
462: there is a good chance that your work
463: or his work will be lost if you don't take the proper steps.
464: You should first find out exactly what is going on.
465: If you determine that somebody else has modified the file,
466: save your file under a different filename and then DIFF the two files
467: to merge the two sets of changes. (The "patch" command is useful for
468: applying the results of context diffs directly).
469: Also get in touch with the other person so that the files don't diverge
470: any further.
471: .NH 2
472: How to Undo Drastic Changes to a File
473: .XS \n(PN 5n
474: \*(SN How to Undo Drastic Changes to a File
475: .XE
476: .LP
477: If you have made several extensive changes to a file and then change
478: your mind about them,
479: and you haven't yet saved them,
480: you can get rid of them by reading in the previous version of the file.
481: You can do this with the C-X C-V command,
482: to visit the unsaved version of the file.
483: .NH 2
484: Recovering from system/editor crashes
485: .XS \n(PN 5n
486: \*(SN Recovering from system/editor crashes
487: .XE
488: .LP
489: JOVE does not have \fIAuto Save\fP mode, but it does provide a way to
490: recover your work in the event of a system or editor crash. JOVE saves
491: information about the files you're editing every so many changes to a
492: buffer to make recovery possible. Since a relatively small amount of
493: information is involved it's hardly even noticeable when JOVE does this. The
494: variable "sync-frequency" says how often to save the necessary
495: information, and the default is every 50 changes. 50 is a very
496: reasonable number: if you are writing a paper you will not lose more than
497: the last 50 characters you typed, which is less than the average length
498: of a line.
499: .NH 2
500: Miscellaneous File Operations
501: .XS \n(PN 5n
502: \*(SN Miscellaneous File Operations
503: .XE
504: .LP
505: .LP
506: ESC X \fIwrite-file\fP <file><return> writes the contents of the buffer
507: into the file <file>,
508: and then visits that file.
509: It can be thought of as a way of "changing the name" of
510: the file you are visiting.
511: Unlike C-X C-S,
512: \fIwrite-file\fP saves even if the buffer has not been changed.
513: C-X C-W is another way of getting this command.
514: .LP
515: ESC X \fIinsert-file\fP <file><return> inserts the contents of <file> into the
516: buffer at point,
517: leaving point unchanged before the contents.
518: You can also use C-X C-I to get this command.
519: .LP
520: ESC X \fIwrite-region\fP <file><return> writes the region (the text between
521: point and mark) to the specified file.
522: It does not set the visited filename.
523: The buffer is not changed.
524: .LP
525: ESC X \fIappend-region\fP <file><return> appends the region to <file>.
526: The text is added to the end of <file>.
527: .NH 1
528: Using Multiple Buffers
529: .XS \n(PN
530: \*(SN Using Multiple Buffers
531: .XE
532: .LP
533: When we speak of "the buffer",
534: which contains the text you are editing,
535: we have given the impression that there is only one.
536: In fact,
537: there may be many of them,
538: each with its own body of text.
539: At any time only one buffer can be \fIselected\fP and available for editing,
540: but it isn't hard to switch to a different one.
541: Each buffer individually remembers which file it is visiting,
542: what modes are in effect,
543: and whether there are any changes that need saving.
544: .IP "C-X B" 15n
545: Select or create a buffer.
546: .IP "C-X C-F" 15n
547: Visit a file in its own buffer.
548: .IP "C-X C-B" 15n
549: List the existing buffers.
550: .IP "C-X K" 15n
551: Kill a buffer.
552: .LP
553: Each buffer in \s-2JOVE\s0 has a single name,
554: which normally doesn't change.
555: A buffer's name can be any length.
556: The name of the currently selected buffer
557: and the name of the file visited in it
558: are visible in the mode line when you are at top level.
559: A newly started \s-2JOVE\s0 has only one buffer,
560: named \fBMain\fP, unless you specified files to edit in the
561: shell command that started \s-2JOVE\s0.
562: .NH 2
563: Creating and Selecting Buffers
564: .XS \n(PN 5n
565: \*(SN Creating and Selecting Buffers
566: .XE
567: .LP
568: To create a new buffer,
569: you need only think of a name for it (say, FOO)
570: and then do C-X B FOO<return>,
571: which is the command C-X B (\fIselect-buffer\fP) followed by the name.
572: This makes a new,
573: empty buffer (if one by that name didn't previously exist)
574: and selects it for editing.
575: The new buffer is not visiting any file,
576: so if you try to save it you will be asked for the filename to use.
577: Each buffer has its own major mode;
578: the new buffer's major mode is \fIText\fP mode by default.
579: .LP
580: To return to buffer FOO later after having switched to another,
581: the same command C-X B FOO<return> is used,
582: since C-X B can tell whether a buffer named FOO exists already or not.
583: C-X B Main<return> reselects the buffer Main that \s-2JOVE\s0 started out with.
584: Just C-X B<return> reselects the previous buffer.
585: Repeated C-X B<return>'s alternate between the last two buffers selected.
586: .LP
587: You can also read a file into its own newly created buffer,
588: all with one command: C-X C-F (\fIfind-file\fP),
589: followed by the filename.
590: The name of the buffer is the last element of the file's pathname.
591: C-F stands for "Find",
592: because if the specified file already resides in a buffer in your \s-2JOVE\s0,
593: that buffer is reselected.
594: So you need not remember whether you have brought the file in already or not.
595: A buffer created by C-X C-F can be reselected later with C-X B or C-X C-F,
596: whichever you find more convenient.
597: Nonexistent files can be created with C-X C-F just as they can with C-X C-V.
598: .NH 2
599: Using Existing Buffers
600: .XS \n(PN 5n
601: \*(SN Using Existing Buffers
602: .XE
603: .LP
604: To get a list of all the buffers that exist,
605: do C-X C-B (\fIlist-buffers\fP).
606: Each buffer's type,
607: name,
608: and visited filename is printed.
609: An asterisk before the buffer name indicates a
610: buffer which contains changes that have not been saved. The number
611: that appears at the beginning of a line in a C-X C-B listing is that
612: buffer's \fIbuffer number\fP.
613: You can select a buffer by typing its number in place of its name.
614: If a buffer with that number doesn't already exist,
615: a new buffer is created with that number as its name.
616: .LP
617: If several buffers have modified text in them,
618: you should save some of them with C-X C-M (\fIwrite-modified-files\fP).
619: This finds all the buffers that need saving and then saves them.
620: Saving the buffers this way is much
621: easier and more efficient (but more dangerous)
622: than selecting each one and typing C-X C-S.
623: If you give C-X C-M an argument, \s-2JOVE\s0 will ask for confirmation
624: before saving each buffer.
625: .LP
626: ESC X \fIrename-buffer\fP <new name><return> changes the name of the currently
627: selected buffer.
628: .LP
629: ESC X \fIerase-buffer\fP <buffer name><return> erases the contents of the
630: <buffer name> without deleting the buffer entirely.
631: .NH 2
632: Killing Buffers
633: .XS \n(PN 5n
634: \*(SN Killing Buffers
635: .XE
636: .LP
637: After you use a \s-2JOVE\s0 for a while,
638: it may fill up with buffers which you no longer need.
639: Eventually you can reach a point where trying to
640: create any more results in an "out of memory" or "out of lines"
641: error.
642: When this happens you will want to kill some buffers with the
643: C-X K (\fIdelete-buffer\fP) command.
644: You can kill the buffer FOO by doing C-X K FOO<return>.
645: If you type C-X K <return> JOVE will kill the previously selected buffer.
646: If you try to kill a buffer that needs saving \s-2JOVE\s0
647: will ask you to confirm it.
648: .LP
649: If you need to kill several buffers, use the command \fIkill-some-buffers\fP.
650: This prompts you with the name of each buffer and asks for confirmation
651: before killing that buffer.
652: .NH 1
653: Controlling the Display
654: .XS \n(PN
655: \*(SN Controlling the Display
656: .XE
657: .LP
658: Since only part of a large file will fit on the screen,
659: \s-2JOVE\s0 tries to show the part that is likely to be interesting.
660: The display control commands allow you to see a different part of the file.
661: .IP "C-L" 15n
662: Reposition point at a specified vertical position,
663: OR clear and redraw the screen with point in the same place.
664: .IP "C-V" 15n
665: Scroll forwards (a screen or a few lines).
666: .IP "ESC V" 15n
667: Scroll backwards.
668: .IP "C-Z" 15n
669: Scroll forward some lines.
670: .IP "ESC Z" 15n
671: Scroll backwards some lines.
672: .LP
673: .LP
674: The terminal screen is rarely large enough to display all of your
675: file.
676: If the whole buffer doesn't fit on the screen,
677: \s-2JOVE\s0 shows a contiguous portion of it,
678: containing
679: .I point.
680: It continues to show approximately the same portion
681: until point moves outside of what is displayed;
682: then \s-2JOVE\s0 chooses a new portion centered around the new
683: .I point.
684: This is \s-2JOVE\s0's guess as to what you are most interested in seeing,
685: but if the guess is wrong,
686: you can use the display control commands to see a different portion.
687: The available screen area through which you can see part of
688: the buffer is called \fIthe window\fP,
689: and the choice of where in the
690: buffer to start displaying is also called \fIthe window\fP. (When
691: there is only one window, it plus the mode line and the input line take
692: up the whole screen).
693: .LP
694: First we describe how \s-2JOVE\s0 chooses a new window position on its own.
695: The goal is usually to place
696: .I point
697: half way down the window.
698: This is controlled by the variable \fIscroll-step\fP,
699: whose value is the number of
700: lines above the bottom or below the top of the window that the line
701: containing point is placed.
702: A value of 0 (the initial value) means center
703: .I point
704: in the window.
705: .LP
706: The basic display control command is C-L (\fIredraw-display\fP).
707: In its simplest form,
708: with no argument,
709: it tells \s-2JOVE\s0 to choose a new window position,
710: centering point half way from the top as usual.
711: .LP
712: C-L with a positive argument chooses a new window so as to put point
713: that many lines from the top.
714: An argument of zero puts point on the very top line.
715: Point does not move with respect to the text; rather,
716: the text and point move rigidly on the screen.
717: .LP
718: If point stays on the same line,
719: the window is first cleared and then redrawn.
720: Thus,
721: two C-L's in a row are guaranteed to clear the current window.
722: ESC C-L will clear and redraw the entire screen.
723: .LP
724: The \fIscrolling\fP commands C-V,
725: ESC V,
726: C-Z,
727: and ESC Z,
728: let you move the whole display up or down a few lines.
729: C-V (\fInext-page\fP) with an
730: argument shows you that many more lines at the bottom of the screen,
731: moving the text and point up together as C-L might.
732: C-V with a
733: negative argument shows you more lines at the top of the screen,
734: as does ESC V (\fIprevious-page\fP) with a positive argument.
735: .LP
736: To read the buffer a window at a time,
737: use the C-V command with no argument.
738: It takes the last line at the bottom of the window and puts
739: it at the top,
740: followed by nearly a whole window of lines not visible before.
741: Point is put at the top of the window.
742: Thus, each C-V shows the "next page of text",
743: except for one line of overlap to provide context.
744: To move backward,
745: use ESC V without an argument,
746: which moves a whole window backwards (again with a line of overlap).
747: .LP
748: C-Z and ESC Z scroll one line forward and one line backward,
749: respectively.
750: These are convenient for moving in units of lines
751: without having to type a numeric argument.
752: .NH 2
753: Multiple Windows
754: .XS \n(PN 5n
755: \*(SN Multiple Windows
756: .XE
757: .LP
758: \s-2JOVE\s0 allows you to split the screen into two or more \fIwindows\fP and
759: use them to display parts of different files,
760: or different parts of the same file.
761: .IP "C-X 2" 15n
762: Divide the current window into two smaller ones.
763: .IP "C-X 1" 15n
764: Delete all windows but the current one.
765: .IP "C-X D" 15n
766: Delete current window.
767: .IP "C-X N" 15n
768: Switch to the next window.
769: .IP "C-X P" 15n
770: Switch to the previous window.
771: .IP "C-X O" 15n
772: Same as C-X P.
773: .IP "C-X ^" 15n
774: Make this window bigger.
775: .IP "ESC C-V" 15n
776: Scroll the other window.
777: .LP
778: .LP
779: When using \fImultiple window\fP mode,
780: the text portion of the screen
781: is divided into separate parts called \fIwindows\fP,
782: which can display different pieces of text.
783: Each window can display different files,
784: or parts of the same file.
785: Only one of the windows is
786: .I active;
787: that is
788: the window which the cursor is in.
789: Editing normally takes place in that window alone.
790: To edit in another window,
791: you would give a command to move the cursor to the other window,
792: and then edit there.
793: .LP
794: Each window displays a mode line for the buffer it's displaying.
795: This is useful to keep track of which window corresponds with which
796: file. In addition, the mode line serves as a separator between windows.
797: By setting the variable \fImode-line-should-standout\fP to "on" you can
798: have \s-2JOVE\s0 display the mode-line in reverse video (assuming your
799: particular terminal has the reverse video capability).
800: .LP
801: The command C-X 2 (\fIsplit-current-window\fP) enters multiple window mode.
802: A new mode line appears across the middle of the screen,
803: dividing the text display area into two halves.
804: Both windows contain the same buffer and display the same position in it,
805: namely where point was at the time you issued the command.
806: The cursor moves to the second window.
807: .LP
808: To return to viewing only one window,
809: use the command C-X 1 (\fIdelete-other-windows\fP).
810: The current window expands to fill the whole screen,
811: and the other windows disappear until the next C-X 2.
812: (The buffers and their contents are unaffected by any of the
813: window operations).
814: .LP
815: While there is more than one window,
816: you can use C-X N (\fInext-window\fP) to switch to the next window,
817: and C-X P (\fIprevious-window\fP) to switch to the previous one.
818: If you are in the bottom window and you type C-X N,
819: you will be placed in the top window,
820: and the same kind of thing happens when you type C-X P in the top window,
821: namely you will be placed in the bottom window.
822: C-X O is the same as C-X P.
823: It stands for "other window" because when there are only two windows,
824: repeated use of this command will switch between the two windows.
825: .LP
826: Often you will be editing one window while using the other just for reference.
827: Then,
828: the command ESC C-V (\fIpage-next-window\fP) is very useful.
829: It scrolls the next window,
830: as if you switched to the next window,
831: typed C-V,
832: and switched back,
833: without your having to do all that.
834: With a negative argument,
835: ESC C-V will do an ESC V in the next window.
836: .LP
837: When a window splits,
838: both halves are approximately the same size.
839: You can redistribute the screen space between the windows with
840: the C-X ^ (\fIgrow-window\fP) command.
841: It makes the currently selected window grow one line bigger,
842: or as many lines as is specified with a numeric argument.
843: Use ESC X \fIshrink-window\fP to make the current window smaller.
844: .NH 2
845: Multiple Windows and Multiple Buffers
846: .XS \n(PN 5n
847: \*(SN Multiple Windows and Multiple Buffers
848: .XE
849: .LP
850: Buffers can be selected independently in each window.
851: The C-X B command selects a new buffer in whichever window contains
852: the cursor.
853: Other windows' buffers do not change.
854: .LP
855: You can view the same buffer in more than one window.
856: Although the same buffer appears in both windows,
857: they have different values of point,
858: so you can move around in one window while the other window
859: continues to show the same text.
860: Then,
861: having found one place you wish to refer to, you can go back into the
862: other window with C-X O or C-X P to make your changes.
863: .LP
864: If you have the same buffer in both windows,
865: you must beware of trying to visit a different file in one of
866: the windows with C-X C-V,
867: because if you bring a new file into this buffer,
868: it will replaced the old file in \fIboth\fP windows.
869: To view different files in different windows,
870: you must switch buffers in one of the windows first
871: (with C-X B or C-X C-F, perhaps).
872: .LP
873: A convenient "combination" command for viewing something in another
874: window is C-X 4 (\fIwindow-find\fP).
875: With this command you can ask to see any specified buffer,
876: file or tag in the other window.
877: Follow the C-X 4 with either B and a buffer name,
878: F and a filename,
879: or T and a tag name.
880: This switches to the other window and finds there what you specified.
881: If you were previously in one-window mode,
882: multiple-window mode is entered.
883: C-X 4 B is similar to C-X 2 C-X B.
884: C-X 4 F is similar to C-X 2 C-X C-F.
885: C-X 4 T is similar to C-X 2 C-X
886: T.
887: The difference is one of efficiency,
888: and also that C-X 4 works equally well if you are already using two windows.
889: .NH 1
890: Processes Under \s-2JOVE\s0
891: .XS \n(PN
892: \*(SN Processes Under \s-2JOVE\s0
893: .XE
894: .LP
895: Another feature in \s-2JOVE\s0 is its ability to interact with
896: .UX
897: in a useful way.
898: You can run other
899: .UX
900: commands from \s-2JOVE\s0 and catch their output in \s-2JOVE\s0 buffers.
901: In this chapter we will discuss the different
902: ways to run and interact with
903: .UX
904: commands.
905: .NH 2
906: Non-interactive
907: .UX
908: commands
909: .XS \n(PN 5n
910: \*(SN Non-interactive
911: .XE
912: .LP
913: To run a
914: .UX
915: command from \s-2JOVE\s0 just type "C-X !" followed by the name
916: of the command terminated with Return.
917: For example,
918: to get a list of all the users on the system,
919: you do:
920: .DS I
921: C-X ! who<return>
922: .DE
923: Then \s-2JOVE\s0 picks a reasonable buffer in which the output from the
924: command will be placed.
925: E.g.,
926: "who" uses a buffer called \fBwho\fP;
927: "ps alx" uses \fBps\fP;
928: and "fgrep -n foo *.c" uses \fBfgrep\fP.
929: If \s-2JOVE\s0
930: wants to use a buffer that already exists it first erases the old contents.
931: If the buffer it selects holds a file,
932: not output from a previous shell command,
933: you must first delete that buffer with C-X K.
934: .LP
935: Once \s-2JOVE\s0 has picked a buffer it puts that buffer in a window so you
936: can see the command's output as it is running.
937: If there is only one window \s-2JOVE\s0 will automatically make another one.
938: Otherwise,
939: \s-2JOVE\s0
940: tries to pick the most convenient window which isn't the current one.
941: .LP
942: It's not a good idea to type anything while the command is running.
943: There are two reasons for this:
944: .IP (i)
945: \s-2JOVE\s0 won't see the characters (thus won't execute them) until the
946: command finishes,
947: so you may forget what you've typed.
948: .IP (ii)
949: Although \s-2JOVE\s0 won't know what you've typed,
950: it
951: .I will
952: know that you've typed something,
953: and then it will try to be "smart" and not update the
954: display until it's interpreted what you've typed.
955: But,
956: of course,
957: \s-2JOVE\s0 won't interpret what you type until the
958: .UX
959: command completes,
960: so you're left with the uneasy feeling you get when you
961: don't know what the hell the computer is doing*.
962: .FS
963: *This is a bug and should be fixed,
964: but probably won't be for a while.
965: .FE
966: .LP
967: If you want to interrupt the command for some reason (perhaps you
968: mistyped it, or you changed your mind) you can type C-].
969: Typing this
970: inside \s-2JOVE\s0 while a process is running is the same as typing C-C when
971: you are outside \s-2JOVE\s0,
972: namely the process stops in a hurry.
973: .LP
974: When the command finishes, \s-2JOVE\s0 puts you back in the window in which
975: you started.
976: Then it prints a message indicating whether or not the command
977: completed successfully in its (the command's) opinion.
978: That is,
979: if the command had what it considers an error
980: (or you interrupt it with C-])
981: \s-2JOVE\s0 will print an appropriate message.
982:
983: .NH 2
984: Limitations of Non-Interactive Processes
985: .XS \n(PN 5n
986: \*(SN Limitations of Non-Interactive Processes
987: .XE
988: .LP
989: The reason these are called non-interactive processes is that you
990: can't type any input to them; you can't interact with them; they can't
991: ask you questions because there is no way for you to answer.
992: For example,
993: you can't run a command interpreter (a shell), or
994: .I mail
995: or
996: .I crypt
997: with C-X ! because there is no way to provide it with input.
998: Remember that \s-2JOVE\s0 (not the process in the window)
999: is listening to your keyboard,
1000: and \s-2JOVE\s0 waits until the process dies before it looks at
1001: what you type.
1002: .LP
1003: C-X ! is useful for running commands that do some output and then exit.
1004: For example,
1005: it's very useful to use with the C compiler to
1006: catch compilation error messages (see Compiling C Programs),
1007: or with the \fIgrep\fP commands.
1008: .NH 2
1009: Interactive Processes \(em Run a Shell in a Window
1010: .XS \n(PN 5n
1011: \*(SN Interactive Processes \(em Run a Shell in a Window
1012: .XE
1013: .LP
1014: Some versions of \s-2JOVE\s0\(dg
1015: .FS
1016: \(dg For example, the version provided with 4.3BSD.
1017: .FE
1018: have the capability of running interactive
1019: processes.
1020: This is more useful than non-interactive processes for
1021: certain types of jobs:
1022: .IP (i)
1023: You can go off and do some editing while the command is running.
1024: This is useful for commands that do sporadic output and run for fairly long
1025: periods of time.
1026: .IP (ii)
1027: Unlike non-interactive processes,
1028: you can type input to these.
1029: In addition,
1030: you can edit what you type with the power of all the \s-2JOVE\s0
1031: commands \fIbefore\fP you send the input to the process.
1032: This is a really important feature,
1033: and is especially useful for running a shell in a window.
1034: .IP (iii)
1035: Because you can continue with normal editing while one of the
1036: processes is running,
1037: you can create a bunch of contexts and manage them
1038: (select them, delete them, or temporarily put them aside)
1039: with \s-2JOVE\s0's window and buffer mechanisms.
1040: .LP
1041: Although we may have given an image of processes being attached to
1042: .I windows,
1043: in fact they are attached to
1044: .I buffers.
1045: Therefore,
1046: once an \fIi-process\fP is running you can select another buffer into that window,
1047: or if you wish you can delete the window altogether.
1048: If you reselect that buffer later it will be up to date.
1049: That is,
1050: even though the
1051: buffer wasn't visible it was still receiving output from the process.
1052: You don't have to worry about missing anything when the buffer isn't visible.
1053: .NH 2
1054: Advantages of Running Processes in \s-2JOVE\s0 Windows.
1055: .XS \n(PN 5n
1056: \*(SN Advantages of Running Processes in \s-2JOVE\s0 Windows.
1057: .XE
1058: .LP
1059: There are several advantages to running a shell in a window.
1060: What you type isn't seen immediately by the process;
1061: instead \s-2JOVE\s0 waits until
1062: you type an entire line before passing it on to the process to read.
1063: This means that before you type <return>
1064: all of \s-2JOVE\s0's editing
1065: capabilities are available for fixing errors on your input line.
1066: If you discover an error at the beginning of the line,
1067: rather than erasing the whole line and starting over,
1068: you can simply move to the error,
1069: correct it,
1070: move back and continue typing.
1071: .LP
1072: Another feature is that you have the entire history of your session in
1073: a \s-2JOVE\s0 buffer.
1074: You don't have to worry about output from a command
1075: moving past the top of the screen.
1076: If you missed some output you can
1077: move back through it with ESC V and other commands.
1078: In addition,
1079: you can save yourself retyping a command (or a similar one) by sending
1080: edited versions of previous commands, or edit the output of one command
1081: to become a list of commands to be executed ("immediate shell scripts").
1082: .NH 2
1083: Differences between Normal and I-process Buffers
1084: .XS \n(PN 5n
1085: \*(SN Differences between Normal and I-process Buffers
1086: .XE
1087: .LP
1088: \s-2JOVE\s0 behaves differently in several ways when you are in an \fIi-process\fP
1089: buffer.
1090: Most obviously, <return> does different things
1091: depending on both your position in the buffer and on the state of the process.
1092: In the normal case,
1093: when point is at the end of the buffer,
1094: Return does what you'd expect: it inserts a line-separator and then
1095: sends the line to the process.
1096: If you are somewhere else in the buffer,
1097: possibly positioned at a previous command that you want to edit,
1098: Return will place a copy of that line
1099: (with the prompt discarded if there is one)
1100: at the end of the buffer and move you there.
1101: Then you can edit the line and type Return as in the normal case.
1102: If the process has died for some reason,
1103: Return does nothing.
1104: It doesn't even insert itself.
1105: If that happens unexpectedly,
1106: you should type ESC X \fIlist-processes\fP<return>
1107: to get a list of each process and its state.
1108: If your process died abnormally,
1109: \fIlist-processes\fP may help you figure out why.
1110: .NH 2
1111: How to Run a Shell in a Window
1112: .XS \n(PN 5n
1113: \*(SN How to Run a Shell in a Window
1114: .XE
1115: .LP
1116: Type ESC X \fIi-shell\fP<return> to start up a shell.
1117: As with C-X !,
1118: \s-2JOVE\s0 will
1119: create a buffer,
1120: called \fBshell\-1\fP,
1121: and select a window for this new buffer.
1122: But unlike C-X ! you will be left in the new window.
1123: Now,
1124: the shell process is said to be attached to \fBshell\-1\fP,
1125: and it is considered an \fIi-process\fP buffer.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.