home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / jove4.9 / part18 < prev    next >
Encoding:
Internet Message Format  |  1988-04-27  |  40.9 KB

  1. Subject:  v14i074:  Jove, an emacs variant, version 4.9, Part18/21
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Jonathan Payne <jpayne@cs.rochester.edu>
  7. Posting-number: Volume 14, Issue 74
  8. Archive-name: jove4.9/part18
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 18 (of 21)."
  17. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  18. if test -f './doc/teach-jove' -a "${1}" != "-c" ; then 
  19.   echo shar: Will not clobber existing file \"'./doc/teach-jove'\"
  20. else
  21. echo shar: Extracting \"'./doc/teach-jove'\" \(39884 characters\)
  22. sed "s/^X//" >'./doc/teach-jove' <<'END_OF_FILE'
  23. X               J O V E   T U T O R I A L 
  24. X
  25. Welcome to JOVE - an advanced, easy-to-use, user-friendly environment 
  26. for editing text, programs or anything else you may like to type.
  27. X
  28. JOVE commands generally involve the CONTROL key (sometimes labelled
  29. CTRL or CTL) or the META key (generally labelled ESCAPE).  Rather than
  30. write out META or CONTROL each time we want you to prefix a character,
  31. we'll use the following abbreviations:
  32. X
  33. X C-<chr>  means hold the CONTROL key while typing the character <chr>
  34. X      Thus, C-F would be: hold the CONTROL key and type F.
  35. X M-<chr>  means type the META (ESCAPE) key and release it, then type
  36. X      the character <chr>.  The <chr> can be upper or lower case
  37. X      and it will have the same meaning.
  38. X
  39. Important note: if you must exit at some point, type C-X C-C.
  40. The characters ">>" at the left margin indicate directions for you to
  41. try using a command.  For instance:
  42. X
  43. X>>  Now type C-V (View next screen) to move to the next screen.
  44. X    (go ahead, do it by depressing the control key and V together).
  45. X    From now on, you'll be expected to do this whenever you finish
  46. X    reading the screen.
  47. X
  48. Note that there is an overlap when going from screen to screen; this
  49. provides some continuity when moving through the file.
  50. X
  51. The first thing that you need to know is how to move around from
  52. place to place in the file.  You already know how to move forward a
  53. screen, with C-V.  To move backwards a screen, type M-V (depress the
  54. META key and type V, or type <ESC>V if you don't have a META or EDIT
  55. key).
  56. X
  57. X>>  Try typing M-V and then C-V to move back and forth a few times.
  58. X
  59. X
  60. SUMMARY
  61. X-------
  62. X
  63. The following commands are useful for viewing screenfuls:
  64. X
  65. X    C-V    Move forward one screenful
  66. X    M-V    Move backward one screenful
  67. X    C-L    Center the current line--clear screen and redisplay
  68. X        everything if current line is already at center.
  69. X    
  70. X>> find the cursor and remember what text is near it.
  71. X   Then type a C-L.
  72. X   Find the cursor again and see what text is near it now.
  73. X
  74. X
  75. BASIC CURSOR CONTROL
  76. X--------------------
  77. X
  78. Getting from screenful to screenful is useful, but how do you
  79. reposition yourself within a given screen to a specific place?  There
  80. are several ways you can do this.  One way (not the best, but the most
  81. basic) is to use the commands previous, backward, forward and next.
  82. As you can imagine these commands (which are given to JOVE as C-P,
  83. C-B, C-F, and C-N respectively) move the cursor from where it
  84. currently is to a new place in the given direction.  Here, in a more
  85. graphical form are the commands:
  86. X              Previous line, C-P
  87. X                  :
  88. X                  :
  89. X   Backward, C-B .... Current cursor position .... Forward, C-F
  90. X                  :
  91. X                  :
  92. X              Next line, C-N
  93. X
  94. You'll probably find it easy to think of these by letter.  P for
  95. previous, N for next, B for backward and F for forward.  These are the
  96. basic cursor positioning commands and you'll be using them ALL the
  97. time so it would be of great benefit if you learn them now.
  98. X
  99. X>> Do a few C-N's to bring the cursor down to this line.
  100. X
  101. X>> Move into the line with C-F's and then up with several C-P's.  See
  102. X   what C-P does when the cursor is in the middle of the line.
  103. X
  104. Lines are separated by a single Linefeed character, which is what Unix
  105. calls a Newline.
  106. X
  107. X>> Try to C-B at the beginning of a line.  Do a few more C-B's.
  108. X   Then do C-F's back to the end of the line and beyond.
  109. X
  110. When you go off the top or bottom of the screen, the text beyond the
  111. edge is shifted onto the screen so that your instructions can be
  112. carried out while keeping the cursor on the screen.
  113. X
  114. X>> Try to move the cursor off the bottom of the screen with C-N and
  115. X   see what happens.
  116. X
  117. If moving by characters is too slow, you can move by words.  M-F
  118. X(Meta-F) moves forward a word and M-B moves back a word.
  119. X
  120. X>> Type a few M-F's and M-B's.  Intersperse them with C-F's and C-B's.
  121. X
  122. Notice the parallel between C-F and C-B on the one hand, and M-F and
  123. M-B on the other hand.  Very often Meta characters are used for
  124. operations related to English text whereas Control characters operate
  125. on the basic textual units that are independent of what you are
  126. editing (characters, lines, etc).  There is a similar parallel between
  127. lines and sentences: C-A and C-E move to the beginning or end of a
  128. line, and M-A and M-E move to the beginning or end of a sentence.
  129. X
  130. X>> Try a couple of C-A's, and then a couple of C-E's.
  131. X   Try a couple of M-A's, and then a couple of M-E's.
  132. X
  133. See how repeated C-A's do nothing, but repeated M-A's keep moving
  134. farther.  Do you think that this is right?
  135. X
  136. Two other simple cursor motion commands are M-< (Meta Less-than),
  137. which moves to the beginning of the file, and M-> (Meta Greater-than),
  138. which moves to the end of the file.  You probably don't need to try
  139. them, since finding this spot again will be boring.  If you need the
  140. shift key to type a "<", then you must also use the shift key to type
  141. M-<.  Otherwise, you would be typing M-, .
  142. X
  143. The location of the cursor in the text is also called "point".  To
  144. paraphrase, the cursor shows on the screen where point is located in
  145. the text.
  146. X
  147. Here is a summary of simple moving operations including the word and
  148. sentence moving commands:
  149. X
  150. X    C-F    Move forward a character
  151. X    C-B    Move backward a character
  152. X
  153. X    M-F    Move forward a word
  154. X    M-B    Move backward a word
  155. X
  156. X    C-N    Move to next line
  157. X    C-P    Move to previous line
  158. X
  159. X    C-A    Move to beginning of line
  160. X    C-E    Move to end of line
  161. X
  162. X    M-A    Move back to beginning of sentence
  163. X    M-E    Move forward to end of sentence
  164. X
  165. X    M-<    Go to beginning of file
  166. X    M->    Go to end of file
  167. X
  168. X>> Try all of these commands now a few times for practice.  Since the
  169. X   last two will take you away from this screen, you can come back
  170. X   here with the command C-X C-X (which will be explained later).
  171. X   These are the most often used commands.
  172. X
  173. Like all other commands in JOVE, these commands can be given arguments
  174. which cause them to be executed repeatedly.  The way you give a
  175. command a repeat count is by typing META and then the digits before
  176. you type the command.  (Remember META is ususally called ESCAPE)
  177. X
  178. For instance, META 8 C-F moves forward eight characters.
  179. X    
  180. X>> Try giving a suitable argument to C-N or C-P to come as close
  181. X   as you can to this line in one jump.
  182. X
  183. The only apparent exception to this is the screen moving commands, C-V
  184. and M-V.  When given an argument, they scroll the screen up or down by
  185. that many lines, rather than screenfuls.  This proves to be much more
  186. useful.
  187. X
  188. X>> Try typing M-8 C-V now.
  189. X
  190. Did it scroll the screen up by 8 lines?  If you would like to scroll
  191. it down you can give an argument to M-V.
  192. X
  193. X
  194. X
  195. THE UNIVERSAL ARGUMENT
  196. X----------------------
  197. X   Almost  every  command  in JOVE takes a so-called Universal Argument.
  198. This argument, although it is  interpreted  differently  in  some  cases,
  199. usually means REPEAT.  The way you give a command a universal argument is
  200. by typing ESC and then the number. For example, ESC 10 C-F would move you
  201. forward ten characters.
  202. X
  203. X>>> Try  giving a suitable argument to C-N or C-P to come as close as you
  204. X    can to this  line  in  one  jump.  Then  try giving the same command, 
  205. X    except make the number negative.
  206. X
  207. X  Another count-giving command is C-U.  This command, when you first type
  208. it, gives you an argument of 4 (four).  If you type C-U C-U, you will get
  209. an argument of 16.  Each time C-U is typed, the argument is multiplied by
  210. four.
  211. X
  212. X  One important exception to this is with the screen moving commands.  In
  213. this case, the number refers to the number of LINES to  scroll,  not  the
  214. number  of  screens.   As  a special case, C-U C-V or C-U M-V will scroll
  215. exactly one half screenful.
  216. X
  217. X>>> Try typing ESC 8 C-V now.
  218. X
  219. THE GOTO COMMAND
  220. X----------------
  221. X   Now that we've learned about the universal argument, we can  introduce
  222. another  cursor  positioning  command,  the command to move to a specific
  223. line.  This command is given by giving a line number via  ESC,  and  then
  224. typing M-G.
  225. X
  226. X>>> Try  using  the M-< and M-> commands to move to the beginning and the
  227. X    end of the file. Then come back here  using the M-G  command (this is 
  228. X    line 164, so you'd type ESC 164 M-G.)
  229. X
  230. QUITTING FROM COMMANDS
  231. X----------------------
  232. X
  233. The character in JOVE used to quit out of all commands which request
  234. input is C-G.  For example, you can use C-G to discard a numeric
  235. argument or the beginning of a command that you don't want to finish.
  236. X
  237. X>> Type M-100 to make a numeric arg of 100, then type C-G.  Now type
  238. X   C-F.  How many characters does it move?  If you have typed an <ESC>
  239. X   by mistake, you can get rid of it with a C-G.
  240. X
  241. X
  242. ERRORS
  243. X------
  244. X
  245. Sometimes you may do something which JOVE doesn't allow.  If it is
  246. something simple, such as typing a control key sequence which is not
  247. associated with any command, JOVE will just beep at you.  Otherwise,
  248. JOVE will also display an informative error message at the bottom of
  249. the screen.
  250. X
  251. Some versions of JOVE do not have all the features described in this
  252. tutorial implemented yet.  If you come across such an unimplemented
  253. feature, you may get an error message when you try to use it.  Just
  254. proceed on to the next section of the tutorial.
  255. X
  256. X
  257. INSERTING AND DELETING
  258. X----------------------
  259. X
  260. If you want to type text, just do it.  Characters which you can see,
  261. such as A, 7, *, etc. are taken by JOVE as text and inserted
  262. immediately.  Type <Return> (the carriage-return key) to insert a line
  263. separator.
  264. X
  265. You can delete the last character you typed by typing <Delete>.
  266. X<Delete> is a key on the keyboard, which may be labeled "Rubout"
  267. instead of "Delete" on some terminals.  More generally, <Delete>
  268. deletes the character immediately before the current cursor position.
  269. X
  270. X>> Do this now, type a few characters and then delete them by typing
  271. X   <Delete> a few times.  Don't worry about this file being changed;
  272. X   you won't affect the master tutorial.  This is just a copy of it.
  273. X
  274. X>> Now start typing text until you reach the right margin, and keep
  275. X   typing.  When a line of text gets too big for one line on the
  276. X   screen, the line of text is "continued" off the edge of the screen
  277. X   The exclamation mark at the right margin indicates a line which has
  278. X   been continued.  The line will slide over if you move off the edge
  279. X   on either side.
  280. X
  281. X>> The following line actually goes off the edge.  Trying typing enough
  282. X   C-F's that you move off the right hand end of this line.... This is a long line of text that the JOVE editor extends to the right.
  283. X
  284. X>> Use <Delete>s to delete the text until the line fits on one screen
  285. X   line again.  The continuation "!" will go away.
  286. X
  287. X>> Move the cursor to the beginning of a line and type <Delete>.  This
  288. X   deletes the line separator before the line and merges the line onto
  289. X   the previous line.  The resulting line may be too long to fit, in
  290. X   which case it has a continuation indication.
  291. X
  292. X>> Type <Return> to insert the separator again.
  293. X
  294. Remember that most JOVE commands can be given a repeat count;  Note
  295. that this includes characters which insert themselves.
  296. X
  297. X>>  Try that now -- type META 8 * and see what happens.
  298. X
  299. If you want to create a blank line in between two lines, move to the
  300. second of the two lines and type C-O.
  301. X
  302. X>>  Try moving to a line and typing C-O now.
  303. X
  304. You've now learned the most basic way of typing something in JOVE and
  305. correcting errors.  You can delete by words or lines as well.  Here is
  306. a summary of the delete operations:
  307. X
  308. X    <Delete>     delete the character just before the cursor
  309. X    C-D            delete the next character after the cursor
  310. X
  311. X    M-<Delete>   kill the word immediately before the cursor
  312. X    M-D         kill the next word after the cursor
  313. X
  314. X    C-K         kill from the cursor position to end of line
  315. X    M-K         kill to the end of the current sentence
  316. X
  317. Notice that <Delete> and C-D vs M-<Delete> and M-D extend the parallel
  318. started by C-F and M-F (well, <Delete> isn't really a control
  319. character, but let's not worry about that).  C-K and M-K are like C-E
  320. and M-E, sort of, in that lines are opposite sentences.
  321. X
  322. Now suppose you kill something, and then you decide that you want to
  323. get it back?  Well, whenever you kill something bigger than a
  324. character, JOVE saves it for you.  To yank it back, use C-Y.  Note
  325. that you don't have to be in the same place to do C-Y; This is a good
  326. way to move text around.  Also note that the difference between
  327. X"Killing" and "Deleting" something is that "Killed" things can be
  328. yanked back, and "Deleted" things cannot.  Generally, the commands
  329. that can destroy a lot of text save it, while the ones that attack
  330. only one character, or nothing but blank lines and spaces, do not save.
  331. X
  332. For instance, type C-N a couple times to postion the cursor at some
  333. line on this screen.
  334. X
  335. X>> Do this now, move the cursor and kill that line with C-K.
  336. X
  337. Note that a single C-K kills the contents of the line, and a second
  338. C-K kills the line itself, and make all the other lines move up.  If
  339. you give C-K a repeat count, it kills that many lines AND their
  340. contents.
  341. X
  342. The text that has just disappeared is saved so that you can retrieve
  343. it.  To retrieve the last killed text and put it where the cursor
  344. currently is, type C-Y.
  345. X
  346. X>> Try it; type C-Y to yank the text back.
  347. X
  348. Think of C-Y as if you were yanking something back that someone took
  349. away from you.  Notice that if you do several C-K's in a row the text
  350. that is killed is all saved together so that one C-Y will yank all of
  351. the lines.
  352. X
  353. X>> Do this now, type C-K several times.
  354. X
  355. Now to retrieve that killed text:
  356. X
  357. X>> Type C-Y.  Then move the cursor down a few lines and type C-Y
  358. X   again.  You now see how to copy some text.
  359. X
  360. What do you do if you have some text you want to yank back, and then
  361. you kill something else?  C-Y would yank the more recent kill.  But
  362. the previous text is not lost.  You can get back to it using the M-Y
  363. command.  After you have done C-Y to get the most recent kill, typing
  364. M-Y replaces that yanked text with the previous kill.  Typing M-Y
  365. again and again brings in earlier and earlier kills.  When you have
  366. reached the text you are looking for, you can just go away and leave
  367. it there.  If you M-Y enough times, you come back to the starting
  368. point (the most recent kill).
  369. X
  370. X>> Kill a line, move around, kill another line.  Then do C-Y to get
  371. X   back the second killed line.  Then do M-Y and it will be replaced
  372. X   by the first killed line.  Do more M-Y's and see what you get.
  373. X   Keep doing them until the second kill line comes back, and then a
  374. X   few more.  If you like, you can try giving M-Y positive and negative
  375. X   arguments.
  376. X
  377. X
  378. FILES
  379. X-----
  380. X
  381. In order to make the text you edit permanent, you must put it in a
  382. file.  Otherwise, it will go away when your invocation of JOVE goes
  383. away.  While you are editing a file in JOVE, your changes are actually
  384. being made to a private "scratch" copy of the file.  However, the
  385. changes still don't become permanent until you "save" the file.  This
  386. is so you can have control to avoid leaving a half-changed file around
  387. when you don't want to.
  388. X
  389. If you look near the botton of the screen you will see a line that
  390. looks like this:
  391. X    JOVE (Text) Buffer: teach-jove "teach-jove" *
  392. X"teach-jove" is the name of the file you are editing.  This is the name
  393. of your own temporary copy of the text of the JOVE tutorial; the file
  394. you are now editing.  Whatever file you edit, that file's name will
  395. appear in that precise spot.
  396. X
  397. The commands for finding and saving files are unlike the other
  398. commands you have learned in that they consist of two characters.
  399. They both start with the character Control-X.  There is a whole series
  400. of commands that start with Control-X; many of them have to do with
  401. files, buffers, and related things, and all of them consist of
  402. Control-X followed by some other character.  As with M- the character
  403. interpreted the same regardless of case.
  404. X
  405. Another thing about the command for finding a file is that you have to
  406. say what file name you want.  We say the command "reads an argument
  407. from the terminal" (in this case, the argument is the name of the
  408. file).  After you type the command
  409. X
  410. X    C-X C-F   Find a file
  411. X
  412. JOVE will ask you for the file name.  You should end the name with
  413. the Return key.  After this command, you will see the contents of the
  414. file in your JOVE.  You can edit the contents.  When you wish to make
  415. the changes permanent, issue the command
  416. X
  417. X    C-X C-S   Save the file
  418. X
  419. Warning: on many systems JOVE will not be able to process the key C-S.
  420. In place of C-S, you should type C-\.  It is possible to make C-S work
  421. but C-\ is guaranteed always to work in place of C-S.
  422. X
  423. The old version of the file will be replaced.  When the operation is
  424. finished, JOVE prints the name and number of lines and characters
  425. saved.
  426. X
  427. If you forget to save and then edit a different file, JOVE will remind
  428. you that you made changes that have not been saved and then ask you
  429. whether you really want to quit.  (If you don't save them, they will
  430. be thrown away.  That might be what you want!)  You should answer with
  431. a "Y" to throw the changes away or "N" to abort quitting so you can
  432. then save the changes.
  433. X
  434. To make a new file, just edit it "as if" it already existed.  Then
  435. start typing in the text.  When you ask to "save" the file, JOVE will
  436. really create the file with the text that you have inserted.  From
  437. then on, you can consider yourself to be editing an already existing
  438. file.
  439. X
  440. It is not easy for you to try out editing a file and continue with the
  441. tutorial.  But you can always come back into the tutorial by starting
  442. it over and skipping forward.  So, when you feel ready, you should try
  443. editing a file named "FOO", putting some text in it, and saving it;
  444. then exit from JOVE and look at the file to be sure that it worked.
  445. X
  446. CONCLUSION OF PART ONE
  447. X----------------------
  448. X   This is the end of the first part of  this  tutorial.   You  now  know
  449. enough to edit a file with JOVE, and save your work.  The second part of
  450. this tutorial, which starts with the next section,  discusses  searching,
  451. replacing,  word  processing,  and other modes of JOVE.  You may wish to
  452. stop here and practice for awhile before you continue.
  453. X
  454. X
  455. EXTENDING THE COMMAND SET
  456. X-------------------------
  457. X
  458. There are many, many more JOVE commands than could possibly be put on
  459. all the control and meta characters.  JOVE gets around this with the X
  460. X(eXtend) command.  This comes in two flavors:
  461. X
  462. X    C-X    Character eXtend.  Followed by one character.
  463. X    M-X    Named command eXtend.  Followed by a long name.
  464. X
  465. These are commands that are generally useful but used less than the
  466. commands you have already learned about.  You have already seen two of
  467. them: the file commands C-X C-F to Find and C-X C-S to Save.  Another
  468. example is the command to tell JOVE that you'd like to stop editing.
  469. The command to do this is C-X C-C.
  470. X
  471. There are many C-X commands.  The ones you need immediately are:
  472. X
  473. X    C-X C-V        Visit file.
  474. X    C-X C-S        Save file.
  475. X    C-X C-C        Quit JOVE.  This does not save your files auto-
  476. X            matically, though if your files have been modi-
  477. X            fied, JOVE asks if you really want to quit.  The
  478. X            standard way to save and exit is C-X C-S C-X C-C.
  479. X
  480. Named eXtended commands are commands which are used even less
  481. frequently, or commands which are used only in certain modes.  These
  482. commands are usually called "commands".  An example is the command
  483. X"apropos", which prompts for a keyword and then gives the names of all
  484. the commands that apropos for that keyword.  When you type M-X, JOVE
  485. prompts you at the bottom of the screen with ":" and you should type
  486. the name of the command you wish to call; in this case, "apropos".
  487. Just type "apr<Space>" and JOVE will complete the name.  JOVE will ask
  488. you for a keyword or phrase and you type the string that you want ask
  489. about.
  490. X
  491. X>> Try typing M-X, followed by "apropos" or "apr" and then Return.
  492. X   Then try typing "file" followed by a Return.
  493. X
  494. X
  495. MODE LINE
  496. X---------
  497. X
  498. If JOVE sees that you are typing commands slowly it shows them to you
  499. at the bottom of the screen in an area called the echo area.  The echo
  500. area contains the bottom line of the screen.  The line immediately above
  501. them is called the MODE LINE.  The mode line says something like
  502. X
  503. X   JOVE (Text)  Buffer: [buffername]  "filename" *
  504. X
  505. This is a very useful "information" line.
  506. X
  507. The buffername is the name JOVE gave to the buffer, and it is usually
  508. related to the filename.  You already know what the filename means --
  509. it is the file you have edited.
  510. X
  511. The star means that you have made changes to the text.  Right after
  512. you visit or save a file, there is no star.
  513. X
  514. The part of the mode line inside the parentheses is to tell you what
  515. modes you are in.  The default mode is Text which is what you are in
  516. now.  It is an example of a "major mode".  There are several major
  517. modes in JOVE for editing different languages and text, such as C
  518. mode, Lisp mode, Text mode, etc.  At any time one and only one major
  519. mode is active, and its two-letter code can always be found in the
  520. mode line just where "Text" is now.  Each major mode makes a few
  521. commands behave differently.  For example, what JOVE considers as part
  522. of a valid expression or an identifier differs from one major mode to
  523. another, since each programming language has a different idea of what
  524. is a legal identifier.
  525. X
  526. Major modes are called major because there are also minor modes.  They
  527. are called minor because they aren't alternatives to the major modes,
  528. just minor modifications of them.  Each minor mode can be turned on or
  529. off by itself, regardless of what major mode you are in, and
  530. regardless of the other minor modes.  So you can use no minor modes,
  531. or one minor mode, or any combination of several minor modes.
  532. X
  533. One minor mode which is very useful, especially for editing English
  534. text, is "Auto Fill" mode.  When this mode is on, JOVE breaks the line
  535. in between words automatically whenever the line gets too long.  You
  536. can turn this mode on by doing M-X auto-fill-mode<Return>.  When the
  537. mode is on, you can turn it off by doing M-X auto-fill-mode<Return>--
  538. it toggles.
  539. X
  540. X>> Type "M-X auto-fill-mode<Return>" now.  Then insert a line with a
  541. X   bunch of words over again until you see it divide into two lines.
  542. X   You must put in spaces between them because Auto Fill breaks lines
  543. X   only at spaces.  Notice that "Fill" (the code for Auto Fill) appears
  544. X   in the mode line after "Text" to indicate that you are in Text Fill
  545. X   mode.
  546. X
  547. The margin is usually set at 78 characters, but you can change it with
  548. the set command.  The margin is kept in a variable just like the mode
  549. values.
  550. X
  551. X>> Type "M-X set right-margin 20", then type in some text and see
  552. X   JOVE fill lines of 20 characters with it.  Then set the margin
  553. X   back to 72 using M-X set again.
  554. X
  555. X
  556. SEARCHING
  557. X---------
  558. X
  559. JOVE can do searches for strings (these are groups of contiguous
  560. characters or words) either forward through the file or backward
  561. through it.  To search for the string means that you are trying to
  562. find that string somewhere in the file.  Remember to use C-\ where it
  563. says C-S.
  564. X
  565. X>> Now type C-S to start a search.  Type the word 'cursor', then
  566. X   Return.
  567. X
  568. X>> Type C-S Return to find the next occurrence of "cursor".
  569. X
  570. The C-S starts a search that looks for any occurrence of the search
  571. string AFTER the current cursor position.  But what if you want to
  572. search for something earlier in the text?  To do this one should type
  573. C-R for reverse search.  Everything that applies to C-S applies to C-R
  574. except that the direction of the search is reversed.
  575. X
  576. X
  577. REPLACING TEXT
  578. X--------------
  579. X
  580. X>> Move the cursor to the blank line two lines below this one.
  581. X   Then type M-r changed<Return>altered<Return>.
  582. X
  583. X   Notice how this line has changed: you've replaced the word
  584. X   c-h-a-n-g-e-d with "altered" wherever it occurs after the cursor.
  585. X
  586. The more customary command for replacing strings is the interactive
  587. command query-replace-search, which has several options.  In essence,
  588. it shows each occurrence of the first string and asks you if you want to
  589. replace it or not.  You can also choose to edit around the string, or
  590. go on and replace all occurrences without asking further.
  591. X
  592. X   This is invoked with M-Q..  When you start up a Query Replace, it
  593. will prompt you with "From" and "To", for what you want to change, and
  594. what you want to change it to.  JOVE will then move to the first
  595. occurence of the "From", and wait for a character.  You can type:
  596. X
  597. X    <SPACE>        Do  the  replacement, and move to next occurrence
  598. X            of the "From" string.
  599. X    <DEL>        Skip  the  current  "From" string and move to the 
  600. X            next one.
  601. X    RETURN        Exit the Query Replace now.
  602. X    r        Recursive Edit
  603. X    p        Replace  all  further  occurences  of  the "From" 
  604. X            string,    without asking. 
  605. X
  606. Recursive edit makes it possible to temporarily supend the Q-R-S, let the
  607. user go off and do something, and then return to the search after the  he
  608. is done. The command exit-jove (C-X C-C) returns from the recursive-edit.
  609. X
  610. GETTING MORE HELP
  611. X-----------------
  612. X
  613. In this tutorial we have tried to supply just enough information to
  614. get you started using JOVE.  There is so much available in JOVE that
  615. it would be impossible to explain it all here.  However, you may want
  616. to learn more about JOVE since it has numerous desirable features that
  617. you don't know about yet.  JOVE has a some internal documentation.
  618. X
  619. The most basic HELP feature is the describe-key command which is
  620. available by typing C-X ? and then a command character. JOVE prints
  621. one line line on the bottom of the screen tell what command is bound to
  622. that key.  You can then get further information on that command
  623. using...
  624. X
  625. The describe-command command M-? will prompt for the name of a command
  626. and print out the section from the manual about that command. When you
  627. are finished reading it, type a Space or a C-G (quit) to bring your text
  628. back on the screen.
  629. X
  630. X>> Type C-X ? Control-P.  The message at the bottom of the screen should
  631. X   be something like "C-P is bound to previous-line".
  632. X
  633. Multi-character commands such as C-X C-C and <ESC>V are also allowed
  634. after C-X ?.
  635. X
  636. Now lets get more information about the previous-line command.
  637. X
  638. X>> Type M-? previous-line.  When you are finished reading the
  639. X   output, type a Space.
  640. X
  641. The "name of the command" is important for people who are customizing
  642. JOVE.  It is what appears in the JOVE CHART as the documentation for
  643. the command character.
  644. X
  645. One other form of help is the "apropos" command.  We have already tried
  646. using this command in an earlier part of this tutorial, but it should
  647. be mentioned again here.  Apropos prompts for a word or phrase and
  648. lists all the commands that contain that string.  If you couldn't
  649. remember the name of a certain command to read file, you could run the
  650. apropos command with the keyword "file" and it would list all the
  651. commands that contain "file".  To run apropos you would type
  652. X
  653. X    M-X apr<Space>file<Return>
  654. X
  655. Finally, the full set of JOVE manuals are in five parts, and reside in
  656. the directory /usr/src/local/jove/doc under the names jove.1 to jove.5.
  657. These are in TROFF form, and the documents in /usr/src/local/jove/doc/docs 
  658. are in a form readable on the terminal or line-printer. Besides, someone
  659. around you must have a printed version which you can borrow! There is also 
  660. a chart of JOVE commands, sorted by function, which is handy as a quick
  661. reference. 
  662. X
  663. CONCLUSION OF PART TWO
  664. X----------------------
  665. X   This concludes section two of the JOVE tutorial.  The  rest  of  this
  666. tutorial  describes  some of the very advanced features of JOVE, such as
  667. editing more than one file at once, writing your own macros, windows, and
  668. initialization  files.   Unless  you're  already  somewhat  familiar with
  669. JOVE, you should probably wait a little while before starting the  third
  670. section.
  671. X
  672. MARKS AND REGIONS
  673. X-----------------
  674. X
  675. X   In  general, a command which processes an arbitrary part of the buffer
  676. must know where to start and where to  stop.   In  JOVE,  such  commands
  677. usually  operate  on the text between point (where the cursor is now) and
  678. X"the mark".  This range of text is called "the  region".   To  specify  a
  679. region, you set point to one end of it and mark at the other.  It doesn't
  680. matter which one is set first chronologically, or which one comes earlier
  681. in the text.  Here are some commands for setting the mark:
  682. X
  683. X        C-@         Set the mark where point is.
  684. X        C-<SPACE>   The same.
  685. X        C-X C-X     Interchange mark and point.
  686. X
  687. X   The  most  common  way  to set the mark is with the C-@ command or the
  688. C-<SPACE> command.  They set the mark where point is.  Then you can  move
  689. point away, leaving the mark behind.
  690. X
  691. X   Since  terminals  have  only  one cursor, there is no way for JOVE to
  692. show you where the mark is located.  You have  to  remember.   The  usual
  693. solution  to this problem is to set the mark and then use it soon, before
  694. you forget where it is.  But you can see  where  the  mark  is  with  the
  695. command  C-X  C-X which puts the mark where point was and point where the
  696. mark was.  The extent of the region is  unchanged,  but  the  cursor  and
  697. point are now at the previous location of the mark.
  698. X
  699. X   If  you  insert  or delete before the mark, the mark may drift through
  700. the text.  If the buffer contains "FOO BAR" and the mark  is  before  the
  701. X"B", then if you delete the "F" the mark will be before the "A".  This is
  702. an unfortunate result of the simple way the mark is implemented.   It  is
  703. best  not  to  delete  or  insert  at places above the mark until you are
  704. finished using it and don't care where it drifts to.
  705. X
  706. X   There  are many, many commands which use regions (the area between the
  707. point and the mark), which we have not  mentioned  here.   They  are  all
  708. similar to such things as "transpose paragraphs", etc., and can be found
  709. in the wall chart.
  710. X
  711. BUFFERS
  712. X-------
  713. X   When editing a file, JOVE reads the file  into  a  buffer.   This  is
  714. where the modifcations are done, and when you save the file with C-X C-S,
  715. the buffer is actually written out to the file.   JOVE  permits  you  to
  716. have  up  to 100 buffers, so, in essence, you can edit up to 100 files at
  717. the same time.
  718. X
  719. X   If you want to list the buffers you have, use  the  C-X  C-B  command.
  720. This  will  display  a  list of the buffers, their numbers and names, and
  721. whether or not they've been modified.
  722. X
  723. X>>> Do this now, type C-X C-B.  When you're done looking, type a <SPACE>.
  724. X
  725. X   You probably noticed you only have one buffer, named "Main".   If  you
  726. were  editing  more  than one file, however, you would have more than one
  727. buffer.  There are two ways to edit more than one file.  The first is  to
  728. call JOVE with more than one file on the command line.  For example, the
  729. command
  730. X
  731. X                  jove a b c
  732. X
  733. would create three buffers (named Main, b, and c),  each  one  containing
  734. one  file.   The  other  way  is  to use the C-X C-F command (called Find
  735. File).  This command prompts you for a filename, and then reads that file
  736. into a new buffer, and puts you into the new buffer.
  737. X
  738. X   To change buffers, use the C-X B command.  JOVE will prompt you for a
  739. buffer name, and print a name in parentheses.  If you just hit a carriage
  740. return  without  typing a buffer name, you will go to the buffer named in
  741. parentheses.  Another way to change buffers is to give C-X B an  argument
  742. with  C-U.   This goes to the buffer NUMBER, rather than using the buffer
  743. name.
  744. X
  745. X>>> Get a piece of paper, and write down the  following  commands.   Then
  746. X    run  them, to  get a feel for playing with buffers.  BE SURE TO WRITE 
  747. X    THEM DOWN! We don't want to get you lost!
  748. X
  749. X            C-X C-B
  750. X            <SPACE>
  751. X            C-X C-F        (type "/etc/motd" to the prompt)
  752. X            C-X C-B
  753. X            <SPACE>
  754. X            C-X B
  755. X            <RETURN>
  756. X
  757. X   Well, wasn't that fun?  Now you know how  to  get  another  file  into
  758. another  buffer,  and then "bounce" back and forth.  A nice feature about
  759. editing more than one file is that you can transfer text from one file to
  760. the  other.   Just  kill  it in one file, change buffers, and then put it
  761. back with C-Y.
  762. X
  763. WINDOWS
  764. X-------
  765. X   What you see on your screen is a "window" into the buffer you are 
  766. editing. JOVE allows you to have more than one window on your screen, and
  767. you can therefore look into two, or more buffers at once. You can also look at
  768. different parts of the same file. The command C-X 2 splits your screen into
  769. two windows, both looking into the same buffer. The command C-X 4 f will
  770. display a specified file in the other window, C-X 4 b will display a specified
  771. buffer in the other window, C-X n moves to the next window on the screen,
  772. while C-X p moves to the previous window.
  773. X
  774. X>>> Try the command C-X 2, which splits the screen into two windows, and
  775. X    displays the same buffer in both. You'll notice that you are in the new
  776. X    window. Try some commmands in this window, like C-V, or M-V, to move
  777. X    around in the file. Observe that the other window doesn't change its
  778. X    position realtime to the buffer. This gives you a way of looking at two
  779. X    parts of the same file. 
  780. X
  781. X>>> Now try to type some text, or change something. You will see the changes
  782. X    affecting the text in the other window as well. That is because both
  783. X    windows are displaying the same buffer, and therefor the same text. Changes
  784. X    in the contents of the buffer have to affect both windows.
  785. X
  786. X>>> Let's now try to edit another file in this window. Give the command 
  787. X    C-X C-F and type the name of file as "/etc/motd". You now have two files
  788. X    on your screen at the same time. 
  789. X
  790. X>>> Type the command M- C-V (Meta followed by C-V) and watch the other window
  791. X    page downward. This is very convenient when doing a variety of tasks, like
  792. X    correcting errors in a file - edit the file, with the list of errors in
  793. X    the other window!
  794. X
  795. X>>> Finally, let's get back to the main window (with this document) by typing
  796. X    C-X p (or C-X n, since there are only two windows). Expand this window 
  797. X    to fill the entire screen by typing C-X 1. 
  798. X
  799. Enjoyable, wasn't it! There are other commands for shrinking and growing
  800. windows, but one of the most useful when editing text like this is the command
  801. which invokes JOVE's interactive spelling checker. It's called spell-buffer.
  802. It runs the UNIX spell(1) command on the buffer, and puts the errors in
  803. another buffer in another window, and allows you to edit the list to remove
  804. the words you know are not errors. Then, type C-X C-C, which usually gets you
  805. out of JOVE but in this case only gets you out of the spell-edit mode. You can
  806. now go through the remaining spelling errors word-by-word, and you can correct
  807. them. The commands for this are C-X C-N (for next error) and C-X C-P (for
  808. previous error.) 
  809. X
  810. X>>> Try the spell-buffer command now, by going M-X spel <space> and watch.
  811. Delete a few errors, then type C-X C-C, and do a few C-X C-N's to find some
  812. errors in this document. We've left a few ! (deliberately, of course!!!)
  813. X    
  814. X
  815. MACROS
  816. X------
  817. X   A "keyboard macro" is a command defined by the user  to  abbreviate  a
  818. sequence  of  other commands.  If you discover that you are about to type
  819. C-N C-D forty times, you can define a keyboard macro to do  C-N  C-D  and
  820. call  it  with  a  repeat  count  of forty.  The commands which deal with
  821. keyboard macros are:
  822. X
  823. X        C-X (       Start defining a keyboard macro.
  824. X        C-X )       End the definition of a keyboard macro.
  825. X        C-X E       Execute the most recent keyboard macro.
  826. X
  827. X   You define a keyboard macro while executing the commands which are the
  828. definition.   Put  differently, as you are defining a keyboard macro, the
  829. definition is being executed for the first time.  This way, you  can  see
  830. what  the  effects of your commands are, so that you don't have to figure
  831. them out in your head.  When you are  finished,  the  keyboard  macro  is
  832. defined and also has been, in effect, executed once.  You can then do the
  833. whole thing over again by invoking the macro.
  834. X
  835. X   To start defining a keyboard macro, type the C-X ( command.  From then
  836. on,  your  commands  continue to be executed, but also become part of the
  837. definition of the macro.  "Def" appears in the mode line to remind you of
  838. what  is  going  on.  When you are finished, the C-X ) command terminates
  839. the definition (without becoming part of it!).
  840. X
  841. X   The macro thus defined can be invoked again with  the  C-X  E  command
  842. which  may  be  given a repeat count as a numeric argument to execute the
  843. macro many times.  C-X ) can also be given a repeat count as an argument,
  844. in  which  case it repeats the macro that many times right after defining
  845. it, but defining the macro counts as the first repetition  (since  it  is
  846. executed  as  you define it).  So, giving C-X ) an argument of 2 executes
  847. the macro immediately one additional time.  An argument of zero to C-X  E
  848. or C-X ) means repeat the macro indefinitely (until it gets an error).
  849. X
  850. X   If  you  want  to  perform  an operation on each line, then either you
  851. should start by positioning point on the line above the first one  to  be
  852. processed  and  then begin the macro definition with a C-N, or you should
  853. start on the proper line and end with a C-N.  Either way,  repeating  the
  854. macro will operate on successive lines.
  855. X
  856. X>>> Place the cursor at the top of the screen and then enter the commands
  857. X    below.  Note that after the first  command, "Def" appears in the mode 
  858. X    line.
  859. X
  860. X            C-X (
  861. X            C-A
  862. X            *****
  863. X            M-F
  864. X            M-F
  865. X            M-F
  866. X            -----
  867. X            C-N
  868. X            C-X )
  869. X
  870. X>>> Notice that as you typed those  commands in, they were executed.  Now   
  871. X    move  the cursor  down a couple of lines, but keep it near the top of 
  872. X    the  screen.  Type the  command C-U C-X E.  This will  execute your 
  873. X    macro 4 times.
  874. X
  875. X   Although not described here, it is possible  to both name  your macros,
  876. and to save and restore them from files.  See the documentation for this.
  877. X
  878. INITIALIZATION FILES
  879. X--------------------
  880. X   You can initialize JOVE just the way you like it by putting a file
  881. named ".joverc" in your home directory.  To see what this file should
  882. look like, look at the one in the directory /usr/src/local/jove/doc. The
  883. file system.rc is one such file, the other example is example.rc. It
  884. should be noted that the commands in this file contain control
  885. characters, which may make it hard to read.  Use the "cat -v" command
  886. for this. 
  887. X
  888. X   To  insert control  characters into  a file with JOVE, you should use 
  889. the C-Q command.  Type C-Q <X> where <X> is the control character. Note that
  890. C-Q will not work on some terminals, because it, like C-S, is used for
  891. suspending and restoring the output to the terminal. In that case, use
  892. the command M-X quo <space> <X>. 
  893. X
  894. INTERACTIVE SHELLS
  895. X------------------
  896. X
  897. X   One of JOVE's very powerful features is the ability to start up shells
  898. within the editor, and then use shell commands within the screen editing 
  899. environment. To execute a command again, just cursor-up to it, change it if
  900. you want with all the normal editing keys, and hit RETURN once to bring it
  901. down to your present command line, and again to execute it. We'll bow out
  902. here suggesting you consult the manual for hard details, or type M-X shell
  903. X<space> if you are the adventurous type! 
  904. X
  905. CONCLUSION
  906. X----------
  907. X
  908. Remember, to exit use C-X C-C.
  909. X
  910. This tutorial is meant to be understandable to all new users, so if
  911. you found something unclear, don't sit and blame yourself - complain!
  912. X
  913. You'll probably find that if you use JOVE for a few days you won't
  914. be able to give it up.  Initially it may give you trouble.  But remember
  915. that this is the case with any editor, especially one that can do many,
  916. many things.  And JOVE can do practically everything.
  917. X
  918. X   Hopefully you have enjoyed this tutorial,  and,  more  importantly,  I
  919. hope you've learned something.  If you use JOVE for about a week, and be
  920. patient, you will find that it is more convenient  and  friendly  to  use
  921. than any other editor you've used.  I know.  I did.
  922. X
  923. X---------------------------------------------------------------------------
  924. This tutorial was originally written by Richard Stallman for EMACS and
  925. modified by Doug Kingston and Jonathan Payne for JOVE. The section on windows
  926. was added at UofT by Mark Moraes. Comments on this document should be sent to
  927. jpayne@cs.rochesteredu. (12 February '86), or locally (at UofT), to 
  928. moraes@cga.toronto.edu.
  929. X
  930. END_OF_FILE
  931. if test 39884 -ne `wc -c <'./doc/teach-jove'`; then
  932.     echo shar: \"'./doc/teach-jove'\" unpacked with wrong size!
  933. fi
  934. # end of './doc/teach-jove'
  935. fi
  936. echo shar: End of archive 18 \(of 21\).
  937. cp /dev/null ark18isdone
  938. MISSING=""
  939. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
  940.     if test ! -f ark${I}isdone ; then
  941.     MISSING="${MISSING} ${I}"
  942.     fi
  943. done
  944. if test "${MISSING}" = "" ; then
  945.     echo You have unpacked all 21 archives.
  946.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  947. else
  948.     echo You still need to unpack the following archives:
  949.     echo "        " ${MISSING}
  950. fi
  951. ##  End of shell archive.
  952. exit 0
  953.