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

  1. .\" ditroff -ms
  2. .de IQ
  3. \\fI\\$1\\fP
  4. ..
  5. .de dc
  6. .NH 2
  7. \\$1
  8. .if '\\$2'(variable)' (variable)
  9. .if !'\\$2'(variable)' (\\$2)
  10. .LP
  11. ..
  12. .nr LL 6.5i
  13. .nr LT 6.5i
  14. .EH 'USD:17-%''JOVE Manual for UNIX Users'
  15. .OH 'JOVE Manual for UNIX Users''USD:17-%'
  16. .LP
  17. .TL
  18. JOVE Manual for UNIX Users
  19. .AU
  20. Jonathan Payne
  21. (revised for 4.3BSD by Doug Kingston and Mark Seiden)
  22. .AI
  23. .AB no
  24. .AE
  25. .NH 1
  26. Introduction
  27. .XS \n(PN
  28. \*(SN Introduction
  29. .XE
  30. .LP
  31. \s-2JOVE\s0*
  32. .FS
  33. *\s-2JOVE\s0 stands for Jonathan's Own Version of Emacs.
  34. .FE
  35. is an advanced, self-documenting, customizable real-time display editor.
  36. It (and this tutorial introduction) are based on the original EMACS
  37. editor and user manual written at M.I.T. by Richard Stallman+.
  38. .FS
  39. +Although \s-2JOVE\s0 is meant to be compatible with EMACS,
  40. and indeed many of the basic commands are very similar,
  41. there are some major differences between the two editors,
  42. and you should not rely on their behaving identically.
  43. .FE
  44. .LP
  45. \s-2JOVE\s0 is considered a
  46. .I display 
  47. editor because normally the text being
  48. edited is visible on the screen and is updated automatically as you
  49. type your commands.
  50. .LP
  51. It's considered a
  52. .I real-time 
  53. editor because the display is updated very
  54. frequently, usually after each character or pair of characters you type.
  55. This minimizes the amount of information you must keep in your
  56. head as you edit.
  57. .LP
  58. \s-2JOVE\s0 is 
  59. .I advanced 
  60. because it provides facilities that go beyond
  61. simple insertion and deletion:
  62. filling of text;
  63. automatic indentations of programs;
  64. view more than one file at once;
  65. and dealing in terms of characters, words, lines, sentences and paragraphs.
  66. It is much easier
  67. to type one command meaning "go to the end of the paragraph" than to
  68. find the desired spot with repetition of simpler commands.
  69. .LP
  70. .I Self-documenting 
  71. means that at almost any time you can easily
  72. find out what a command does,
  73. or to find all the commands that pertain to a topic.
  74. .LP
  75. .I Customizable
  76. means that you can change the definition of \s-2JOVE\s0 commands
  77. in little ways.
  78. For example, you can rearrange the command set;
  79. if you prefer to use arrow keys for the four basic cursor motion commands
  80. (up, down, left and right), you can.
  81. Another sort of customization is
  82. writing new commands by combining built in commands.
  83. .NH 1
  84. The Organization of the Screen
  85. .XS \n(PN
  86. \*(SN The Organization of the Screen
  87. .XE
  88. .LP
  89. \s-2JOVE\s0 divides the screen up into several sections.
  90. The biggest of these sections is used to display the text you are editing.
  91. The terminal's cursor shows the position of \fIpoint\fP,
  92. the location at which editing takes place.
  93. While the cursor appears to point \fIat\fP a character,
  94. point should be thought of as between characters;
  95. it points \fIbefore\fP the character that the cursor appears on top of.
  96. Terminals have only one cursor,
  97. and when output is in progress it must appear where the typing is being done.
  98. This doesn't mean that point is moving;
  99. it is only that \s-2JOVE\s0 has no way of
  100. showing you the location of point except when the terminal is idle.
  101. .LP
  102. The lines of the screen are usually available for displaying text but
  103. sometimes are pre-empted by typeout from certain commands (such as a
  104. listing of all the editor commands).
  105. Most of the time,
  106. output from commands like these is only desired for a short period of time,
  107. usually just long enough to glance at it.
  108. When you have finished looking at the output,
  109. you can type Space to make your text reappear.
  110. (Usually a Space that you type inserts itself, but when there is typeout on
  111. the screen, it does nothing but get rid of that).
  112. Any other command executes normally,
  113. .I after
  114. redrawing your text.
  115. .NH 2
  116. The Message Line
  117. .XS \n(PN 5n
  118. \*(SN The Message Line
  119. .XE
  120. .LP
  121. The bottom line on the screen, called the
  122. \fImessage line\fP,
  123. is reserved for printing messages and for accepting input from the user,
  124. such as filenames or search strings.
  125. When
  126. \s-2JOVE\s0 
  127. prompts for input,
  128. the cursor will temporarily appear on the bottom line, waiting for you
  129. to type a string.
  130. When you have finished typing your input, you can
  131. type a Return to send it to \s-2JOVE\s0.
  132. If you change your mind about running the command that is waiting for input,
  133. you can type Control-G to abort,
  134. and you can continue with your editing.
  135. .LP
  136. When \s-2JOVE\s0 is prompting for a filename,
  137. all the usual editing facilities can be used to fix typos and such;
  138. in addition, \s-2JOVE\s0 has the following extra functions:
  139. .IP "^N"
  140. Insert the next filename from the argument list.
  141. .IP "^P"
  142. Insert the previous filename from the argument list.
  143. .IP "^R"
  144. Insert the full pathname of the file in the current buffer.
  145. .LP
  146. Sometimes you will see \fB--more--\fP on the message line.
  147. This happens when typeout from a command is too long to fit in the screen.
  148. It means that if you type a Space the next screenful of typeout will be
  149. printed.
  150. If you are not interested,
  151. typing anything but a Space will cause the rest of the output to be discarded.
  152. Typing C-G will discard the output and print \fIAborted\fP where the \fB--more--\fP was.
  153. Typing any other command will discard the rest of the output and
  154. also execute the command.
  155. .LP
  156. The message line and the list of filenames from the shell command that
  157. invoked \s-2JOVE\s0 are kept in a special buffer called
  158. \fIMinibuf\fP that can be edited like any other buffer.
  159. .NH 2
  160. The Mode Line
  161. .XS \n(PN 5n
  162. \*(SN The Mode Line
  163. .XE
  164. .LP
  165. At the bottom of the screen, but above the message line, is the
  166. \fImode line\fP.  The mode line format looks like this:
  167. .DS I
  168. \fBJOVE (major minor)   Buffer: bufr  "file" *\fP
  169. .DE
  170. \fImajor\fP is the name of the current \fImajor mode\fP.
  171. At any time, \s-2JOVE\s0 can be in only one major mode at a time.
  172. Currently there are only four major modes: \fIFundamental\fP,
  173. \fIText\fP, \fILisp\fP and \fIC\fP.
  174. .LP
  175. \fIminor\fP is a list of the minor modes that are turned on.
  176. \fBAbbrev\fP means that \fIWord Abbrev\fP mode is on;
  177. \fBAI\fP means that \fIAuto Indent\fP mode is on;
  178. \fBFill\fP means that \fIAuto Fill\fP mode is on;
  179. \fBOvrWt\fP means that \fIOver Write\fP mode is on.
  180. \fBDef\fP means that you are in the process of defining a keyboard macro.
  181. This is not really a mode,
  182. but it's useful to be reminded about it.
  183. The meanings of these modes are described later in this document.
  184. .LP
  185. \fIbufr\fP is the name of the currently selected \fIbuffer\fP.
  186. Each buffer has its own name and holds a file being edited;
  187. this is how \s-2JOVE\s0 can hold several files at once.
  188. But at any given time you are editing only one of them,
  189. the \fIselected\fP buffer.
  190. When we speak of what some command does to "the buffer",
  191. we are talking about the currently selected buffer.
  192. Multiple buffers makes it easy to switch around between several files,
  193. and then it is very useful that
  194. the mode line tells you which one you are editing at any time.  (You
  195. will see later that it is possible to divide the
  196. screen into multiple \fIwindows\fP, each showing a different buffer.  If you
  197. do this, there is a mode line beneath each window.)
  198. .LP
  199. \fIfile\fP is the name of the file that you are editing.
  200. This is the default filename for commands that expect a filename as input.
  201. .LP
  202. The asterisk at the end of the mode line means that there are changes in
  203. the buffer that have not been saved in the file.
  204. If the file has not been changed since it was read in or saved,
  205. there is no asterisk.
  206. .NH 1
  207. Command Input Conventions
  208. .XS \n(PN
  209. \*(SN Command Input Conventions
  210. .XE
  211. .LP
  212. .NH 2
  213. Notational Conventions for ASCII Characters
  214. .XS \n(PN 5n
  215. \*(SN Notational Conventions for ASCII Characters
  216. .XE
  217. .LP
  218. In this manual,
  219. "Control" characters
  220. (that is, characters that are typed with the Control key
  221. and some other key at the same time)
  222. are represented by "C-" followed by another character.
  223. Thus,
  224. C-A is the character you get when you type A with the Control key
  225. (sometimes labeled CTRL) down.
  226. Most control characters when present in the \s-2JOVE\s0
  227. buffer are displayed with a caret; thus, ^A for C-A.
  228. Rubout (or DEL) is displayed as ^?, escape as ^[.
  229. .NH 2
  230. Command and Filename Completion
  231. .XS \n(PN 5n
  232. \*(SN Command and Filename Completion
  233. .XE
  234. .LP
  235. When you are typing the name of a \s-2JOVE\s0 command, you need type only
  236. enough letters to make the name unambiguous.  At any point in the course of
  237. typing the name, you can type question mark (?) to see a list of all the
  238. commands whose names begin with the characters you've already typed; you can
  239. type Space to have \s-2JOVE\s0 supply as many characters as it can; or you
  240. can type Return to complete the command if there is only one possibility.
  241. For example, if you have typed the letters "\fIau\fP" and you then type a
  242. question mark, you will see the list
  243. .DS I
  244.    auto-execute-command
  245.    auto-execute-macro
  246.    auto-fill-mode
  247.    auto-indent-mode
  248. .DE
  249. If you type a Return at this point, \s-2JOVE\s0 will complain by ringing
  250. the bell, because the letters you've typed do not unambiguously specify a
  251. single command.  But if you type Space, \s-2JOVE\s0 will supply the
  252. characters "\fIto-\fP" because all commands that begin "\fIau\fP" also
  253. begin "\fIauto-\fP".  You could then type the letter "\fIf\fP" followed
  254. by either Space or Return, and \s-2JOVE\s0 would complete the entire
  255. command.
  256. .LP
  257. Whenever \s-2JOVE\s0 is prompting you for a filename, say in the
  258. \fIfind-file\fP command, you also need only type enough of the name to
  259. make it unambiguous with respect to files that already exist.  In this
  260. case, question mark and Space work just as they do in command completion,
  261. but Return always accepts the name just as you've typed it, because you
  262. might want to create a new file with a name similar to that of an
  263. existing file.  The variable \fIbad-filename-extensions\fP contains a
  264. list of words separated by spaces which are to be considered bad
  265. filename extensions, and so will not be counted in filename completion.
  266. The default is ".o" so if you have jove.c and jove.o in the same
  267. directory, the filename completion will not complain of an ambiguity
  268. because it will ignore jove.o.
  269.  
  270. .NH 1
  271. Commands and Variables
  272. .XS \n(PN
  273. \*(SN Commands and Variables
  274. .XE
  275. .LP
  276. \s-2JOVE\s0 is composed of \fIcommands\fP
  277. which have long names such as
  278. \fInext-line\fP.
  279. Then \fIkeys\fP such as C-N are connected to
  280. commands through the \fIcommand dispatch table\fP.
  281. When we say that C-N moves the cursor down a line,
  282. we are glossing over a distinction which is unimportant for ordinary use,
  283. but essential for simple customization:
  284. it is the command \fInext-line\fP which knows how to move a down line,
  285. and C-N moves down a line because it is connected to that command.
  286. The name for this connection is a \fIbinding\fP; we say that the key
  287. C-N \fIis bound to\fP the command \fInext-line\fP.
  288. .LP
  289. Not all commands are bound to keys.  To invoke a command that isn't bound
  290. to a key, you can type the sequence ESC X, which is bound to the command
  291. \fIexecute-named-command\fP.  You will then be able to type the name of
  292. whatever command you want to execute on the message line.
  293. .LP
  294. Sometimes the description of a command will say
  295. "to change this, set the variable \fImumble\-foo\fP".
  296. A variable is a name used to remember a value.
  297. \s-2JOVE\s0 contains variables which are there so that you can change
  298. them if you want to customize.
  299. The variable's value is examined by some command,
  300. and changing that value makes the command behave differently.
  301. Until you are interesting in customizing \s-2JOVE\s0,
  302. you can ignore this information.
  303. .NH 2
  304. Prefix Characters
  305. .XS \n(PN 5n
  306. \*(SN Prefix Characters
  307. .XE
  308. .LP
  309. Because there are more command names than keys,
  310. \s-2JOVE\s0 provides
  311. \fIprefix characters\fP to increase the number of commands that can
  312. be invoked quickly and easily.
  313. When you type a prefix character \s-2JOVE\s0 will wait
  314. for another character before deciding what to do.
  315. If you wait more than a second or so,
  316. \s-2JOVE\s0 will print the prefix character on the
  317. message line as a reminder and leave the cursor down there until you type your next
  318. character.
  319. There are two prefix characters built into \s-2JOVE\s0:
  320. Escape and Control-X.
  321. How the next character is interpreted depends on which
  322. prefix character you typed.
  323. For example,
  324. if you type Escape followed by B you'll run \fIbackward-word\fP,
  325. but if you type Control-X followed by B you'll run \fIselect-buffer\fP.
  326. Elsewhere in this manual, the Escape key is indicated as "ESC", which is
  327. also what \s-2JOVE\s0 displays on the message line for Escape.
  328. .NH 2
  329. Help
  330. .XS \n(PN
  331. \*(SN Help
  332. .XE
  333. .LP
  334. To get a list of keys and their associated commands,
  335. you type ESC X \fIdescribe-bindings\fP.
  336. If you want to describe a single key,
  337. ESC X \fIdescribe-key\fP will work.  A description of an
  338. individual command is available by using ESC X \fIdescribe-command\fP,
  339. and descriptions of variables by using  ESC X \fIdescribe-variable\fP.
  340. If you can't remember the name of the thing you want to know about,
  341. ESC X \fIapropos\fP will tell you if a command or variable has a given
  342. string in its name.  For example, ESC X \fIapropos describe\fP will
  343. list the names of the four describe commands mentioned briefly in this
  344. section.
  345. .NH 1
  346. Basic Editing Commands
  347. .XS \n(PN
  348. \*(SN Basic Editing Commands
  349. .XE
  350. .LP
  351. .NH 2
  352. Inserting Text
  353. .XS \n(PN 5n
  354. \*(SN Inserting Text
  355. .XE
  356. .LP
  357. To insert printing characters into the text you are editing,
  358. just type them.
  359. All printing characters you type are inserted into the text at
  360. the cursor (that is, at \fIpoint\fP),
  361. and the cursor moves forward.
  362. Any characters after the cursor move forward too.
  363. If the text in the buffer is FOOBAR,
  364. with the cursor before the B,
  365. then if you type XX,
  366. you get FOOXXBAR,
  367. with the cursor still before the B.
  368. .LP
  369. To correct text you have just inserted,
  370. you can use Rubout.
  371. Rubout deletes the character \fIbefore\fP the cursor (not the one that the
  372. cursor is on top of or under; that is the character \fIafter\fP the
  373. cursor).
  374. The cursor and all characters after it move backwards.
  375. Therefore,
  376. if you typing a printing character and then type Rubout,
  377. they cancel out.
  378. .LP
  379. To end a line and start typing a new one,
  380. type Return.
  381. Return operates by inserting a \fIline-separator\fP,
  382. so if you type Return in
  383. the middle of a line,
  384. you break the line in two.
  385. Because a line-separator is just a single character,
  386. you can type Rubout at the
  387. beginning of a line to delete the line-separator and join it with the
  388. preceding line.
  389. .LP
  390. As a special case, if you type Return at the end of a line and there are
  391. two or more empty lines just below it, \s-2JOVE\s0 does not insert a
  392. line-separator but instead merely moves to the next (empty) line.  This
  393. behavior is convenient when you want to add several lines of text in the
  394. middle of a buffer.  You can use the Control-O (\fInewline-and-backup\fP)
  395. command to "open" several empty lines at once; then you can insert the new
  396. text, filling up these empty lines.  The advantage is that \s-2JOVE\s0 does
  397. not have to redraw the bottom part of the screen for each Return you type,
  398. as it would ordinarily.  That "redisplay" can be both slow and distracting.
  399. .LP
  400. If you add too many characters to one line,
  401. without breaking it with Return,
  402. the line will grow too long to display on one screen line.
  403. When this happens,
  404. \s-2JOVE\s0 puts an "!" at the extreme right margin,
  405. and doesn't bother to display the rest of the line unless the
  406. cursor happens to be in it.
  407. The "!" is not part of your text;
  408. conversely,
  409. even though you can't see the rest of your line,
  410. it's still there,
  411. and if you break the line,
  412. the "!" will go away.
  413. .LP
  414. Direct insertion works for printing characters and space,
  415. but other
  416. characters act as editing commands and do not insert themselves.
  417. If you need to insert a control character,
  418. Escape,
  419. or Rubout,
  420. you must first \fIquote\fP it by typing the Control-Q command first.
  421. .NH 2
  422. Moving the Cursor
  423. .XS \n(PN 5n
  424. \*(SN Moving the Cursor
  425. .XE
  426. .LP
  427. To do more than insert characters,
  428. you have to know how to move the cursor.
  429. Here are a few of the commands for doing that.
  430. .IP "C-A" 15n
  431. Move to the beginning of the line.
  432. .IP "C-E" 15n
  433. Move to the end of the line.
  434. .IP "C-F" 15n
  435. Move forward over one character.
  436. .IP "C-B" 15n
  437. Move backward over one character.
  438. .IP "C-N" 15n
  439. Move down one line,
  440. vertically.
  441. If you start in the middle of one line,
  442. you end in the middle of the next.
  443. .IP "C-P" 15n
  444. Move up one line,
  445. vertically.
  446. .IP "ESC <" 15n
  447. Move to the beginning of the entire buffer.
  448. .IP "ESC >" 15n
  449. Move to the end of the entire buffer.
  450. .IP "ESC ," 15n
  451. Move to the beginning of the visible window.
  452. .IP "ESC ." 15n
  453. Move to the end of the visible window.
  454. .NH 2
  455. Erasing Text
  456. .XS \n(PN 5n
  457. \*(SN Erasing Text
  458. .XE
  459. .LP
  460. .IP "Rubout" 15n
  461. Delete the character before the cursor.
  462. .IP "C-D" 15n
  463. Delete the character after the cursor.
  464. .IP "C-K" 15n
  465. Kill to the end of the line.
  466. .LP
  467. You already know about the Rubout command which deletes the character
  468. before the cursor.
  469. Another command,
  470. Control-D,
  471. deletes the character
  472. after the cursor,
  473. causing the rest of the text on the line to shift left.
  474. If Control-D is typed at the end of a line,
  475. that line and the next line are joined together.
  476. .LP
  477. To erase a larger amount of text,
  478. use the Control-K command,
  479. which kills a line at a time.
  480. If Control-K is done at the beginning or
  481. middle of a line,
  482. it kills all the text up to the end of the line.
  483. If Control-K is done at the end of a line,
  484. it joins that line and the next line.
  485. If Control-K is done twice, it kills the rest of the line and the line
  486. separator also.
  487. .NH 2
  488. Files \(em Saving Your Work
  489. .XS \n(PN 5n
  490. \*(SN Files \(em Saving Your Work
  491. .XE
  492. .LP
  493. The commands above are sufficient for creating text in the \s-2JOVE\s0 buffer.
  494. The more advanced \s-2JOVE\s0 commands just make things easier.
  495. But to keep any text permanently you must put it in a \fIfile\fP.
  496. Files are the objects which
  497. .UX
  498. uses for storing data for a length of time.
  499. To tell \s-2JOVE\s0 to read text into a file,
  500. choose a filename,
  501. such as \fIfoo.bar\fP,
  502. and type C-X C-R \fIfoo.bar\fP<return>.
  503. This reads the file \fIfoo.bar\fP so that its contents appear on the screen
  504. for editing.
  505. You can make changes,
  506. and then save the file by typing C-X C-S (save-file).
  507. This makes the changes permanent and actually changes the file \fIfoo.bar\fP.
  508. Until then,
  509. the changes are only inside \s-2JOVE\s0,
  510. and the file \fIfoo.bar\fP is not really changed.
  511. If the file \fIfoo.bar\fP doesn't exist,
  512. and you want to create it,
  513. read it as if it did exist.
  514. When you save your text with C-X C-S the file will be created.
  515. .NH 2
  516. Exiting and Pausing \(em Leaving \s-2JOVE\s0
  517. .XS \n(PN 5n
  518. \*(SN Exiting and Pausing \(em Leaving \s-2JOVE\s0
  519. .XE
  520. .LP
  521. The command C-X C-C (\fIexit-jove\fP) will terminate the \s-2JOVE\s0
  522. session and return to the shell.  If there are modified but 
  523. unsaved buffers, \s-2JOVE\s0 will ask you for confirmation, and you
  524. can abort the command, look at what buffers are
  525. modified but unsaved using C-X C-B (\fIlist-buffers\fP), save the 
  526. valuable ones, and then exit.  If what you want to do, on the other hand,
  527. is \fIpreserve\fP the editing session but return to the shell temporarily
  528. you can (under Berkeley 
  529. .UX
  530. only) issue the command ESC S (\fIpause-jove\fP), do your 
  531. .UX 
  532. work within the c-shell, then return to \s-2JOVE\s0 using the 
  533. \fIfg\fP command to resume editing at the point where you paused.
  534. For this sort of situation you might consider using an \fIinteractive
  535. shell\fP (that is, a shell in a \s-2JOVE\s0 window) which lets you use
  536. editor commands to manipulate your 
  537. .UX 
  538. commands (and their output) while never leaving the editor.
  539. (The interactive shell feature is described below.)
  540. .NH 2
  541. Giving Numeric Arguments to \s-2JOVE\s0 Commands
  542. .XS \n(PN 5n
  543. \*(SN Giving Numeric Arguments to \s-2JOVE\s0 Commands
  544. .XE
  545. .LP
  546. Any \s-2JOVE\s0 command can be given a \fInumeric argument\fP.
  547. Some commands interpret the argument as a repetition count.
  548. For example,
  549. giving an argument of ten to the C-F command (forward-character) moves forward
  550. ten characters.
  551. With these commands,
  552. no argument is equivalent to an argument of 1.
  553. .LP
  554. Some commands use the value of the argument,
  555. but do something peculiar (or nothing) when there is no argument.
  556. For example,
  557. ESC G (\fIgoto-line\fP) with an argument \fBn\fP
  558. goes to the beginning of the \fBn\fP'th line.
  559. But ESC G with no argument prompts for the line number.
  560. Similarly, C-K with an argument kills that many lines, including their line
  561. separators.  Without an argument, C-K when there is text on the line to the
  562. right of
  563. the cursor kills that text; when there is no text after the cursor, C-K
  564. deletes the line separator.
  565. .LP
  566. The fundamental way of specifying an argument is to use ESC followed
  567. by the digits of the argument, for example, ESC 123 ESC G to go to line
  568. 123. Negative arguments are allowed,
  569. although not all of the commands know what to do with one.
  570. .LP
  571. Typing C-U means do the next command four times.
  572. Two such C-U's multiply the next command by sixteen.
  573. Thus,
  574. C-U C-U C-F moves forward sixteen characters.
  575. This is a good way to move forward quickly,
  576. since it moves about 1/4 of a line on most terminals.
  577. Other useful combinations are:
  578. C-U C-U C-N (move down a good fraction of the screen),
  579. C-U C-U C-O (make "a lot" of blank lines),
  580. and C-U C-K (kill four lines \(em note that typing C-K four times
  581. would kill 2 lines).
  582. .LP
  583. There are other,
  584. terminal-dependent ways of specifying arguments.
  585. They have the same effect but may be easier to type.
  586. If your terminal
  587. has a numeric keypad which sends something recognizably different from
  588. the ordinary digits,
  589. it is possible to program \s-2JOVE\s0 to to allow use of
  590. the numeric keypad for specifying arguments.
  591. .NH 2
  592. The Mark and the Region
  593. .XS \n(PN 5n
  594. \*(SN The Mark and the Region
  595. .XE
  596. .LP
  597. In general,
  598. a command that processes an arbitrary part of the buffer
  599. must know where to start and where to stop.
  600. In \s-2JOVE\s0,
  601. such commands usually operate on the text between point and \fIthe mark\fP.
  602. This body of text is called \fIthe region\fP.
  603. To specify a region,
  604. you set point to one end of it and mark at the other.
  605. It doesn't matter which one comes earlier in the text.
  606. .IP "C-@" 15n
  607. Set the mark where point is.
  608. .IP "C-X C-X" 15n
  609. Interchange mark and point.
  610. .LP
  611. For example,
  612. if you wish to convert part of the buffer to all upper-case,
  613. you can use the C-X C-U command,
  614. which operates on the text in the region.
  615. You can first go to the beginning of the text to be capitalized,
  616. put the mark there, move to the end, and then type C-X C-U.
  617. Or,
  618. you can set the mark at the end of the text,
  619. move to the beginning,
  620. and then type C-X C-U.
  621. C-X C-U runs the command \fIcase-region-upper\fP,
  622. whose name signifies that the region,
  623. or everything between point and mark,
  624. is to be capitalized.
  625. .LP
  626. The way to set the mark is with the C-@ command or (on some
  627. terminals) the C-Space command.
  628. They set the mark where point is.
  629. Then you can move point away,
  630. leaving mark behind.  When the mark is set, "[Point pushed]" is printed on
  631. the message line.
  632. .LP
  633. Since terminals have only one cursor,
  634. there is no way for \s-2JOVE\s0 to show you where the mark is located.
  635. You have to remember.
  636. The usual solution to this problem is to set the mark and then use it soon,
  637. before you forget where it is.
  638. But you can see where the mark is with
  639. the command C-X C-X which puts the mark where point was and point
  640. where mark was.
  641. The extent of the region is unchanged,
  642. but the cursor and point are now at the previous location of the mark.
  643. .NH 2
  644. The Ring of Marks
  645. .XS \n(PN 5n
  646. \*(SN The Ring of Marks
  647. .XE
  648. .LP
  649. Aside from delimiting the region,
  650. the mark is also useful for remembering a spot that you may want to go back to.
  651. To make this feature more useful,
  652. \s-2JOVE\s0 remembers 16 previous locations of the mark.
  653. Most commands that set the mark push the old mark onto this stack.
  654. To return to a marked location, use C-U C-@.
  655. This moves point to where the mark was,
  656. and restores the mark from the stack of former marks.
  657. So repeated use of this command moves point to all of the old
  658. marks on the stack,
  659. one by one.
  660. Since the stack is actually a ring,
  661. enough uses of C-U C-@ bring point back to where it was originally.
  662. .LP
  663. Some commands whose primary purpose is to move point a great distance
  664. take advantage of the stack of marks to give you a way to undo the
  665. command.
  666. The best example is ESC <,
  667. which moves to the beginning of the buffer.
  668. If there are more than 22 lines between the beginning of
  669. the buffer and point,
  670. ESC < sets the mark first,
  671. so that you can use C-U C-@ or C-X C-X to go back to where you were.
  672. You can change the number of lines from 22 since it is kept in the variable \fImark-threshold\fP.
  673. By setting it to 0,
  674. you can make these commands always set the mark.
  675. By setting it to a very large number you can prevent these commands from ever
  676. setting the mark.
  677. If a command decides to set the mark,
  678. it prints the message \fI[Point pushed]\fP.
  679. .NH 2
  680. Killing and Moving Text
  681. .XS \n(PN 5n
  682. \*(SN Killing and Moving Text
  683. .XE
  684. .LP
  685. The most common way of moving or copying text with \s-2JOVE\s0 is to kill it,
  686. and get it back again in one or more places.
  687. This is very safe
  688. because the last several pieces of killed text are all remembered,
  689. and it is versatile,
  690. because the many commands for killing syntactic units
  691. can also be used for moving those units.
  692. There are also other ways of moving text for special purposes.
  693. .NH 2
  694. Deletion and Killing
  695. .XS \n(PN 5n
  696. \*(SN Deletion and Killing
  697. .XE
  698. .LP
  699. Most commands which erase text from the buffer save it so that you can
  700. get it back if you change your mind,
  701. or move or copy it to other parts of the buffer.
  702. These commands are known as \fIkill\fP commands.
  703. The rest of the commands that erase text do not save it;
  704. they are known as \fIdelete\fP commands.
  705. The delete commands include C-D and Rubout,
  706. which delete only one character at a time,
  707. and those commands that delete only spaces or line separators.
  708. Commands that can destroy significant amounts of nontrivial data generally kill.
  709. A command's
  710. name and description will use the words \fIkill\fP or \fIdelete\fP to
  711. say which one it does.
  712. .IP "C-D" 20n
  713. Delete next character.
  714. .IP "Rubout" 20n
  715. Delete previous character.
  716. .IP "ESC \e" 20n
  717. Delete spaces and tabs around point.
  718. .IP "C-X C-O" 20n
  719. Delete blank lines around the current line.
  720. .IP "C-K" 20n
  721. Kill rest of line or one or more lines.
  722. .IP "C-W" 20n
  723. Kill region (from point to the mark).
  724. .IP "ESC D" 20n
  725. Kill word.
  726. .IP "ESC Rubout" 20n
  727. Kill word backwards.
  728. .IP "ESC K" 20n
  729. Kill to end of sentence.
  730. .IP "C-X Rubout" 20n
  731. Kill to beginning of sentence.
  732. .NH 2
  733. Deletion
  734. .XS \n(PN 5n
  735. \*(SN Deletion
  736. .XE
  737. .LP
  738. The most basic delete commands are C-D and Rubout.
  739. C-D deletes the character after the cursor,
  740. the one the cursor is "on top of" or "underneath".
  741. The cursor doesn't move.
  742. Rubout deletes the character before the cursor,
  743. and moves the cursor back.
  744. Line separators act like normal characters when deleted.
  745. Actually,
  746. C-D and Rubout aren't always \fIdelete\fP commands;
  747. if you give an argument,
  748. they \fIkill\fP instead.
  749. This prevents you from losing a great deal of text by typing a large
  750. argument to a C-D or Rubout.
  751. .LP
  752. The other delete commands are those which delete only formatting
  753. characters:
  754. spaces,
  755. tabs,
  756. and line separators.
  757. ESC \e (\fIdelete-white-space\fP)
  758. deletes all the spaces and tab characters before and after point.
  759. C-X C-O (\fIdelete-blank-lines\fP) deletes all blank lines after the current line,
  760. and if the current line is blank deletes all the blank
  761. lines preceding the current line as well
  762. (leaving one blank line, the current line).
  763. .NH 2
  764. Killing by Lines
  765. .XS \n(PN 5n
  766. \*(SN Killing by Lines
  767. .XE
  768. .LP
  769. The simplest kill command is the C-K command.
  770. If issued at the beginning of a line,
  771. it kills all the text on the line,
  772. leaving it blank.
  773. If given on a line containing only white space (blanks and tabs)
  774. the line disappears.
  775. As a consequence,
  776. if you go to the front of a non-blank line and type two C-K's,
  777. the line disappears completely.
  778. .LP
  779. More generally,
  780. C-K kills from point up to the end of the line,
  781. unless it is at the end of a line.
  782. In that case,
  783. it kills the line separator following the line,
  784. thus merging the next line into the current one.
  785. Invisible spaces and tabs at the end of the line are ignored when
  786. deciding which case applies,
  787. so if point appears to be at the end of the line,
  788. you can be sure the line separator will be killed.
  789. .LP
  790. C-K with an argument of zero kills all the text before
  791. point on the current line.
  792. .NH 2
  793. Other Kill Commands
  794. .XS \n(PN 5n
  795. \*(SN Other Kill Commands
  796. .XE
  797. .LP
  798. A kill command which is very general is C-W (\fIkill-region\fP),
  799. which kills everything between point and the mark.*
  800. .FS
  801. *Often users switch this binding from C-W to C-X C-K because it is too
  802. easy to hit C-W accidentally.
  803. .FE
  804. With this command,
  805. you can kill and save contiguous characters,
  806. if you first set the mark at one end of them and go to the other end.
  807. .LP
  808. Other syntactic units can be killed, too;
  809. words,
  810. with ESC Rubout and ESC D;
  811. and, sentences,
  812. with ESC K and C-X Rubout.
  813. .NH 2
  814. Un-killing
  815. .XS \n(PN 5n
  816. \*(SN Un-killing (Yanking)
  817. .XE
  818. .LP
  819. Un-killing (yanking) is getting back text which was killed.
  820. The usual way to
  821. move or copy text is to kill it and then un-kill it one or more times.
  822. .IP "C-Y" 10n
  823. Yank (re-insert) last killed text.
  824. .IP "ESC Y" 10n
  825. Replace re-inserted killed text with the previously killed text.
  826. .IP "ESC W" 10n
  827. Save region as last killed text without killing.
  828. .LP
  829. Killed text is pushed onto a \fIring buffer\fP called the \fIkill
  830. ring\fP that remembers the last 10 blocks of text that were killed.
  831. (Why it is called a ring buffer will be explained below).
  832. The command C-Y (\fIyank\fP) reinserts the text of the most recent kill.
  833. It leaves the cursor at the end of the text,
  834. and puts the mark at the beginning.
  835. Thus,
  836. a single C-Y undoes the C-W.
  837. .LP
  838. If you wish to copy a block of text,
  839. you might want to use ESC W (\fIcopy-region\fP),
  840. which copies the region into the kill ring without removing it from the buffer.
  841. This is approximately equivalent to C-W followed by C-Y,
  842. except that ESC W does not mark the buffer as
  843. "changed" and does not cause the screen to be rewritten.
  844. .LP
  845. There is only one kill ring shared among all the buffers.
  846. After visiting a new file,
  847. whatever was last killed in the previous file is still on top of the kill ring.
  848. This is important for moving text between files.
  849. .NH 2
  850. Appending Kills
  851. .XS \n(PN 5n
  852. \*(SN Appending Kills
  853. .XE
  854. .LP
  855. Normally,
  856. each kill command pushes a new block onto the kill ring.
  857. However,
  858. two or more kill commands immediately in a row (without any other
  859. intervening commands) combine their text into a
  860. single entry on the ring,
  861. so that a single C-Y command gets it all back as it was before it was killed.
  862. This means that you don't have to kill all the text in one command;
  863. you can keep killing line after line,
  864. or word after word,
  865. until you have killed it all,
  866. and you can still get it all back at once.
  867. .LP
  868. Commands that kill forward from 
  869. .I point 
  870. add onto the end of the previous
  871. killed text.
  872. Commands that kill backward from 
  873. .I point
  874. add onto the beginning.
  875. This way,
  876. any sequence of mixed forward and backward kill
  877. commands puts all the killed text into one entry without needing rearrangement.
  878. .NH 2
  879. Un-killing Earlier Kills
  880. .XS \n(PN 5n
  881. \*(SN Un-killing Earlier Kills
  882. .XE
  883. .LP
  884. To recover killed text that is no longer the most recent kill,
  885. you need the ESC Y (\fIyank-pop\fP) command.
  886. The ESC Y command can be used
  887. only after a C-Y (yank) command or another ESC Y.
  888. It takes the un-killed
  889. text inserted by the C-Y and replaces it with the text from an earlier
  890. kill.
  891. So,
  892. to recover the text of the next-to-the-last kill,
  893. you first use C-Y to recover the last kill,
  894. and then discard it by use of ESC Y to move back to the previous kill.
  895. .LP
  896. You can think of all the last few kills as living on a ring.
  897. After a C-Y command,
  898. the text at the front of the ring is also present in the buffer.
  899. ESC Y "rotates" the ring bringing the previous string of text to the front
  900. and this text replaces the other text in the buffer as well.
  901. Enough ESC Y commands can rotate any part of the ring to the front,
  902. so you can get at any killed text so long as it is recent enough
  903. to be still in the ring.
  904. Eventually the ring rotates all the way
  905. around and the most recently killed text comes to the front
  906. (and into the buffer) again.
  907. ESC Y with a negative argument rotates the ring backwards.
  908. .LP
  909. When the text you are looking for is brought into the buffer,
  910. you can stop doing ESC Y's and the text will stay there.
  911. It's really just a copy of what's at the front of the ring,
  912. so editing it does not change what's in the ring.
  913. And the ring,
  914. once rotated,
  915. stays rotated,
  916. so that doing another C-Y gets another copy of what you rotated to the
  917. front with ESC Y.
  918. .LP
  919. If you change your
  920. mind about un-killing,
  921. C-W gets rid of the un-killed text, even
  922. after any number of ESC Y's.
  923. .NH 1
  924. Searching
  925. .XS \n(PN
  926. \*(SN Searching
  927. .XE
  928. .LP
  929. The search commands are useful for finding and moving to arbitrary
  930. positions in the buffer in one swift motion.
  931. For example,
  932. if you just ran the spell program on a paper
  933. and you want to correct some word,
  934. you can use the search commands to move directly to that word.  There are
  935. two flavors of search: \fIstring search\fP and \fIincremental search\fP.
  936. The former is the default flavor\(emif you want to use incremental search
  937. you must rearrange the key bindings (see below).
  938. .NH 2
  939. Conventional Search
  940. .XS \n(PN 5n
  941. \*(SN Conventional Search
  942. .XE
  943. .LP
  944. .IP "C-S" 15n
  945. Search forward.
  946. .IP "C-R" 15n
  947. Search backward.
  948. .LP
  949. To search for the string "FOO" you type "C-S FOO<return>".
  950. If \s-2JOVE\s0 finds
  951. FOO it moves point to the end of it; otherwise \s-2JOVE\s0 prints an error
  952. message and leaves point unchanged.
  953. C-S searches forward from point
  954. so only occurrences of FOO after point are found.
  955. To search in the other direction use C-R.
  956. It is exactly the same as C-S except it searches in the opposite direction,
  957. and if it finds the string,
  958. it leaves point at the beginning of it,
  959. not at the end as in C-S.
  960. .LP
  961. While \s-2JOVE\s0 is searching it prints the search string on the message line.
  962. This is so you know what \s-2JOVE\s0 is doing.
  963. When the system is heavily loaded and
  964. editing in exceptionally large buffers,
  965. searches can take several (sometimes many) seconds.
  966. .LP
  967. \s-2JOVE\s0 remembers the last search string you used,
  968. so if you want to search for the same string you can type "C-S <return>".
  969. If you mistyped the last search string,
  970. you can type C-S followed by C-R.
  971. C-R,
  972. as usual,
  973. inserts the default search string into the minibuffer,
  974. and then you can fix it up.
  975. .NH 2
  976. Incremental Search
  977. .XS \n(PN 5n
  978. \*(SN Incremental Search
  979. .XE
  980. .LP
  981. This search command is unusual in that is is \fIincremental\fP;
  982. it begins to search before you have typed the complete search string.
  983. As you type in the search string,
  984. \s-2JOVE\s0 shows you where it would be found.
  985. When you have typed enough characters to identify the place you want,
  986. you can stop.
  987. Depending on what you will do next,
  988. you may or may not need to terminate the search explicitly with a Return first.
  989. .LP
  990. The command to search is C-S (\fIi-search-forward\fP).
  991. C-S reads in characters and positions the cursor at the first
  992. occurrence of the characters that you have typed so far.
  993. If you type C-S and then F,
  994. the cursor moves in the text just after the next "F".
  995. Type an "O",
  996. and see the cursor move to after the next "FO".
  997. After another "O",
  998. the cursor is after the next "FOO".
  999. At the same time,
  1000. the "FOO" has echoed on the message line.
  1001. .LP
  1002. If you type a mistaken character,
  1003. you can rub it out.
  1004. After the FOO,
  1005. typing a Rubout makes the "O" disappear from the message line,
  1006. leaving only "FO".
  1007. The cursor moves back in the buffer to the "FO".
  1008. Rubbing out the "O" and "F" moves the cursor back to where you
  1009. started the search.
  1010. .LP
  1011. When you are satisfied with the place you have reached,
  1012. you can type a Return,
  1013. which stops searching,
  1014. leaving the cursor where the search brought it.
  1015. Also,
  1016. any command not specially meaningful in searches stops
  1017. the searching and is then executed.
  1018. Thus,
  1019. typing C-A would exit the search and then move to the beginning of the line.
  1020. Return is necessary only if the next character you want to type is a printing
  1021. character,
  1022. Rubout,
  1023. Return,
  1024. or another search command,
  1025. since those are the characters that have special meanings inside the search.
  1026. .LP
  1027. Sometimes you search for "FOO" and find it,
  1028. but not the one you hoped to find.
  1029. Perhaps there is a second FOO that you forgot about,
  1030. after the one you just found.
  1031. Then type another C-S and the cursor will find the next FOO.
  1032. This can be done any number of times.
  1033. If you overshoot,
  1034. you can return to previous finds by rubbing out the C-S's.
  1035. .LP
  1036. After you exit a search,
  1037. you can search for the same string again by typing just C-S C-S:
  1038. one C-S command to start the search and then
  1039. another C-S to mean "search again for the same string".
  1040. .LP
  1041. If your string is not found at all,
  1042. the message line says "Failing I-search".
  1043. The cursor is after the place where \s-2JOVE\s0 found as much of
  1044. your string as it could.
  1045. Thus,
  1046. if you search for FOOT and there is no FOOT,
  1047. you might see the cursor after the FOO in FOOL.
  1048. At this point there are several things you can do.
  1049. If your string was mistyped,
  1050. you can rub some of it out and correct it.
  1051. If you like the place you have found,
  1052. you can type Return or some other \s-2JOVE\s0 command
  1053. to "accept what the search offered".
  1054. Or you can type C-G,
  1055. which undoes the search altogether and positions you back where you started
  1056. the search.
  1057. .LP
  1058. You can also type C-R at any time to start searching backwards.
  1059. If a search fails because the place you started was too late in the file,
  1060. you should do this.
  1061. Repeated C-R's keep looking backward for more occurrences of the last search string.
  1062. A C-S starts going forward again.
  1063. C-R's can be rubbed out just like anything else.
  1064. .NH 2
  1065. Searching with Regular Expressions
  1066. .XS \n(PN 5n
  1067. \*(SN Searching with Regular Expressions
  1068. .XE
  1069. .LP
  1070. In addition to the searching facilities described above,
  1071. \s-2JOVE\s0
  1072. can search for patterns using regular expressions.
  1073. The handling of regular expressions in \s-2JOVE\s0 is like that of \fIed(1)\fP
  1074. or \fIvi(1)\fP, but with some notable additions.
  1075. The extra metacharacters understood by \s-2JOVE\s0 are \e<,
  1076. \e>,
  1077. \e\|| and \e\|{.
  1078. The first two of these match the beginnings and endings of words;
  1079. Thus the search pattern,
  1080. "\|\e<Exec" would match all words beginning with the letters "Exec".
  1081. .LP
  1082. An \e\|| signals the beginning of an alternative \(em that is, the
  1083. pattern "foo\e\||bar" would match either "foo" or "bar".  The "curly
  1084. brace" is a way of introducing several sub-alternatives into a pattern.
  1085. It parallels the [] construct of regular expressions, except it specifies
  1086. a list of alternative words instead of just alternative characters.  So
  1087. the pattern "foo\e\|{bar,baz\e\|}bie" matches "foobarbie" or "foobazbie".
  1088. .LP
  1089. \s-2JOVE\s0 only regards metacharacters as special if the variable
  1090. \fImatch-regular-expressions\fP is set to "on".
  1091. The ability to have \s-2JOVE\s0 ignore these characters is useful if
  1092. you're editing a document about patterns and regular expressions or
  1093. when a novice is learning \s-2JOVE\s0.
  1094. .LP
  1095. Another variable that affects searching is \fIcase-ignore-search\fP.  If
  1096. this variable is set to "on" then upper case and lower case letters are
  1097. considered equal.
  1098. .NH 1
  1099. Replacement Commands
  1100. .XS \n(PN
  1101. \*(SN Replacement Commands
  1102. .XE
  1103. .LP
  1104. Global search-and-replace operations are not needed as often in \s-2JOVE\s0
  1105. as they are in other editors,
  1106. but they are available.
  1107. In addition to
  1108. the simple Replace operation which is like that found in most editors,
  1109. there is a Query Replace operation which asks,
  1110. for each occurrence of the pattern,
  1111. whether to replace it.
  1112. .NH 2
  1113. Global replacement
  1114. .XS \n(PN 5n
  1115. \*(SN Global Replacement
  1116. .XE
  1117. .LP
  1118. To replace every occurrence of FOO after point with BAR,
  1119. you can do, e.g., "ESC R FOO<return>BAR" as the \fIreplace-string\fP command
  1120. is bound to the ESC R.
  1121. Replacement takes place only between point and the end of the buffer
  1122. so if you want to cover the whole buffer you must go to the beginning first.
  1123. .NH 2
  1124. Query Replace
  1125. .XS \n(PN 5n
  1126. \*(SN Query Replace
  1127. .XE
  1128. .LP
  1129. If you want to change only some of the occurrences of FOO,
  1130. not all,
  1131. then the global \fIreplace-string\fP is inappropriate;
  1132. Instead,
  1133. use, e.g., "ESC Q FOO<return>BAR", to run the command \fIquery-replace-string\fP.
  1134. This displays each occurrence of FOO and waits for you to say whether
  1135. to replace it with a BAR.
  1136. The things you can type when you are shown an occurrence of FOO are:
  1137. .IP "Space" 15n
  1138. to replace the FOO.
  1139. .IP "Rubout" 15n
  1140. to skip to the next FOO without replacing this one.
  1141. .IP "Return" 15n
  1142. to stop without doing any more replacements.
  1143. .IP "Period" 15n
  1144. to replace this FOO and then stop.
  1145. .IP "! or P" 15n
  1146. to replace all remaining FOO's without asking.
  1147. .IP "C-R or R" 15n
  1148. to enter a recursive editing level,
  1149. in case the FOO needs to be edited rather than just replaced with a BAR.
  1150. When you are done,
  1151. exit the recursive editing level with C-X C-C and the next FOO will
  1152. be displayed.
  1153. .IP "C-W" 15n
  1154. to delete the FOO, and then start editing the buffer.
  1155. When you are finished editing whatever is to replace the FOO,
  1156. exit the recursive editing level with C-X C-C
  1157. and the next FOO will be displayed.
  1158. .IP "U" 15n
  1159. move to the last replacement and undo changes to this line.
  1160. .LP
  1161. Another alternative is using \fIreplace-in-region\fP which is just like
  1162. \fIreplace-string\fP except it searches only within the region.
  1163. .LP
  1164.