home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / editor / j414doc.arc / JOVE.2 < prev    next >
Text File  |  1989-10-10  |  40KB  |  1,123 lines

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