home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / uemacs3.7 / part04 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  51.4 KB

  1. Subject: v06i074:  MicroEmacs, Version 3.7 (uEmacs3.7), Part04/12
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: ihnp4!pur-ee!pur-phy!duncan!lawrence
  6. Mod.sources: Volume 6, Issue 74
  7. Archive-name: uEmacs3.7/Part04
  8.  
  9. [  This is the latest revision of one of two programs named "MicroEmacs";
  10.    when discussing these on the net, or in contacting the authors, make
  11.    sure to mention the version number -- in this case 3.7 -- as that is
  12.    the easiest way to distinguish between them.  Daniel will be posting
  13.    uuencoded executables in net.micro.pc and net.micro.amiga; the file
  14.    'readme' contains information on how to also get these from him
  15.    directly.   --r$ ]
  16.  
  17. echo extracting - emacs.tut
  18. sed 's/^X//' > emacs.tut << 'FRIDAY_NIGHT'
  19. XYou are looking at the MICRO-EMACS tutorial.  Comments on this document
  20. Xmay be refered to Dana Hoggatt or Dan Lawrance.
  21. X
  22. XEMACS commands generally involve the CONTROL key (sometimes labelled CTRL or 
  23. XCTL) or the META key (generally labelled ESCAPE).  Rather than write out META 
  24. Xor CONTROL each time we want you to prefix a character, we'll use the following
  25. Xabbreviations:
  26. X
  27. X   ^<chr>   means hold the CONTROL key while typing the character <chr>
  28. X            Thus, ^F would be: hold the CONTROL key and type F.
  29. X
  30. X   ESC-<chr>  means type the ESCAPE key and release it, then type the 
  31. X              character <chr>.  The <chr> can be upper or lower case 
  32. X              and it will have the same meaning.
  33. X
  34. XImportant note: if you must exit at some point, type ^X ^C.  
  35. X
  36. XThis tutorial attempts to help you "learn by doing".  The characters ">>" 
  37. Xat the left margin of your screen indicate directions for you to try using 
  38. Xa command.  For instance:
  39. X
  40. X>>  Now type ^V (View next screen) to move to the next screen.
  41. X    (go ahead, do it by depressing the control key and V together).
  42. X
  43. XFrom now on, you'll be expected to type ^V whenever you finish reading the 
  44. Xcurrent screen.
  45. X
  46. XNote that there is an overlap when going from screen to screen; this
  47. Xprovides some continuity when moving through the file.
  48. X
  49. XThe first thing that you need to know is how to move around from place to 
  50. Xplace in the file.  You already know how to move forward a screen, with ^V.  
  51. XTo move backwards a screen, type ^Z. (depress the CTRL key and type Z).
  52. X
  53. X>>  Try typing ^Z and then ^V to move back and forth a few times.
  54. X
  55. X
  56. XSUMMARY
  57. X-------
  58. X
  59. XThe following commands are useful for viewing screenfuls:
  60. X
  61. X     ^V      Move forward one screenful
  62. X     ^Z      Move backward one screenful
  63. X     <ESC>^L Clear screen and redisplay everything
  64. X             putting the text near the cursor at the center.
  65. X
  66. X>> find the cursor and remember what text is near it.
  67. X   Then type a <ESC>^L.
  68. X   Find the cursor again and see what text is near it now.
  69. X
  70. X
  71. XBASIC CURSOR CONTROL
  72. X--------------------
  73. X
  74. XGetting from screenful to screenful is useful, but how do you reposition 
  75. Xyourself within a given screen to a specific place?  There are several ways 
  76. Xyou can do this.  One way (not the best, but the most basic) is to use the 
  77. Xcommands previous, backward, forward and next.  As you can imagine these 
  78. Xcommands (which are given to EMACS as ^P, ^B, ^F, and ^N  respectively) move 
  79. Xthe cursor from where it currently is to a new place in the given direction.  
  80. XHere, in a more graphical form are the commands:
  81. X                          Previous line, ^P
  82. X                                  :
  83. X                                  :
  84. X   Backward, ^B .... Current cursor position .... Forward, ^F
  85. X                                  :
  86. X                                  :
  87. X                          Next line, ^N
  88. X
  89. XYou'll probably find it easy to think of these by letter.  P for
  90. Xprevious, N for next, B for backward and F for forward.  These are
  91. Xthe basic cursor positioning commands and you'll be using them ALL
  92. Xthe time so it would be of great benefit if you learn them now.
  93. X
  94. X>> Do a few ^N's to bring the cursor down to this line.
  95. X
  96. X>> Move into the line with ^F's and then up with several ^P's.
  97. X   See what ^P does when the cursor is in the middle of the line.
  98. X
  99. XLines are separated by a single Linefeed character, which is what
  100. XUnix calls a Newline.
  101. X
  102. X>> Try to ^B at the beginning of a line.  Do a few more ^B's.
  103. X   Then do ^F's back to the end of the line and beyond.
  104. X
  105. XWhen you go off the top or bottom of the screen, the text beyond
  106. Xthe edge is shifted onto the screen so that your instructions can
  107. Xbe carried out while keeping the cursor on the screen.
  108. X
  109. X>> Try to move the cursor off the bottom of the screen with ^N and
  110. X   see what happens.
  111. X
  112. XIf moving by characters is too slow, you can move by words.  ESC-F
  113. X(Meta-F) moves forward a word and ESC-B moves back a word.
  114. X
  115. X>> Type a few ESC-F's and ESC-B's.  Intersperse them with ^F's and ^B's.
  116. X
  117. XNotice the parallel between ^F and ^B on the one hand, and ESC-F and ESC-B on 
  118. Xthe other hand.  Very often Meta characters are used for operations related 
  119. Xto English text whereas Control characters operate on the basic textual units 
  120. Xthat are independent of what you are editing (characters, lines, etc).  There 
  121. Xis a similar parallel between lines and sentences: ^A and ^E move to the 
  122. Xbeginning or end of a line. and ESC-A and ESC-E move to the beginning or end 
  123. Xof a sentence.
  124. X
  125. X###  Note:  ESC-A and ESC-E are not implimented yet (DLH - 1/22/86)  ###
  126. X
  127. X>> Try a couple of ^A's, and then a couple of ^E's.
  128. X   Try a couple of ESC-A's, and then a couple of ESC-E's.
  129. X
  130. XSee how repeated ^A's do nothing, but repeated ESC-A's
  131. Xkeep moving farther.  Do you think that this is right?
  132. X
  133. XTwo other simple cursor motion commands are ESC-< (Meta Less-than),
  134. Xwhich moves to the beginning of the file, and ESC-> (Meta Greater-than),
  135. Xwhich moves to the end of the file.  You probably don't need to try
  136. Xthem, since finding this spot again will be boring.  If you need the
  137. Xshift key to type a "<", then you must also use the shift key to type
  138. XESC-<.  Otherwise, you would be typing ESC-, .
  139. X
  140. XThe location of the cursor within the text is also called "point".  To 
  141. Xparaphrase, the cursor shows on the screen where point is located in the text.
  142. X
  143. XHere is a summary of simple moving operations including
  144. Xthe word and sentence moving commands:
  145. X
  146. X     ^F        Move forward a character
  147. X     ^B        Move backward a character
  148. X
  149. X     ESC-F     Move forward a word
  150. X     ESC-B     Move backward a word
  151. X
  152. X     ^N        Move to next line
  153. X     ^P        Move to previous line
  154. X
  155. X     ESC-N     Move to next paragraph
  156. X     ESC-P     Move to previous paragraph 
  157. X
  158. X     ^A        Move to beginning of line
  159. X     ^E        Move to end of line
  160. X
  161. X     ESC-A     Move back to beginning of sentence  (not functional)
  162. X     ESC-E     Move forward to end of sentence     (not functional)
  163. X
  164. X     ESC-<     Go to beginning of file
  165. X     ESC->     Go to end of file
  166. X
  167. X>> Try all of these commands now a few times for practice.
  168. X   Since the last two will take you away from this screen,
  169. X   you can come back here with ^Z's and ^V's.  These are
  170. X   the most often used commands.
  171. X
  172. XLike all other commands in EMACS, these commands can be given
  173. Xarguments which cause them to be executed repeatedly.  The way you
  174. Xgive a command a repeat count is by typing META and then the digits
  175. Xbefore you type the command.  (Remember META is ususally called ESCAPE)
  176. X
  177. XFor instance, META 8 ^F moves forward eight characters.
  178. X
  179. X>> Try giving a suitable argument to ^N or ^P to come as close
  180. X   as you can to this line in one jump.
  181. X
  182. XThis also applies to the screen moving commands, ^V and ^Z.  When
  183. Xgiven an argument, they scroll the screen up or down by that many
  184. Xscreenfuls.  As a special case, typing just ^U is equivalent to ESC-4.
  185. X
  186. X>> Try typing ESC-3 ^V now.
  187. X
  188. XIf you would like to scroll it down, you can give an argument to ^Z.
  189. X
  190. X
  191. XQUITTING FROM COMMANDS
  192. X----------------------
  193. X
  194. XThe character in EMACS used to quit out of all commands which request
  195. Xinput is ^G.  For example, you can use ^G to discard a numeric argument
  196. Xor the beginning of a command that you don't want to finish.
  197. X
  198. X>> Type ESC-100 to make a numeric arg of 100, then type ^G.
  199. X   Now type ^F.  How many characters does it move?
  200. X   If you have typed an <ESC> by mistake, you can get rid of it
  201. X   with a ^G.
  202. X
  203. X
  204. XIBM CURSOR KEYS
  205. X---------------
  206. X
  207. XOn the IBM-PC version, the cursor keypad has been bound to some of the
  208. Xmore useful screen movement commands. The mappings are as follows:
  209. X
  210. X     Cursor-Right    ^F        Move forward a character
  211. X     Cursor-Left     ^B        Move backward a character
  212. X
  213. X     ^Cursor-Right   ESC-F     Move forward a word
  214. X     ^Cursor-Left    ESC-B     Move backward a word
  215. X
  216. X     Cursor-Down     ^N        Move to next line
  217. X     Cursor-UP       ^P        Move to previous line
  218. X
  219. X     Pg-Dn           ^V        Move to next screen
  220. X     Pg-Up           ^Z        Move to previous screen
  221. X
  222. X     Home            ESC-<     Go to beginning of file
  223. X     End             ESC->     Go to end of file
  224. X
  225. X     Insert          ^O        Open up a new line
  226. X     Delete          ^K        Kill to end of line
  227. X
  228. XUsage of the ^O and ^K commands is described later in the tutorial. A
  229. Xmap of the key layout looks something like this:
  230. X
  231. X              -------------------------------------------------
  232. X              | 7             | 8             | 9             |
  233. X              | Home          | ^             | Pg Up         |
  234. X              |               | |             |               |
  235. X              |     ESC-<     |      ^P       |     ^Z        |
  236. X              -------------------------------------------------
  237. X              | 4             | 5             | 6             |
  238. X              | <--           |               | -->           |
  239. X              |               |               |               |
  240. X              |      ^B       |               |      ^F       |
  241. X              -------------------------------------------------
  242. X              | 1             | 2             | 3             |
  243. X              | End           | |             | Pg Dn         |
  244. X              |               | v             |               |
  245. X              |     ESC->     |      ^N       |      ^V       |
  246. X  -------------------------------------------------------------
  247. X  | 0                         | .                             |
  248. X  | Insert                    | Delete                        |
  249. X  |                           |                               |
  250. X  |             ^O            |             ^K                |
  251. X  -------------------------------------------------------------
  252. X
  253. X>> if you have an IBM-PC, practice using the cursor keypad.
  254. X
  255. X
  256. X
  257. XERRORS
  258. X------
  259. X
  260. XSometimes you may do something which EMACS doesn't allow. If it is
  261. Xsomething simple, such as typing a control key sequence which is not
  262. Xassociated with any command, EMACS will just beep at you. Otherwise,
  263. XEMACS will also display an informative error message at the bottom of
  264. Xthe screen.
  265. X
  266. XSome versions of EMACS do not have all the features described in this
  267. Xtutorial implemented yet.  If you come across such an unimplemented
  268. Xfeature, you may get an error message when you try to use it.  Just
  269. Xtype a space and proceed on to the next section of the tutorial.
  270. X
  271. X
  272. XINSERTING AND DELETING
  273. X----------------------
  274. X
  275. XIf you want to type text, just do it.  Characters which you can see, such 
  276. Xas A, 7, *, etc. are taken by EMACS as text and are immediately inserted.  
  277. XType <Return> (the carriage-return key) to insert a line separator.
  278. X
  279. XYou can delete the last character you typed by typing either <Delete> or ^H.  
  280. XOn some keyboards, there is a dedicated key for creating a ^H.  If so, it is 
  281. Xusually labeled as either "Backspace" or "<--".  <Delete> is a key on the 
  282. Xkeyboard, which may be labeled "Rubout" instead of "Delete" on some terminals.
  283. XMore generally, <Delete> deletes the character immediately before the current 
  284. Xcursor position.
  285. X
  286. X>> Do this now, type a few characters and then delete them by typing
  287. X   <Delete> a few times.  Don't worry about this file being changed;
  288. X   you won't affect the master tutorial.  This is just a copy of it.
  289. X
  290. X>> Now start typing text until you reach the right margin, and keep
  291. X   typing.  When a line of text gets too big for one line on the
  292. X   screen, the line of text is "continued" off the edge of the screen
  293. X   The dollar sign at the right margin indicates a line which has
  294. X   been continued.  EMACS scrolls the line over so you can see what you 
  295. X   are editing.  The '$' at the left or right edge of the screen indicates 
  296. X   that the current line extends off in that direction.  
  297. X
  298. X>> The following line actually goes off the edge.  Trying typing enough ^F's
  299. X   so that you move off the right hand end of this line.  This is a long line of text.  Note the "$"s at each edge.  Keep typing ^F's and watch where EMACS decides to scroll the line.  Now, type ^B's until EMACS decides to scroll the line again.
  300. X
  301. XThis is one of those gizmos which is easier to understand by playing with it 
  302. Xthan by reading about it.
  303. X
  304. X>> Use ^D's or <Delete>s to delete the text until the text line fits on 
  305. X   one screen line again.  The continuation "$" will go away.
  306. X
  307. X>> Move the cursor to the beginning of a line and type <Delete>.  This
  308. X   deletes the line separator before the line and merges the line onto
  309. X   the previous line.  The resulting line may be too long to fit, in
  310. X   which case it has a continuation indication.
  311. X
  312. X>> Type <Return> to insert the separator again.
  313. X
  314. XInternally, EMACS will allow you to have lines of nearly any length, limited 
  315. Xonly by the amount of memory available.  Externally, however, EMACS can only 
  316. Xread or write lines, to or from a file, which are less than or equal to 255 
  317. Xcharacters.
  318. X
  319. XRemember that most EMACS commands can be given a repeat count;  Note
  320. Xthat this includes characters which insert themselves.
  321. X
  322. X>>  Try that now -- type META 8 * and see what happens.
  323. X
  324. XIf you want to create a blank line in between two lines, move to the
  325. Xsecond of the two lines and type ^O.
  326. X
  327. X>>  Try moving to a line and typing ^O now.
  328. X
  329. XYou've now learned the most basic way of typing something in
  330. XEMACS and correcting errors.  You can delete by words or lines
  331. Xas well.  Here is a summary of the delete operations:
  332. X
  333. X     <Delete>      delete the character just before the cursor
  334. X     ^H            delete the character just before the cursor
  335. X     ^D            delete the next character after the cursor
  336. X
  337. X     ESC-<Delete>  kill the word immediately before the cursor
  338. X     ESC-^H        kill the word immediately before the cursor
  339. X     ESC-D         kill the next word after the cursor
  340. X
  341. X     ^K            kill from the cursor position to end of line
  342. X
  343. XNotice that <Delete> and ^D vs ESC-<Delete> and ESC-D extend the parallel
  344. Xstarted by ^F and ESC-F (well, <Delete> isn't really a control
  345. Xcharacter, but let's not worry about that).
  346. X
  347. XNow suppose you kill something, and then you decide that you want to get 
  348. Xit back?  Well, whenever you kill something bigger than a character, EMACS 
  349. Xsaves it for you.  To yank it back, use ^Y.  Note that you don't have to 
  350. Xbe in the same place to do ^Y; This is a good way to move text around.  
  351. XAlso note that the difference between "Killing" and "Deleting" something 
  352. Xis that "Killed" things can be yanked back, and "Deleted" things cannot.  
  353. XGenerally, the commands that can destroy a lot of text save it, while the 
  354. Xones that attack only one character, or nothing but blank lines and spaces, 
  355. Xdo not save.
  356. X
  357. XFor instance, type ^N a couple times to postion the cursor
  358. Xat some line on this screen.
  359. X
  360. X>> Do this now, move the cursor and kill that line with ^K.
  361. X
  362. XNote that a single ^K kills the contents of the line, and a second
  363. X^K kills the line itself, and make all the other lines move up.  If
  364. Xyou give ^K a repeat count, it kills that many lines AND their contents.
  365. X
  366. XThe text that has just disappeared is saved so that you can
  367. Xretrieve it.  To retrieve the last killed text and put it where
  368. Xthe cursor currently is, type ^Y.
  369. X
  370. X>> Try it; type ^Y to yank the text back.
  371. X
  372. XThink of ^Y as if you were yanking something back that someone took away 
  373. Xfrom you.  Notice that if you do several ^K's in a row the text that is 
  374. Xkilled is all saved together so that one ^Y will yank all of the lines.
  375. X
  376. X>> Do this now, type ^K several times.
  377. X
  378. XNow to retrieve that killed text:
  379. X
  380. X>> Type ^Y.  Then move the cursor down a few lines and type ^Y
  381. X   again.  You now see how to copy some text.
  382. X
  383. XWhat do you do if you have some text you want to yank back, and then
  384. Xyou kill something else?  ^Y would yank the more recent kill.
  385. X
  386. X>> Kill a line, move around, kill another line.
  387. X   Then do ^Y to get back the second killed line.
  388. X
  389. X
  390. XFILES
  391. X-----
  392. X
  393. XIn order to make the text you edit permanent, you must put it in a file.
  394. XOtherwise, it will go away when you leave EMACS.  While you are editing a
  395. Xfile in EMACS, your changes are actually being made to a private
  396. X"scratch" copy of the file.  However, the changes still don't become
  397. Xpermanent until you "save" the file.  This is so you can have control to
  398. Xavoid leaving a half-changed file around when you don't want to.
  399. X
  400. XIf you look near the botton of the screen you will see a line that
  401. Xlooks like this:
  402. X
  403. X    =* MicroEMACS 3.1 (NORMAL) == emacs.tut == File: emacs.tut ==========
  404. X                                               ---------------
  405. X
  406. XNote that EMACS indicates the name of the file you are currently editing.
  407. XThis is the name of your own temporary copy of the text of the EMACS
  408. Xtutorial; the file you are now editing.  Whatever file you edit, that
  409. Xfile's name will appear in that precise spot.
  410. X
  411. XThe commands for finding and saving files are unlike the other commands you
  412. Xhave learned in that they consist of two characters. They both start with the
  413. Xcharacter Control-X.  There is a whole series of commands that start with
  414. XControl-X; many of them have to do with files, buffers, and related things,
  415. Xand all of them consist of Control-X followed by some other character.  As
  416. Xwith ESC, the character is interpreted the same regardless of case.
  417. X
  418. XAnother thing about the command for finding a file is that you have to say
  419. Xwhat file name you want.  We say the command "reads an argument from the
  420. Xterminal" (in this case, the argument is the name of the file).  After you
  421. Xtype the command
  422. X
  423. X     ^X ^F   Find a file
  424. X
  425. XEMACS will ask you for the file name.  You should end the name with
  426. Xthe Return key.  After this command, you will see the contents of the
  427. Xfile in your EMACS.  You can edit the contents.  When you wish to make
  428. Xthe changes permanent, issue the command
  429. X
  430. X     ^X ^S   Save the file
  431. X
  432. XA new version of the file will be created.  When the operation is
  433. Xfinished, EMACS prints the name and number of lines saved.
  434. X
  435. XIf you forget to save and edit a different file and then decide to quit,
  436. XEMACS will remind you that you made changes that have not been save and
  437. Xthen ask you whether you really want to quit.  (If you don't save them,
  438. Xthey will be thrown away.  That might be what you want!)  You should
  439. Xanswer with a "N" to save them or a "Y" to throw the changes away.
  440. X
  441. XTo make a new file, just edit it "as if" it already existed.  Then start 
  442. Xtyping in the text.  When you ask to "save" the file, EMACS will really 
  443. Xcreate the file with the text that you have inserted.  From then on, you 
  444. Xcan consider yourself to be editing an already existing file.
  445. X
  446. XIt is not easy for you to try out editing a file and continue with the 
  447. Xtutorial.  But you can always come back into the tutorial by starting it 
  448. Xover and skipping forward.  So, when you feel ready, you should try editing 
  449. Xa file named "FOO", putting some text in it, and saving it; then exit from 
  450. XEMACS and look at the file to be sure that it worked.
  451. X
  452. X
  453. XEXTENDING THE COMMAND SET
  454. X-------------------------
  455. X
  456. X###   The mechanisms for extending the command set and setting   ###
  457. X###   the key bindings has not been installed yet.  Skip forward ###
  458. X###   to the next section (TEXT REPLACEMENT).    DLH  (1/22/86)  ###
  459. X
  460. XThere are many, many more EMACS commands than could possibly be put
  461. Xon all the control and meta characters.  EMACS gets around this with
  462. Xthe X (eXtend) command.  This comes in two flavors:
  463. X
  464. X     ^X       Character eXtend.  Followed by one character.
  465. X     ESC-X    Named command eXtend.  Followed by a long name.
  466. X
  467. XThese are commands that are generally useful but used less than the commands 
  468. Xyou have already learned about.  You have already seen two of them: the file 
  469. Xcommands ^X ^F to Find and ^X ^S to Save.  Another example is the command to 
  470. Xtell EMACS that you'd like to stop editing.  The command to do this is ^X ^C.
  471. X
  472. XThere are many ^X commands.  The ones you need immediately are:
  473. X
  474. X     ^X ^F     Find file.
  475. X     ^X ^S     Save file.
  476. X     ^X ^C     Quit EMACS.  This does not save your files auto-
  477. X                 matically, though if your files have been modi-
  478. X                 fied, EMACS asks if you really want to quit.  The
  479. X                 standard way to save and exit is ^X ^S ^X ^C.
  480. X
  481. XNamed eXtended commands are commands which are used even less
  482. Xfrequently, or commands which are used only in certain modes. These
  483. Xcommands are usually called "functions". An example is the function
  484. X"apropos", which prompts for a keyword and then gives the names of all
  485. Xthe functions that apropos for that keyword. When you type ESC-X, EMACS
  486. Xprompts you at the bottom of the screen with ":" and you should type the
  487. Xname of the function you wish to call; in this case, "apropos". Just
  488. Xtype "apr<Space>" and EMACS will complete the name. EMACS will ask you
  489. Xfor a keyword or phrase and you type the string that you want ask about.
  490. X
  491. X>> Try typing ESC-X, followed by "apropos" or "apr" and then Return.
  492. X   Then try typing "file" followed by a Return.
  493. X
  494. X
  495. XTEXT REPLACEMENT
  496. X---- -----------
  497. X
  498. X>> Move the cursor to the blank line two lines below this one.
  499. X   Then type ESC-r changed<Escape>altered<Escape>.
  500. X
  501. X   Notice how this line has changed: you've replaced
  502. X   the word c-h-a-n-g-e-d with "altered" wherever it occurs
  503. X   after the cursor.
  504. X
  505. XThe more customary command for replacing strings is the interactive
  506. Xcommand query-replace-search, which has several options. In essence, it
  507. Xshows each occurance of the first string and asks you if you want to
  508. Xreplace it or not. You can also choose to edit around the string, or go
  509. Xon and replace all occurances without asking further. It is described in
  510. Xdetail in the EMACS manual.  Also, typing a '?' when it asks you if you
  511. Xwish to replace will list out the various options.
  512. X
  513. X
  514. XMODE LINE
  515. X---------
  516. X
  517. XThe bottom line of the screen is known as the communications line.  This
  518. Xis where EMACS interactively communicates with you.  You have already
  519. Xseen how emacs prompts you for information (like when searching).  EMACS
  520. Xcan also report things to you as well.
  521. X
  522. X>> Type ^X = and see what you get in the communications line.
  523. X
  524. XThe line immediately above the communications line is called the MODE
  525. XLINE. The mode line says something like
  526. X
  527. X    =* MicroEMACS 3.1 (NORMAL) == emacs.tut == File: emacs.tut ==========
  528. X
  529. XThis is a very useful "information" line.
  530. X
  531. XThe star means that you have made changes to the text.  Right after
  532. Xyou visit or save a file, there is no star.
  533. X
  534. XThe buffername is the name EMACS gave to the buffer, and it is usually
  535. Xrelated to the filename. You already know what the filename means -- it
  536. Xis the file you have edited.
  537. X
  538. XThe part of the mode line inside the parentheses is to tell you what
  539. Xmodes you are in. The default mode is NORMAL which is what you are in
  540. Xnow. It is an example of a "major mode". There are several major modes
  541. Xin EMACS for editing different languages and text, such as C mode, Text
  542. Xmode, etc. At any time one and only one major mode is active, and its
  543. Xname can always be found in the mode line just where "NORMAL" is now.
  544. X
  545. XEach major mode makes a few commands behave differently. For example,
  546. Xthere are commands for creating comments in a program, and since each
  547. Xprogramming language has a different idea of what a should look like,
  548. Xeach major mode has to insert comments differently. Each major mode is
  549. Xcontrolled by a EMACS variable which can be manipulated and queried with
  550. Xthe "set" and "print" extended commands.
  551. X
  552. XMajor modes are called major because there are also minor modes. They
  553. Xare called minor because they aren't alternatives to the major modes,
  554. Xjust minor modifications of them. Each minor mode can be turned on or
  555. Xoff by itself, regardless of what major mode you are in, and regardless
  556. Xof the other minor modes. So you can use no minor modes, or one minor
  557. Xmode, or any combination of several minor modes.
  558. X
  559. XOne minor mode which is very useful, especially for editing English
  560. Xtext, is WRAP mode. When this mode is on, EMACS breaks the line in
  561. Xbetween words automatically whenever the line gets too long. You can
  562. Xturn this mode on by doing ^X M wrap <return>. When the mode is on, you
  563. Xcan turn it off by doing ^X ^M wrap <Return>.
  564. X
  565. X>> Type "^X ^M wrap <Return>" now.  Then insert a line of "asdf " over 
  566. X   again until you see it divide into two lines.  You must put in spaces 
  567. X   between them because Auto Fill breaks lines only at spaces.  Note that 
  568. X   "WRAP" appears in the mode line, indicating that you are in WRAP mode.
  569. X
  570. XThe margin is usually set at 72 characters, but it can be shanged.  
  571. XSimply type ESC nn ^X F, where "nn" is the column number for the right 
  572. Xhand margin.  
  573. X
  574. X
  575. XSEARCHING
  576. X---------
  577. X
  578. XEMACS can do searches for strings (these are groups of contiguous
  579. Xcharacters or words) either forward through the file or backward
  580. Xthrough it.  
  581. X
  582. X>> Now type ^S to start a search.  Type the word 'cursor', then ESCAPE.
  583. X
  584. X>> Type ^S ESCAPE to find the next occurrence of "cursor".
  585. X
  586. XThe ^S starts a search that looks for any occurrence of the search
  587. Xstring AFTER the current cursor position.  But what if you want to
  588. Xsearch for something earlier in the text?  To do this one should
  589. Xtype ^R for Reverse search.  Everything that applies to ^S applies
  590. Xto ^R except that the direction of the search is reversed.
  591. X
  592. X
  593. XGETTING MORE HELP
  594. X-----------------
  595. X
  596. XIn this tutorial we have tried to supply just enough information to
  597. Xget you started using EMACS.  There is so much available in EMACS that
  598. Xit would be impossible to explain it all here.  However, you may want
  599. Xto learn more about EMACS since it has numerous desirable features
  600. Xthat you don't know about yet.
  601. X
  602. X###   The on-line help features have not been implimented yet.  DLH   ###
  603. X
  604. XThe most basic HELP feature is the describe-key function which is
  605. Xavailable by typing ^X ? and then a command character. EMACS prints one
  606. Xline line on the bottom of the screen tell what function is bound to
  607. Xthat key.
  608. X
  609. XThe describe-command function ESC-? will prompt for the name of a function
  610. Xand print out the section from the manual about that command. When you
  611. Xare finished reading it, type a Space or a ^G (quit) to bring your text
  612. Xback on the screen.
  613. X
  614. X>> Type ^X ? Control-P.  The message at the bottom of the screen should
  615. X   be something like "^P is bound to previous-line".
  616. X
  617. XMulti-character commands such as ^X ^Z and <ESC>V are also allowed
  618. Xafter ^X ?.
  619. X
  620. XNow lets get more information about the previous-line command.
  621. X
  622. X>> Type ESC-? previous-line.  When you are finished reading the
  623. X   output, type a Space.
  624. X
  625. XThe "name of the function" is important for people who are customizing
  626. XEMACS.  It is what appears in the EMACS CHART as the documentation for
  627. Xthe command character.
  628. X
  629. X
  630. XCONCLUSION
  631. X----------
  632. X
  633. XRemember, to exit use ^X ^C.
  634. X
  635. XThis tutorial is meant to be understandable to all new users, so if
  636. Xyou found something unclear, don't sit and blame yourself - complain!
  637. X
  638. XYou'll probably find that if you use EMACS for a few days you won't
  639. Xbe able to give it up.  Initially it may give you trouble.  But remember
  640. Xthat this is the case with any editor, especially one that can do many,
  641. Xmany things.  And EMACS can do practically everything.
  642. X
  643. X
  644. XAcknowledgements
  645. X----------------
  646. X
  647. XThis is a modified version of the "JOVE Tutorial" by Jonathan Payne 
  648. X(19 January 86). That document was in turn a modified version of the
  649. Xtutorial "Teach-Emacs" from MIT as modified by Steve Zimmerman at
  650. XCCA-UNIX (31 October 85).
  651. X
  652. XThis document was last updated on 2-7-86 by Dana Hoggatt.
  653. X
  654. FRIDAY_NIGHT
  655. echo extracting - emacs2.mss
  656. sed 's/^X//' > emacs2.mss << 'FRIDAY_NIGHT'
  657. X
  658. X@style(indent 8 chars, spacing 1 lines)
  659. X@begin(center)
  660. X@b(MicroEMACS 3.7)
  661. X
  662. X@i(Screen Editor)
  663. Xwritten by Dave Conroy
  664. Xand Daniel Lawrence
  665. X@end(center)
  666. X
  667. X
  668. X@begin(quotation)
  669. X    This software is in the public domain and may be freely copied
  670. Xand used by one and all. We would ask that if it is incorporated into
  671. Xother software that proper credit be given to its authors.
  672. X@end(quotation)
  673. X
  674. X@flushleft(@b[Introduction])
  675. X
  676. X    MicroEMACS 3.7 is a screen editor for programming and word
  677. Xprocessing.  It is availible for the IBM-PC and its clones, UNIX V7,
  678. XUNIX BSD4.2, UNIX V5, VMS, the HP150, the Wang-PC and the Commodore
  679. XAMIGA.  It requires between 40 to 70K of space to run on these machines. 
  680. XSome of its capabilities include:
  681. X
  682. X@begin(verbatim)
  683. X    Multiple windows on screen at one time
  684. X
  685. X    Multiple files in the editor at once
  686. X
  687. X    Limited on screen formating of text
  688. X
  689. X    User changable command set
  690. X
  691. X    User written editing macroes
  692. X
  693. X    Compatability across all supported environments
  694. X@end(verbatim)
  695. X
  696. X    This manual is designed as a reference manual. All the commands
  697. Xin MicroEMACS are listed, in functional groups, along with detailed
  698. Xdescriptions of what each commands does.
  699. X@newpage
  700. X@flushleft(@b[How to Start])
  701. X
  702. X    MicroEMACS is invoked from the operating system command level
  703. Xwith a command of the form:
  704. X
  705. X@begin(verbatim)
  706. X    emacs {options} <filelist>
  707. X
  708. Xwhere options may be:
  709. X
  710. X-v        all the following files are in view mode (read only)
  711. X-e        all the following files can be edited
  712. X-g<n>        go directly to line <n> of the first file
  713. X-s<string>    go to the end of the first occurance of <string>
  714. X        in the first file
  715. X
  716. X@@<sfile>    execute macro file <sfile> instead of the
  717. X        standard startup file
  718. X
  719. Xand <filelist> is a list of files to be edited.
  720. X
  721. Xfor example:
  722. X
  723. X    emacs @@start1.cmd -g56 test.c -v head.h def.h
  724. X
  725. X@end(verbatim)
  726. X
  727. X    means to first execute macro file start1.cmd instead of the
  728. Xstandard startup file, emacs.rc and then read in test.c, position the
  729. Xcursor to line 56, and be ready to read in files head.h and def.h in
  730. Xview (read-only) mode.  In the simple case, MicroEMACS is usually run by
  731. Xtyping:
  732. X
  733. X@flushleft(    emacs <file>)
  734. X
  735. X    where <file> is the name of the file to be edited.
  736. X@newpage
  737. X@flushleft(@b[How to type in commands])
  738. X
  739. X    Most commands in MicroEMACS are a single keystroke, or a
  740. Xkeystroke preceded by a command prefix.  Control commands appear in the
  741. Xdocumentation like ^A which means to depress the <Ctrl> key and while
  742. Xholding down it down, type the A character.  Meta-commands appear as
  743. XM-A which means to strike the Meta key (<ESC> on most computers) and
  744. Xthen after realeasing it, type the A character.  Control-X commands
  745. Xusually appear as ^X-A which means to hold down the control key and type
  746. Xthe X character then type the A character.  Both meta commands and
  747. Xcontrol-x commands can be control characters as well, for example,
  748. X^X-^O (the delete-blank-lines command) means to hold down <Ctrl>, type
  749. XX, keep holding down <Ctrl> and type the O character.
  750. X
  751. X    Many commands in MicroEMACS can be executed a number of times.
  752. XIn order to make one command repeat many times, type Meta (<ESC>)
  753. Xfollowed by a number, and then the command. for example:
  754. X
  755. X@verbatim(    M 12 ^K)
  756. X
  757. X    will delete 12 lines starting at the cursor and going down. 
  758. XSometimes, the repeat count is used as an argument to the command as in
  759. Xthe set-tab command where the repeat count is used to set the spacing of
  760. Xthe tab stops. 
  761. X
  762. X@flushleft(@b[The Command List])
  763. X
  764. X    The following is a list of all the commands in MicroEMACS. 
  765. XListed is the command name, the default (normal) keystrokes used to
  766. Xinvoke it, and alternative keys for the IBM-PC, and a description of
  767. Xwhat the command does.
  768. X
  769. X@begin(verbatim)
  770. X@b[(1) MOVING THE CURSOR]
  771. X
  772. X@i(previous-page)    ^Z    <Pg Up>
  773. X
  774. X    Move one screen towards the begining of the file.
  775. X
  776. X@i(next-page)        ^V    <Pg Dn>
  777. X
  778. X    Move one screen towards the end of the file.
  779. X
  780. X@i(begining-of-file)    M-<    <Home>
  781. X
  782. X    Place the cursor at the begining of the file.
  783. X
  784. X@i(end-of-file)        M->    <End>
  785. X
  786. X    Place the cursor at the end of the file.
  787. X
  788. X@i(forward-character)    ^F    (6 on the keypad)
  789. X
  790. X    Move the cursor one character to the right.  Go down to
  791. Xthe begining of the next line if the cursor was already at the
  792. Xend of the current line. 
  793. X
  794. X@i(backward-character)    ^B    (4 on the keypad)
  795. X
  796. X    Move the cursor one character to the left.  Go to the
  797. Xend of the previous line if the cursor was at the begining of
  798. Xthe current line. 
  799. X
  800. X@i(next-word)        M-F    (^6 on the keypad)
  801. X
  802. X    Place the cursor at the begining of the next word.
  803. X
  804. X@i(previous-word)    M-B    (^4 on the keypad)
  805. X
  806. X    Place the cursor at the begining of the previous word.
  807. X
  808. X@i(begining-of-line)    ^A
  809. X
  810. X    Move cursor to the begining of the current line.
  811. X
  812. X@i(end-of-line)        ^E
  813. X
  814. X    Move the cursor to the end of the current line.
  815. X
  816. X@i(next-line)        ^N    (2 on the keypad)
  817. X
  818. X    Move the cursor down one line.
  819. X
  820. X@i(previous-line)    ^P    (8 on the keypad)
  821. X
  822. X    Move the cursor up one line.
  823. X
  824. X@i(goto-line)        M-G
  825. X
  826. X    Goto a specific line in the file. IE    M 65 M-G    would
  827. Xput the cursor on the 65th line of the current buffer.
  828. X
  829. X@i(next-paragraph)    M-N
  830. X
  831. X    Put the cursor at the first end of paragraph after the cursor.
  832. X
  833. X@i(previous-paragraph)    M-P
  834. X
  835. X    Put the cursor at the first begining of paragraph before the
  836. Xcursor.
  837. X
  838. X@b[(2) DELETING & INSERTING]
  839. X
  840. X@i(delete-previous-character)    ^H    <--
  841. X
  842. X    Delete the character immedietly to the left of the
  843. Xcursor.  If the cursor is at the begining of a line, this will
  844. Xjoin the current line on the end of the previous one. 
  845. X
  846. X@i(delete-next-character)    ^D    <Del>
  847. X
  848. X    Delete the character the cursor is on.  If the cursor is
  849. Xat the end of a line, the next line is put at the end of the
  850. Xcurrent one. 
  851. X
  852. X@i(delete-previous word)    M-^H    M- <--
  853. X
  854. X    Delete the word before the cursor.
  855. X
  856. X@i(delete-next-word)        M-^D
  857. X
  858. X    Delete the word starting at the cursor.
  859. X
  860. X@i(kill-to-end-of-line)
  861. X
  862. X    When used with no argument, this command deletes all
  863. Xtext from the cursor to the end of a line.  When used on a blank
  864. Xline, it deletes the blank line.  When used with an argument, it
  865. Xdeletes the specified number of lines. 
  866. X
  867. X@i(insert-space)    ^C    <Ins>
  868. X
  869. X    Insert a space before the character the cursor is on.
  870. X
  871. X@i(newline)        <return>
  872. X
  873. X    Insert a newline into the text, move the cursor down to the
  874. Xbegining of the next physical line, carrying any text that was after
  875. Xit with it.
  876. X
  877. X@i(newline-and-indent)    ^J
  878. X
  879. X    Insert a newline into the text, and indent the new line the
  880. Xsame as the previous line.
  881. X
  882. X@i(handle-tab)        ^I    -->
  883. X
  884. X    With no argument, move the cursor to the begining of the
  885. Xnext tab stop.  With an argument of zero, use real tab
  886. Xcharacters when tabbing.  With a non-zero argument, use spaces
  887. Xto tab every argument positions. 
  888. X
  889. X@i(delete-blank-lines)    ^X-^O
  890. X
  891. X    Delete all the blank lines before and after the current cursor
  892. Xposition.
  893. X
  894. X@i(kill-paragraph)    M-^W
  895. X
  896. X    Delete the paragraph that the cursor is currently in.
  897. X
  898. X@i(kill-region)        ^W
  899. X
  900. X    Delete all the characters from the cursor to the mark set with
  901. Xthe set-mark command.
  902. X
  903. X@i(copy-region)
  904. X
  905. X    Copy all the characters between the cursor and the mark
  906. Xset with the set-mark command into the kill buffer (so they can
  907. Xlater be yanked elsewhere). 
  908. X
  909. X@i(open-line)        ^O
  910. X
  911. X    Insert a newline at the cursor, but do not move the cursor.
  912. X
  913. X@b[(3) SEARCHING]
  914. X
  915. X@i(search-forward)    ^S
  916. X
  917. X    Seearch for a string from the current cursor position to
  918. Xthe end of the file.  The string is typed on on the bottom line of
  919. Xthe screen, and terminated with the <ESC> key. Special characters
  920. Xcan be typed in by preceeding them with a ^Q. A single ^Q
  921. Xindicates a null string.  On successive searches, hitting <ESC>
  922. Xalone causes the last search string to be reused.
  923. X
  924. X@i(search-reverse)    ^R
  925. X
  926. X    This command searches backwards in the file. In all other ways
  927. Xit is like search-forward.
  928. X
  929. X@i(incremental-search)    ^X-S
  930. X
  931. X    This command is similar to forward-search, but it processes the
  932. Xsearch as each character of the input string is typed in. This allows
  933. Xthe user to only use as many keystrokes as are needed to uniquely
  934. Xspecify the string being searched. Several control characters are active
  935. Xwhile isearching:
  936. X
  937. X    ^S or ^X    Skip to the next occurence of the current string
  938. X    ^R        skip to the last occurence of the current string
  939. X    ^H        back up to the last match (posibly deleting
  940. X            the last character on the search string)
  941. X    ^G        abort the search, return to start
  942. X    <ESC>        end the search, stay here
  943. X
  944. X@i(reverse-incremental-search)    ^X-R
  945. X
  946. X    This command is the same as incremental-search, but it starts in
  947. Xthe reverse direction.
  948. X
  949. X@i(hunt-forward)    unbound        (<ALT>S on the IBM PC)
  950. X
  951. X    This command repeats the last search with the last search string
  952. X
  953. X@i(hunt-backward)    unbound        (<ALT>R on the IBM PC)
  954. X
  955. X    THe last search string is looked for starting at the cursor and
  956. Xgoing backwards.
  957. X
  958. X@b[(4) REPLACING]
  959. X
  960. X@i(replace-string)    M-R
  961. X
  962. X    This command allows you to replace all occurences of one string
  963. Xwith another string. The replacement starts at the current location of
  964. Xthe cursor and goes to the end of the current buffer. A numeric argument
  965. Xwill limit the number of strings replaced.
  966. X
  967. X@i(query-replace-string)    M-^R
  968. X
  969. X    Like the replace-string command, this command will replace one
  970. Xstring with another. However, it allows you to step through each string
  971. Xand ask you if you wish to make the replacement. When the computer asks
  972. Xif you wish to make the replacement, the following answers are allowed:
  973. X
  974. X    Y    Make the replacement and continue on to the next string
  975. X    N    Don't make the replacement, then continue
  976. X    !    Replace the rest of the strings without asking
  977. X    ^G    Stop the command
  978. X    .    Go back to place the command started
  979. X    ?    get a list of options
  980. X
  981. X
  982. X@b[(5) CAPITALIZING & TRANSPOSING]
  983. X
  984. X@i(case-word-upper)    M-U
  985. X
  986. X    Change the following word into upper case.
  987. X
  988. X@i(case-word-capitalize)    M-C
  989. X
  990. X    Capitolize the following word.
  991. X
  992. X@i(case-word-lower)    M-L
  993. X
  994. X    Change the following word to lower case.
  995. X
  996. X@i(case-region-upper)    ^X-^U
  997. X
  998. X    Change all the alphabetic characters in a marked region to upper
  999. Xcase.
  1000. X
  1001. X@i(case-region-lower)    ^X-^L
  1002. X
  1003. X    Change all the alphabetic characters in a marked region to lower
  1004. Xcase.
  1005. X
  1006. X@i(transpose-characters)    ^T
  1007. X
  1008. X    Swap the last and second last characters behind the cursor.
  1009. X
  1010. X@i(quote-character)    ^Q
  1011. X
  1012. X    Insert the next typed character, ignoring the fact that it may
  1013. Xbe a command character.
  1014. X
  1015. X@b[(6) REGIONS & THE KILL BUFFER]
  1016. X
  1017. X@i(set-mark)    M-<SPACE>
  1018. X
  1019. X    This command is used to delimit the begining of a marked region. 
  1020. XMany commands are effective for a region of text.  A region is defined
  1021. Xas the text between the mark and the current cursor position.  To delete
  1022. Xa section of text, for example, one moves the cursor to the begining of
  1023. Xthe text to be deleted, issues the set-mark command by typing M-<SPACE>,
  1024. Xmoves the cursor to the end of the text to be deleted, and then deletes
  1025. Xit by using the kill-region (^W) command.  Only one mark can be set in
  1026. Xone window or one buffer at a time, and MicroEMACS will try to remember
  1027. Xa mark set in an offscreen buffer when it is called back on screen. 
  1028. X
  1029. X@i(exchange-point-and-mark)    ^X-^X
  1030. X
  1031. X    This command moves the cursor to the current marked position in
  1032. Xthe current window and moves the mark to where the cursor was.  This is
  1033. Xvery usefull in finding where a mark was, or in returning to a position
  1034. Xpreviously marked.
  1035. X
  1036. X@b[(7) COPYING AND MOVING]
  1037. X
  1038. X@i(kill-region)        ^W
  1039. X
  1040. X    This command is used to copy the current region (as defined by
  1041. Xthe current mark and the cursor) into the kill buffer.
  1042. X
  1043. X@i(yank)        ^Y
  1044. X
  1045. X    This copies the contents of the kill buffer into the text at the
  1046. Xcurrent cursor position.  This does not clear the kill buffer, and thus
  1047. Xmay be used to make multiple copies of a section of text.
  1048. X
  1049. X@i(copy-region)        M-W
  1050. X
  1051. X    This command copies the contents of the current region into the
  1052. Xkill buffer without deleting it from the current buffer.
  1053. X
  1054. X@b(8) MODES OF OPERATION]
  1055. X
  1056. X@i(add-mode)        ^X-M
  1057. X
  1058. X    Add a mode to the current buffer
  1059. X
  1060. X@i(delete-mode)        ^X-^M
  1061. X
  1062. X    Delete a mode from the current buffer
  1063. X
  1064. X@i(add-global-mode)    M-M
  1065. X
  1066. X    Add a mode to the global modes which get inherited by any new
  1067. Xbuffers that are created while editing.
  1068. X
  1069. X@i(delete-global-mode)    M-^M
  1070. X
  1071. X    Delete a mode from the global mode list.  This mode list is
  1072. Xdisplayed as the first line in the output produced by the list-buffers
  1073. Xcommand.
  1074. X
  1075. X@b(        MODES)
  1076. X
  1077. X    Modes are assigned to all buffers that exist during an editing
  1078. Xsession.  These modes effect the way text is inserted, and the operation
  1079. Xof some commands. Legal modes are:
  1080. X
  1081. X
  1082. X@i(OVER)    Overwrite Mode
  1083. X
  1084. X    In this mode, typed characters replace existing characters
  1085. Xrather than being inserted into existing lines.  Newlines still insert
  1086. Xthemselves, but all other characters will write over existing characters
  1087. Xon the current line being edited.  This mode is very usefull for editing
  1088. Xcharts, figures, and tables.
  1089. X
  1090. X@i(WRAP)    Word Wrap Mode
  1091. X
  1092. X    In this mode, when the cursor crosses the current fill column
  1093. X(which defaults to 72) it will, at the next wordbreak, automatically
  1094. Xinsert a newline, dragging the last word down with it.  This makes
  1095. Xtyping prose much easier since the newline (<RETURN>) only needs to be
  1096. Xused between paragraphs.
  1097. X
  1098. X@i(VIEW)    File Viewing Mode
  1099. X
  1100. X    In this mode, no commands which can change the text are allowed.
  1101. X
  1102. X@i(CMODE)    C Program Editing Mode
  1103. X
  1104. X    This mode is for editing programs written in the 'C' programming
  1105. Xlanguage.  When the newline is used, the editor will attempt to place
  1106. Xthe cursor at the proper indentation level on the next line.  Close
  1107. Xbraces are automatically undented for the user, and also pre-processor
  1108. Xcommands are automatically set flush with the left margin.  When a close
  1109. Xparenthesis or brace is typed, if the matching open is on screen, the
  1110. Xcursor briefly moves to it, and then back. (Typing any key will abort
  1111. Xthis fence matching, executing the next command immediatly)
  1112. X
  1113. X@i(EXACT)    Exact Case Matching on Searching MODE
  1114. X
  1115. X    Normally case is insignificant during the various search
  1116. Xcommands.  This forces all matching to take character case into account.
  1117. X
  1118. X@i(MAGIC)    Regular expresion pattern matching Mode
  1119. X
  1120. X    This feature is not yet implimented.  While it may be set as a
  1121. Xmode, it will have no effect at the moment.  When it is ready, it will
  1122. Xcause all search commands to accept various pattern characters to allow
  1123. Xregular exspression search and replaces.
  1124. X
  1125. X@b[(10) ON-SCREEN FORMATTING]
  1126. X
  1127. X@i(set-fill-column)    ^X-F
  1128. X
  1129. X    Sets the column used by WRAP mode and the fill-paragraph command.
  1130. X
  1131. X@i(handle-tab)        <TAB>
  1132. X
  1133. X    Given a numeric argument, the tab key resets the normal behavior
  1134. Xof the tab key.  An argument of zero causes the tab key to generate
  1135. Xhardware tabs (at each 8 columns).  A non-zero argument will cause the
  1136. Xtab key to generate enough spaces to reach a culumn of a multiple of the
  1137. Xargument given.  This also resets the spacing used while in CMODE.
  1138. X
  1139. X@i(fill-paragraph)    M-Q
  1140. X
  1141. X    This takes all the text in the current paragraph (as defined by
  1142. Xsurrounding blank lines, or a leading indent) and attempt to fill it
  1143. Xfrom the left margin to the current fill column.
  1144. X
  1145. X@i(buffer-position)
  1146. X
  1147. X    This command reports on the current and total lines and
  1148. Xcharacters of the current buffer.  It also gives the hexidecimal code of
  1149. Xthe character currently under the cursor.
  1150. X
  1151. X@b[(11) MULTIPLE WINDOWS]
  1152. X
  1153. X@i(split-current-window)    ^X-2
  1154. X
  1155. X    If possible, this command splits the current window into two
  1156. Xnear equal windows, each displaying the buffer displayed by the original
  1157. Xwindow. A numeric argument of 1 forces the upper window to be the new
  1158. Xcurrent window, and an argument of 2 forces the lower window to be the
  1159. Xnew current window.
  1160. X
  1161. X@i(delete-window)        ^X-0
  1162. X
  1163. X    this command attempts to delete the current window, retrieving
  1164. Xthe lines for use in the window above or below it.
  1165. X
  1166. X@i(delete-other-windows)    ^X-1
  1167. X
  1168. X    All other windows are deleted by this command.  The current
  1169. Xwindow becomes the only window, using the entire availible screen.
  1170. X
  1171. X@i(next-window)        ^X-O
  1172. X
  1173. X    Make the next window down the current window.  With an argument,
  1174. Xthis makes the nth window from the top current.
  1175. X
  1176. X@i(previous-window)    ^X-P
  1177. X
  1178. X    Make the next window up the current window.  With an argument,
  1179. Xthis makes tghe nth window from the bottom the current window.
  1180. X
  1181. X@i(scroll-next-down)    M-^V
  1182. X
  1183. X    Scroll the next window down a page.
  1184. X
  1185. X@i(scroll-next-up)    M-^Z
  1186. X
  1187. X    Scroll the next window up a page.
  1188. X
  1189. X@b[(12) CONTROLLING WINDOWS]
  1190. X
  1191. X@i(grow-window)        ^X-^
  1192. X
  1193. X    Enlarge the current window by the argument number of lines (1 by
  1194. Xdefault).
  1195. X
  1196. X@i(shrink-window)    ^X-^Z
  1197. X
  1198. X    Shrink the current window by the argument number of lines (1 by
  1199. Xdefault).
  1200. X
  1201. X@i(resize-window)    ^X-W
  1202. X
  1203. X    CHnage the size of the current window to the number of lines
  1204. Xspecified by the argument, if possible.
  1205. X
  1206. X@i(move-window-down)    ^X-^N
  1207. X
  1208. X    Move the window into the current buffer down by one line.
  1209. X
  1210. X@i(move-window-up)    ^X-^P
  1211. X
  1212. X    Move the window into the current buffer up by one line.
  1213. X
  1214. X@i(redraw-display)    M-^L
  1215. X
  1216. X    Redraw the current window with the current line in the middle of
  1217. Xthe window, of with an argument, with the current line on the nth line
  1218. Xof the current window.
  1219. X
  1220. X@i(clear-and-redraw)    ^L
  1221. X
  1222. X    Clear the screen and redraw the entire display.  Usefull on
  1223. Xtimesharing systems where messages and other things can garbage the display.
  1224. X
  1225. X@b[(13) MULTIPLE BUFFERS]
  1226. X
  1227. X@i(select-buffer)    ^X-B
  1228. X
  1229. X    Switch to using another buffer in the current window.  MicroEMACS
  1230. Xwill prompt you for the name of the buffer to use.
  1231. X
  1232. X@i(next-buffer)        ^X-X
  1233. X
  1234. X    Switch to using the next buffer in the buffer list in the
  1235. Xcurrent window.
  1236. X
  1237. X@i(name-buffer)        M-^N
  1238. X
  1239. X    Change the name of the current buffer.
  1240. X
  1241. X@i(kill-buffer)        ^X-K
  1242. X
  1243. X    Dispose of an undisplayed buffer in the editor and reclaim the
  1244. Xspace. This does not delete the file the buffer was read from.
  1245. X
  1246. X@i(list-buffers)    ^X-^B
  1247. X
  1248. X    Split the current window and in one half bring up a list of all
  1249. Xthe buffers currently existing in the editor.  The active modes, change
  1250. Xflag, and active flag for each buffer is also displayed.  (The change
  1251. Xflag is an * if the buffer has been changed and not written out.  the
  1252. Xactive flag is not an * if the file had been specified on the command
  1253. Xline, but has not been read in yet since nothing has switched to that
  1254. Xbuffer.)
  1255. X
  1256. X@i[(14) READING FROM DISK]
  1257. X
  1258. X@i(find-file)        ^X-^F
  1259. X
  1260. X    FInd the named file. If it is already in a buffer, make that
  1261. Xbuffer active in the current window, otherwise attemt tocreate a new
  1262. Xbuffer and read the file into it.
  1263. X
  1264. X@i(read-file)        ^X-^R
  1265. X
  1266. X    Read the named file into the current buffer (overwriting the
  1267. Xprevious contents of the current buffer. If the change flag is set, a
  1268. Xconfirmation will be asked).
  1269. X
  1270. X@i(insert-file)        ^X-^I
  1271. X
  1272. X    Insert the named file into the current position of the current
  1273. Xbuffer.
  1274. X
  1275. X@i(view-file)        ^X-^V
  1276. X
  1277. X    Like find-file, this command either finds the file in a buffer,
  1278. Xor creates a new buffer and reads the file in. In addition, this leaves
  1279. Xthat buffer in VIEW mode.
  1280. X
  1281. X@i[(15) SAVING TO DISK]
  1282. X
  1283. X@i(save-file)        ^X-^S
  1284. X
  1285. X    If the contents of the current buffer have been changed, write
  1286. Xit back to the file it was read from.
  1287. X
  1288. X@i(write-file)        ^X-^W
  1289. X
  1290. X    Write the contents of the current file to the named file, this
  1291. Xalso changed the file name associated with the current buffer to the new
  1292. Xfile name.
  1293. X
  1294. X@i(change-file-name)    ^X-N
  1295. X
  1296. X    Change the name associated with the current buffer to the file
  1297. Xname given.
  1298. X
  1299. X@i(quick-exit)        M-Z
  1300. X
  1301. X    Write out all changed buffers to the files they were read from
  1302. Xand exit the editor.
  1303. X
  1304. X@b[(16) ACCESSING THE OPERATING SYSTEM]
  1305. X
  1306. X@i(shell-command)    ^X-!
  1307. X
  1308. X    Send one command to execute to the operating system command
  1309. Xprocessor, or shell.  Upon completion, MicroEMACS will wait for a
  1310. Xkeystroke to redraw the screen. 
  1311. X
  1312. X@i(pipe-command)    ^X-@
  1313. X
  1314. X    Execute one operating system command and pipe the resulting
  1315. Xoutput into a buffer by the name of "command".
  1316. X
  1317. X@i(filter-buffer)    ^X-#
  1318. X
  1319. X    Execute one operating system command, using the contents of the
  1320. Xcurrent buffer as input, and sending the results back to the same
  1321. Xbuffer, replacing the original text.
  1322. X
  1323. X@i(i-shell)        ^X-C
  1324. X
  1325. X    Push up to a new command processor or shell.  Upon exiting the
  1326. Xshell, MicroEMACS will redraw its screen and continue editing.
  1327. X
  1328. X@i(suspend-emacs)    ^X-D        [only under BSD4.2]
  1329. X
  1330. X    This command suspends the editing processor and puts it into the
  1331. Xbackground.  The "fg" command will restart MicroEMACS.
  1332. X
  1333. X@i(exit-emacs)        ^X-^C
  1334. X
  1335. X    Exit MicroEMACS back to the operating system.  If there are any
  1336. Xunwritten, changed buffers, the editor will promt to discard changes.
  1337. X
  1338. X@b[(17) KEY BINDINGS AND COMMANDS]
  1339. X
  1340. X@i(bind-to-key)        M-K
  1341. X
  1342. X    This command takes one of the named commands and binds it to a
  1343. Xkey.  From then on, whenever that key is struck, the bound command is
  1344. Xexecuted.
  1345. X
  1346. X@i(unbind-key)        M-^K
  1347. X
  1348. X    This unbinds a command from a key.
  1349. X
  1350. X@i(describe-key)    ^X-?
  1351. X
  1352. X    This command will allow you to type a key and it will then
  1353. Xreport the name of the command bound to that key.
  1354. X
  1355. X@i(execute-named-command)    M-X
  1356. X
  1357. X    This command will prompt you for the name of a command to
  1358. Xexecute.  Typing <SPACE> part way thought will tell the editor to
  1359. Xattempt to complete the name on its own.  If it then beeps, there is no
  1360. Xsuch command to complete.
  1361. X
  1362. X@i(describe-bindings)        UNBOUND
  1363. X
  1364. X    This command splits the current window, and in one of the
  1365. Xwindows makes a list of all the named commands, and the keys currently
  1366. Xbound to them.
  1367. X
  1368. X@b[(18) COMMAND EXECUTION]
  1369. X
  1370. X    Commands can also be executed as command scripts.  This allows
  1371. Xcomands and their arguments to be stored in files and executed.  The
  1372. Xgeneral form of a command script line is:
  1373. X
  1374. X    <optional repeat count> {command-name} <optional arguments>
  1375. X
  1376. X@i(execute-command-line)    UNBOUND
  1377. X
  1378. X    Execute a typed in script line.
  1379. X
  1380. X@i(execute-buffer)        UNBOUND
  1381. X
  1382. X    Executes script lines in the named buffer.  If the buffer is off
  1383. Xscreen and an error occurs during execution, the cursor will be left on
  1384. Xthe line causing the error.
  1385. X
  1386. X@i(execute-file)        UNBOUND
  1387. X
  1388. X    Executes script lines from a file.  This is the normal way to
  1389. Xexecute a special script.
  1390. X
  1391. X@i(clear-message-line)        UNBOUND
  1392. X
  1393. X    Clears the message line during script execution.  This is
  1394. Xusefull so as not to leave a confusion message from the last commands
  1395. Xin a script.
  1396. X
  1397. X@i(unmark-buffer)        UNBOUND
  1398. X
  1399. X    Remove the change flag from the current buffer.  This is very
  1400. Xusefull in scripts where you are creating help windows, and don't want
  1401. XMicroEMACS to complain about not saving them to a file.
  1402. X
  1403. X@i(insert-string)        UNBOUND
  1404. X
  1405. X    Insert a string into the current buffer.  This allows you to
  1406. Xbuild up text within a buffer without reading it in from a file.  Some
  1407. Xspecial characters are allowd, as follows:
  1408. X
  1409. X    ~n    newline
  1410. X    ~t    tab
  1411. X    ~b    backspace
  1412. X    ~f    formfeed
  1413. X
  1414. X
  1415. X@b[(19) MACRO EXECUTION]
  1416. X
  1417. X    Also availible is one keyboard macro, which allows you to record
  1418. Xa number of commands as they are executed and play them back.
  1419. X
  1420. X@i(begin-macro)        ^X (
  1421. X
  1422. X    Start recording keyboard macro
  1423. X
  1424. X@i(end-macro)        ^X )
  1425. X
  1426. X    Stop recording keyboard macro
  1427. X
  1428. X@i(execute-macro)    ^X E
  1429. X
  1430. X    Execute keyboard macro
  1431. X
  1432. X@i(store-macro)        UNBOUND
  1433. X
  1434. X    This command is used to store script lines in a hiffen buffer by
  1435. Xthe name of "[Macro nn]" where <nn> is a number from 1 to 40 and
  1436. Xcoresponds to the argument given this command.  All script lines then
  1437. Xencountered will be stored in this buffer rather than being executed.  A
  1438. Xscript line consisting of only "[end]" tells the editor that the macro
  1439. Xis complete, and stops recording script lines in the buffer.
  1440. X
  1441. X@i(execute-macro-nn)    UNBOUND        [shift-<F1> thru shift-<F10>]
  1442. X
  1443. X    This is the command to execute a script stored in one of the
  1444. Xhidden macro buffers.  On the IBM-PC the first ten of these are bound to
  1445. Xshift-<F1> thru shift-<F10>.
  1446. X@end(verbatim)
  1447. FRIDAY_NIGHT
  1448. echo es.4 completed!
  1449. : That's all folks!
  1450.  
  1451.