home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / 14 < prev    next >
Internet Message Format  |  1990-07-13  |  50KB

  1. Path: uunet!husc6!necntc!ncoast!allbery
  2. From: nwd@j.cc.purdue.edu (Daniel Lawrence)
  3. Newsgroups: comp.sources.misc
  4. Subject: MicroEmacs 3.9 Manual (3 of 6)
  5. Message-ID: <5816@ncoast.UUCP>
  6. Date: 26 Nov 87 04:15:06 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Lines: 1469
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/8711/14
  11.  
  12. Xall the directories listed in the "@b(PATH)" environment variable.  Then
  13. Xit looks through a list of predefined standard directories which vary
  14. Xfrom system to system.  Finally, failing all of these, it looks in the
  15. Xcurrent directory.  This is also the same method EMACS uses to look up
  16. Xany files to execute, and to find it's help file @b(EMACS.HLP). 
  17. X@index(PATH environment variable) @index(HOME environment variable)
  18. X@index(Help File)
  19. X
  20. X@index(switches)
  21. X    On computers that call up EMACS via a command line process, such
  22. Xas MSDOS and UNIX, there are different things that can be added to the
  23. Xcommand line to control the way EMACS operates. These can be switches,
  24. Xwhich are a dash ('-') followed by a letter, and possible other
  25. Xparameters, or a startup file specifier, which is an at sign '@@'
  26. Xfollowed by a file name.
  27. X
  28. X@begin(description)
  29. X@@<file>@\This causes the named file to be executed instead of the
  30. Xstandard emacs.rc file before emacs reads in any other files.  More than
  31. Xone of these can be placed on the command line, and they will be
  32. Xexecuted in the order that they appear. 
  33. X
  34. X-A@\This flag causes emacs to automatically run the startup file
  35. X"error.cmd" instead of emacs.rc. This is used by various C compilers for
  36. Xerror processing (for example, Mark Williams C). @index(error parsing)
  37. X
  38. X-E@\The following source files on the command line can be edited (as
  39. Xopposed to being in VIEW mode). This is mainly used to cancel the
  40. Xeffects of the -v switch used previously in the same command line.
  41. X
  42. X-G<num>@\Upon entering EMACS, position the cursor at the <num> line of
  43. Xthe first file.
  44. X
  45. X-K<key>@\This key tells emacs to place the source files in CRYPT
  46. X@index(CRYPT mode) mode and read it in using <key> as the encryption
  47. Xkey.  If no key is listed immediatly after the -K switch, EMACS will
  48. Xprompt for a key, and not echo it as it is typed. 
  49. X
  50. X-R@\This places EMACS in "restricted mode"@index(restricted mode)
  51. X@index(BBS) where any commands allowing the user to read or write any
  52. Xfiles other than the ones listed on the command line are disabled. Also
  53. Xall commands allowing the user access to the operating system are
  54. Xdisabled. This makes EMACS very useful as a "safe" environment for use
  55. Xwithin other applications and especially used as a remote editor for a
  56. XBBS or electronic bulletin board system.
  57. X
  58. X-S<string>@\After EMACS is started, it automatically searches for
  59. X<string> in the first source file.
  60. X
  61. X-V@\This tells EMACS that all the following sources files on the command
  62. Xline should be in VIEW mode to prevent any changes being made to them.
  63. X@end(description)
  64. X@appendix(MicroEMACS commands)
  65. X
  66. X    Below is a complete list of the commands in EMACS, the keys
  67. Xnormally used to do the command, and what the command does.  Remember,
  68. Xon some computers there may also be additional ways of using a command
  69. X(cursor keys and special function keys for example). 
  70. X
  71. X@begin(verbatim)
  72. X@u(Command            Binding        Meaning)
  73. Xabort-command         ^G    This allows the user to abort out of any
  74. X                command that is waiting for input
  75. X
  76. Xadd-mode         ^X-M    Add a mode to the current buffer
  77. X
  78. Xadd-global-mode      M-M    Add a global mode for all new buffers
  79. X
  80. Xapropos          M-A    List out commands whose name contains
  81. X                the string specified
  82. X
  83. Xbackward-character     ^B    Move one character to the left
  84. X
  85. Xbegin-macro         ^X-(    Begin recording a keyboard macro
  86. X
  87. Xbeginning-of-file     M-<    Move to the beginning of the file in
  88. X                the current buffer
  89. X
  90. Xbeginning-of-line     ^A    Move to the beginning of the current line
  91. X
  92. Xbind-to-key         M-K    Bind a key to a function
  93. X
  94. Xbuffer-position      ^X-=    List the position of the cursor in the
  95. X                current window on the command line
  96. X
  97. Xcase-region-lower     ^X-^L    Make a marked region all lower case
  98. X
  99. Xcase-region-upper     ^X-^U    Make a marked region all upper case
  100. X
  101. Xcase-word-capitalize     M-C    Capitalize the following word
  102. X
  103. Xcase-word-lower      M-L    Lower case the following word
  104. X
  105. Xcase-word-upper      M-U    Upper case the following word
  106. X
  107. Xchange-file-name     ^X-N    Change the name of the file in the
  108. X                current buffer
  109. X
  110. Xchange-screen-size     M-^S    Change the number of lines of the screen
  111. X                currently being used
  112. X
  113. Xchange-screen-width     M-^T    Change the number of columns of the
  114. X                screen currently being used
  115. X
  116. Xclear-and-redraw     ^L    Clear the physical screen and redraw it
  117. X
  118. Xclear-message-line    (none)    Clear the command line
  119. X
  120. Xcopy-region         M-W    Copy the currently marked region into
  121. X                the kill buffer
  122. X
  123. Xcount-words         M-^C    Count how many words, lines and
  124. X                characters are in the current marked region
  125. X
  126. Xctlx-prefix         ^X    Change the key used as the ^X prefix
  127. X
  128. Xdelete-blank-lines     ^X-^O    Delete all blank lines around the cursor
  129. X
  130. Xdelete-buffer         ^X-K    Delete a buffer which is not being
  131. X                currently displayed in a window
  132. X
  133. Xdelete-mode         ^X-^M    Turn off a mode in the current buffer
  134. X
  135. Xdelete-global-mode     M-^M    Turn off a global mode
  136. X
  137. Xdelete-next-character     ^D    Delete the character following the cursor
  138. X
  139. Xdelete-next-word     M-D    Delete the word following the cursor
  140. X
  141. Xdelete-other-windows     ^X-1    Make the current window cover the entire
  142. X                screen
  143. X
  144. Xdelete-previous-character^H    Delete the character to the left of the
  145. X                cursor
  146. X
  147. Xdelete-previous-word     M-^H    Delete the word to the left of the cursor
  148. X
  149. Xdelete-window         ^X-0    Remove the current window from the screen
  150. X
  151. Xdescribe-bindings    (none)    Make a list of all legal commands
  152. X
  153. Xdescribe-key         ^X-?    Describe what command is bound to a
  154. X                keystroke sequence
  155. X
  156. Xdetab-line         ^X-^D    Change all tabs in a line to the
  157. X                equivelant spaces
  158. X
  159. Xend-macro         ^X-)    stop recording a keyboard macro
  160. X
  161. Xend-of-file         M->    Move cursor to the end of the current buffer
  162. X
  163. Xend-of-line         ^E    Move to the end of the current line
  164. X
  165. Xentab-line         ^X-^E    Change multiple spaces to tabs where
  166. X                possible
  167. X
  168. Xexchange-point-and-mark  ^X-^X    Move cursor to the last marked spot,
  169. X                make the original position be marked
  170. X
  171. Xexecute-buffer        (none)    Execute a buffer as a macro
  172. X
  173. Xexecute-command-line    (none)    Execute a line typed on the command
  174. X                line as a macro command
  175. X
  176. Xexecute-file         FNB    Execute a file as a macro
  177. X
  178. Xexecute-macro         ^X-E    Execute the keyboard macro (play back
  179. X                the recorded keystrokes)
  180. Xexecute-macro-<n>    (none)    Execute numbered macro <N> where <N> is
  181. X                an integer from 1 to 40
  182. X
  183. Xexecute-named-command     M-X    Execute a command by name
  184. X
  185. Xexecute-procedure     M-^E    Execute a procedure by name
  186. X
  187. Xexecute-program        ^X-$    Execute a program directly (not through
  188. X                an intervening shell)
  189. X
  190. Xexit-emacs         ^X-^C    Exit EMACS. If there are unwritten,
  191. X                changed buffers EMACS will ask to confirm
  192. X
  193. Xfill-paragraph         M-Q    Fill the current paragraph
  194. X
  195. Xfilter-buffer         ^X-#    Filter the current buffer through an
  196. X                external filter
  197. X
  198. Xfind-file         ^X-^F    Find a file to edit in the current window
  199. X
  200. Xforward-character     ^F    Move cursor one character to the right
  201. X
  202. Xgoto-line         M-G    Goto a numbered line
  203. X
  204. Xgoto-matching-fence     M-^F    Goto the matching fence
  205. X
  206. Xgrow-window         ^X-^    Make the current window larger
  207. X
  208. Xhandle-tab         ^I    Insert a tab or set tab stops
  209. X
  210. Xhunt-forward         FN=    Hunt for the next match of the last
  211. X                search string
  212. X
  213. Xhunt-backward         FN>    Hunt for the last match of the last
  214. X                search string
  215. X
  216. Xhelp             M-?    Read EMACS.HLP into a buffer and display it
  217. X
  218. Xi-shell          ^X-C    Shell up to a new command processor
  219. X
  220. Xincremental-search     ^X-S    Search for a string, incrementally
  221. X
  222. Xinsert-file         ^X-^I    insert a file at the cursor in the
  223. X                current file
  224. X
  225. Xinsert-space         ^C    Insert a space to the right of the cursor
  226. X
  227. Xinsert-string        (none)    Insert a string at the cursor
  228. X
  229. Xkill-paragraph         M-^W    Delete the current paragraph
  230. X
  231. Xkill-region         ^W    Delete the current marked region, moving
  232. X                it to the kill buffer
  233. X
  234. Xkill-to-end-of-line     ^K    Delete the rest of the current line
  235. X
  236. Xlist-buffers         ^X-^B    List all existing buffers
  237. X
  238. Xmeta-prefix         <ESC>    Key used to precede all META commands
  239. X
  240. Xmove-window-down     ^X-^N    Move all the lines in the current window down
  241. X
  242. Xmove-window-up         ^X-^P    Move all the lines in the current window up
  243. X
  244. Xname-buffer         M-^N    Change the name of the current buffer
  245. X
  246. Xnewline          ^M    Insert a <NL> at the cursor
  247. X
  248. Xnewline-and-indent     ^J    Insert a <NL> at the cursor and indent
  249. X                the new line the same as the preceeding line
  250. X
  251. Xnext-buffer         ^X-X    Bring the next buffer in the list into
  252. X                the current window
  253. X
  254. Xnext-line         ^N    Move the cursor down one line
  255. X
  256. Xnext-page         ^V    Move the cursor down one page
  257. X
  258. Xnext-paragraph         M-N    Move cursor to the next paragraph
  259. X
  260. Xnext-window         ^X-O    Move cursor to the next window
  261. X
  262. Xnext-word         M-F    Move cursor to the beginning of the
  263. X                next word
  264. X
  265. Xnop             M-FNC    Does nothing
  266. X
  267. Xopen-line         ^O    Open a line at the cursor
  268. X
  269. Xoverwrite-string    (none)    Overwrite a string at the cursor
  270. X
  271. Xpipe-command         ^X-@@    Execute an external command and place
  272. X                its output in a buffer
  273. X
  274. Xprevious-line         ^P    Move cursor up one line
  275. X
  276. Xprevious-page         ^Z    Move cursor up one page
  277. X
  278. Xprevious-paragraph     M-P    Move back one paragraph
  279. X
  280. Xprevious-window      ^X-P    Move the cursor to the last window
  281. X
  282. Xprevious-word         M-B    Move the cursor to the beginning of the
  283. X                word to the left of the cursor
  284. X
  285. Xquery-replace-string     M-^R    Replace all of one string with another
  286. X                string, interactively querying the user
  287. X
  288. Xquick-exit         M-Z    Exit EMACS, writing out all changed buffers
  289. X
  290. Xquote-character      ^Q    Insert the next character literally
  291. X
  292. Xread-file         ^X-^R    Read a file into the current buffer
  293. X
  294. Xredraw-display         M-^L    Redraw the display, centering the
  295. X                current line
  296. X
  297. Xresize-window         ^X-W    Change the number of lines in the
  298. X                current window
  299. X
  300. Xrestore-window        (none)    Move cursor to the last saved window
  301. X
  302. Xreplace-string         M-R    Replace all occurences of one string
  303. X                with another string from the cursor
  304. X                to the end of the buffer
  305. X
  306. Xreverse-incremental-search^X-R    Search backwards, incrementally
  307. X
  308. Xrun             M-^E    Execute a named procedure
  309. X
  310. Xsave-file         ^X-^S    Save the current buffer if it is changed
  311. X
  312. Xsave-window        (none)    Remember current window (to restore later)
  313. X
  314. Xscroll-next-up         M-^Z    Scroll the next window up
  315. X
  316. Xscroll-next-down     M-^V    Scroll the next window down
  317. X
  318. Xsearch-forward         ^S    Search for a string
  319. X
  320. Xsearch-reverse         ^R    Search backwards for a string
  321. X
  322. Xselect-buffer         ^X-B    Select a buffer to display in the
  323. X                current window
  324. X
  325. Xset             ^X-A    Set a variable to a value
  326. X
  327. Xset-encryption-key     M-E    Set the encryption key of the current buffer
  328. X
  329. Xset-fill-column      ^X-F    Set the current fill column
  330. X
  331. Xset-mark            Set the mark
  332. X
  333. Xshell-command         ^X-!    Causes an external shell to execute
  334. X                a command
  335. X
  336. Xshrink-window         ^X-^Z    Make the current window smaller
  337. X
  338. Xsplit-current-window     ^X-2    Split the current window in two
  339. X
  340. Xstore-macro        (none)    Store the following macro lines to a
  341. X                numbered macro
  342. X
  343. Xstore-procedure        (none)    Store the following macro lines to a
  344. X                named procedure
  345. X
  346. Xtranspose-characters     ^T    Transpose the character at the cursor
  347. X                with the character to the left
  348. X
  349. Xtrim-line         ^X-^T    Trim any trailing whitespace from line
  350. X
  351. Xunbind-key         M-^K    Unbind a key from a function
  352. X
  353. Xuniversal-argument     ^U    Execute the following command 4 times
  354. X
  355. Xunmark-buffer         M-~    Unmark the current buffer (so it is
  356. X                no longer changed)
  357. X
  358. Xupdate-screen        (none)    Force a screen update during macro execution
  359. Xview-file         ^X-^V    Find a file,and put it in view mode
  360. Xwrap-word         M-FNW    Wrap the current word, this is an
  361. X                internal function
  362. X     
  363. Xwrite-file         ^X-^W    Write the current buffer under a new
  364. X                file name
  365. X
  366. Xwrite-message        (none)    Display a string on the command line
  367. X
  368. Xyank             ^Y    yank the kill buffer into the current
  369. X                buffer at the cursor
  370. X@end(verbatim)
  371. X@appendix(MicroEMACS Bindings)
  372. X
  373. X    Below is a complete list of the key bindings used in MicroEMACS.
  374. XThis can be used as a wall chart reference for MicroEMACS commands.
  375. X
  376. X@begin(verbatim)
  377. X@center(@b[Default Key Bindings for MicroEmacs 3.9e])
  378. X
  379. X ^A   Move to start of line          ESC A   Apropos (list some commands)
  380. X ^B   Move backward by characters     ESC B   Backup by words
  381. X ^C   Insert space              ESC C   Initial capitalize word
  382. X ^D   Forward delete              ESC D   Delete forward word
  383. X ^E   Goto end of line              ESC E   Reset Encryption Key
  384. X ^F   Move forward by characters      ESC F   Advance by words
  385. X ^G   Abort out of things          ESC G   Go to a line
  386. X ^H   Backward delete              
  387. X ^I   Insert tab/Set tab stops
  388. X ^J   Insert <NL>, then indent             
  389. X ^K   Kill forward              ESC K   Bind Key to function
  390. X ^L   Refresh the screen          ESC L   Lower case word
  391. X ^M   Insert <NL>              ESC M   Add global mode
  392. X ^N   Move forward by lines          ESC N   Goto End paragraph
  393. X ^O   Open up a blank line          
  394. X ^P   Move backward by lines          ESC P   Goto Begining of paragraph
  395. X ^Q   Insert literal              ESC Q   Fill current paragraph
  396. X ^R   Search backwards              ESC R   Search and replace
  397. X ^S   Search forward
  398. X ^T   Transpose characters               
  399. X ^U   Repeat command four times       ESC U   Upper case word
  400. X ^V   Move forward by pages          ESC V   Move backward by pages
  401. X ^W   Kill region              ESC W   Copy region to kill buffer
  402. X ^Y   Yank back from killbuffer       ESC X   Execute named command
  403. X ^Z   Move backward by pages          ESC Z   Save all buffers and exit
  404. X
  405. X ESC ^C   Count words in region       ESC ~   Unmark current buffer
  406. X ESC ^E   Execute named procedure
  407. X ESC ^F   Goto matching fence          ESC !   Reposition window
  408. X ESC ^H   Delete backward word          ESC <   Move to start of buffer
  409. X ESC ^K   Unbind Key from function    ESC >   Move to end of buffer
  410. X ESC ^L   Reposition window          ESC .   Set mark
  411. X ESC ^M   Delete global mode          ESC space    Set mark
  412. X ESC ^N   Rename current buffer       ESC rubout   Delete backward word
  413. X ESC ^R   Search & replace w/query      rubout   Backward delete
  414. X ESC ^S   Change screen rows
  415. X ESC ^T   Change screen columns
  416. X ESC ^V   Scroll next window down
  417. X ESC ^W   Delete Paragraph
  418. X ESC ^Z   Scroll next window up
  419. X
  420. X ^X ?    Describe a key           ^X !   Run 1 command in a shell
  421. X ^X =    Show the cursor position   ^X @@   Pipe shell command to buffer
  422. X ^X ^    Enlarge display window       ^X #   Filter buffer thru shell filter
  423. X ^X 0    Delete current window       ^X $   Execute an external program
  424. X ^X 1    Delete other windows       ^X (   Begin macro
  425. X ^X 2    Split current window       ^X )   End macro
  426. X                   ^X A   Set variable value
  427. X ^X ^B     Display buffer list       ^X B   Switch a window to a buffer
  428. X ^X ^C     Exit MicroEMACS       ^X C   Start a new command processor
  429. X ^X ^D   Detab line           ^X D   Suspend MicroEMACS (BSD4.2 only)
  430. X ^X ^E     Entab line           ^X E   Execute macro
  431. X ^X ^F     Find file           ^X F   Set fill column
  432. X ^X ^I     Insert file
  433. X                   ^X K   Delete buffer
  434. X ^X ^L     Lower case region
  435. X ^X ^M     Delete Mode           ^X M   Add a mode
  436. X ^X ^N     Move window down       ^X N   Rename current filename
  437. X ^X ^O     Delete blank lines       ^X O   Move to the next window
  438. X ^X ^P     Move window up        ^X P   Move to the previous window
  439. X ^X ^R     Get a file from disk       ^X R   Incremental reverse search
  440. X ^X ^S     Save current file       ^X S   Incremental forward search
  441. X ^X ^T   Trim line                 (Incremental search
  442. X ^X ^U     Upper case region                not always availible)
  443. X ^X ^V     View file
  444. X ^X ^W     Write a file to disk       ^X W   resize Window
  445. X ^X ^X     Swap "." and mark       ^X X   Use next buffer
  446. X ^X ^Z     Shrink window           ^X Z   Enlarge display window
  447. X
  448. X@u(Usable Modes)
  449. XWRAP     Lines going past right margin "wrap" to a new line
  450. XVIEW     Read-Only mode where no modifications are allowed
  451. XCMODE     Change behavior of some commands to work better with C
  452. XEXACT     Exact case matching on search strings
  453. XOVER     Overwrite typed characters instead of inserting them
  454. XCRYPT     Current buffer will be encrypted on write, decrypted on read
  455. XMAGIC     Use regular expression matching in searches
  456. XASAVE     Save the file every 256 inserted characters
  457. X
  458. XWHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK    Sets foreground color
  459. Xwhite/cyan/magenta/yellow/blue/red/green/black    Sets background color
  460. X@end(verbatim)
  461. X@newpage
  462. X@appendix(Supported machines)
  463. X
  464. X    The following table lists all the hardware/compilers for which I
  465. Xcurrently support MicroEMACS.  This is not exclusive of all machines
  466. Xwhich MicroEMACS will run on, but I have either run it myself, or had a
  467. Xfirst hand report of it running.
  468. X
  469. X@begin(verbatim)
  470. X@u(Hardware    OS        Compiler    Comments)
  471. XVAX 780        UNIX V5        native
  472. X        UNIX V7        native
  473. X        BSD 4.2        native        job control supported
  474. X        *VMS        native        only some terminals supported
  475. X
  476. XNCR Tower    UNIX V5        native
  477. X
  478. XFortune 32:16    UNIX V7        native
  479. X
  480. XIBM-PC        MSDOS        LATTICE    2.15    Large CODE/Large DATA
  481. X         2.0 & 3.2    AZTEC 3.4e    Small CODE/Large DATA
  482. X                TURBO C v1.00    LARGE memory model
  483. X                *MSC 4.0
  484. X                *MWC 86
  485. X        SCO XENIX    native
  486. X
  487. XHP150        MSDOS        Lattice 2.15    Function key labels
  488. X                        for the touch screen
  489. X
  490. XHP110        MSDOS        Lattice 2.15
  491. X                Aztec 3.4e
  492. X
  493. X*Data General 10
  494. X        MSDOS        Lattice 2.15
  495. X
  496. X*Texas Instruments Professional
  497. X        MSDOS        Lattice 2.15
  498. X
  499. XAmiga        Intuition    Lattice 3.03    no mouse or menus yet
  500. X                *Aztec 3
  501. X
  502. XST520        TOS        Mark Williams C Spawns under MSH
  503. X                Lattice 3.10    (no shell commands)
  504. X
  505. X@u[Systems to be supported (ie some code is already written:)]
  506. XMacintosh    Finder 5.0    Aztec
  507. X
  508. X*means that I do not own or have access to the listed compiler and/or
  509. X machine and must rely upon others to help support it. 
  510. X@end(verbatim)
  511. X@newpage
  512. X@appendix(Machine Dependent Notes)
  513. X
  514. X    This appendix lists some notes specific to individual
  515. Ximplementations of MicroEMACS.  Every attempt has been made to allow
  516. XEMACS to be identical on all machines, but we have also tried to take
  517. Xadvantage of function keys, cursor keys, mice, and special screen modes
  518. Xwhere possible.
  519. X
  520. X@appendixsection(IBM-PC/XT/AT and its clones)
  521. X
  522. X    The IBM-PC family of computers is supported with a variety of
  523. Xdifferent display adapters.  EMACS will attempt to discover what adapter
  524. Xis connected and use the proper driver for it.    Below is a list of the
  525. Xcurrently supported video adapters:
  526. X
  527. X@begin(verbatim)
  528. X@u(Adapter            $sres        Original mode used)
  529. XMonochrome Graphics Adapter    MONO        MONO
  530. XColor Graphics Adapter        CGA        CGA
  531. XEnhanced Graphics Adapter    EGA        CGA
  532. X@end(verbatim)
  533. X
  534. X    EMACS also takes advantege of various function keys and the keys
  535. Xon the keypad on an IBM-PC.  The function keys are initially not bound
  536. Xto any particular functions (except by the emacs.rc startup file), but
  537. Xthe keypad keys do default to the following:
  538. X
  539. X@begin(verbatim)
  540. X@u(Keypad key    Function)
  541. XHome        beginning-of-file
  542. XCSRS UP        previous-line
  543. XPg Up        previous-page
  544. XCSRS LEFT    backward-character
  545. XCSRS RIGHT    forward-character
  546. XEnd        end-of-file
  547. XCSRS DOWN    next-line
  548. XPg Dn        Next-page
  549. X@end(verbatim)
  550. X
  551. X    All these special keys are indicated in EMACS macroes by use of
  552. Xthe @b(FN) prefix.  Below is a list of many of the keys and the codes
  553. Xused to specify them.  Also the codes may be gotten by using the
  554. Xdescribe-key (^X ?) command on the suspect key.
  555. X@newpage
  556. X@begin(verbatim)
  557. X            IBM PC function keys in MicroEmacs
  558. X
  559. X    function    Function    ^function    Alt-function
  560. X f1)      FN;          FNT          FN^          FNh
  561. X f2)      FN<          FNU          FN_          FNi
  562. X f3)      FN=          FNV          FN`          FNj
  563. X f4)      FN>          FNW          FNa          FNk
  564. X f5)      FN?          FNX          FNb          FNl
  565. X f6)      FN@@          FNY          FNc          FNm
  566. X f7)      FNA          FNZ          FNd          FNn
  567. X f8)      FNB          FN[          FNe          FNo
  568. X f9)      FNC          FN\          FNf          FNp
  569. Xf10)      FND          FN]          FNg          FNq
  570. X
  571. Xhome)      FNG                  FNw
  572. XCsUp)      FNH
  573. XPgUp)      FNI                  FNa(umlaut) {Alt 132}
  574. XCsLf)      FNK                  FNs
  575. X 5  )
  576. XCsRt)      FNM                  FNt
  577. X End)      FNO                  FNu
  578. XCsDn)      FNP
  579. XPgDn)      FNQ                  FNv
  580. X Ins)      FNR
  581. X Del)      FNS
  582. X@end(verbatim)
  583. X@newpage
  584. X@appendixsection(HP 150)
  585. X
  586. X    This machine from Hewlett Packard is very unusual for an MSDOS
  587. Xmachine.  It has a touch screen and is very function key oriented.  An
  588. Xadditional command, @i(label-function-key)@index(label-function-key)
  589. Xallows you to place labels on the on screen function key labels.  A
  590. Xnumeric argument indicates which function key to label (one through
  591. Xeight) and then the program prompts for a 16 character label, which will
  592. Xbe used as two lines of eight characters.  To label function key three
  593. Xwith "save file" from a macro, you would use:
  594. X
  595. X@verbatim(3 label-function-key "save    file")
  596. X
  597. X    Notice the 4 spaces after "save".  This forces "file" to begin on
  598. Xthe second line of the label.
  599. X@newpage
  600. X@appendixsection(Atari 520/1040ST)
  601. X
  602. X    The ATARI ST family of computers have a dual personality.  They
  603. Xmay use either a monochrome or a color screen.    EMACS supports two
  604. Xscreen resolutions on each monitor. 
  605. X
  606. X@begin(verbatim)
  607. X@u(Monitor $sres size #color $palette format)
  608. XColor    LOW    40x25    16    000111222333444555666777
  609. X    MEDIUM    80x25    4    000111222333
  610. XMono    HIGH    80x25    2    000
  611. X    DENSE    80x50    2    000
  612. X@end(verbatim)
  613. X
  614. X    The $palette environment variable can be used to change what
  615. Xcolor is associated with each color name.  With a color monitor, each
  616. Xgroup of three digits indicates an octal number specifying the RED,
  617. XGREEN and BLUE levels of that color.  Each color digit can vary from 0
  618. Xto 7.  For example, the initial setting of $palette in LOW resolution is:
  619. X
  620. X@begin(verbatim)
  621. X    000700070770007707077777
  622. X
  623. X    which broken up is:
  624. X
  625. X    000 700 070 770 007 707 077 777
  626. X
  627. X    which means:
  628. X
  629. X    000    Black
  630. X    700    Red
  631. X    070    Green
  632. X    770    Yellow
  633. X    007    Blue
  634. X    707    Magenta
  635. X    077    Cyan
  636. X    777    White
  637. X@end(verbatim)
  638. X
  639. X    Also the mouse generates FN prefix codes when moved, or when one
  640. Xof the two buttons is pressed.    Initially the movement of the mouse is
  641. Xbound to movement of the cursor, and the left mouse button generates a
  642. Xset-mark (M-space) command.  The cursor keys and the function keys are
  643. Xbound similarly to to IBM-PC.
  644. X
  645. X    Files generated by EMACS on the ATARI ST have a single return
  646. Xcharacter at the end of each line, unlike the desktop files which want
  647. Xto have tow returns. This makes it display files strangly from GEM's
  648. X[SHOW] option, but makes the files port to other computers much nicer.
  649. X
  650. X    Currently, when operating under the Mark Williams MSH program,
  651. XEMACS can shell out and perform external commands. This capability will
  652. Xbe added later for the Beckmeyer shell and under GEMDOS.
  653. X@newpage
  654. X@appendixsection(Amiga 1000)
  655. X
  656. X    The Commodore AMIGA 1000 version of MicroEMACS does not have
  657. Xextensive support of the mouse or of pull down menus as of yet.  It does
  658. Xhowever come up in a window, and it is possible to re-size it to run in
  659. Xdifferent sized windows.  The @b(M-^S) @i(change-screen-size)
  660. X@index(change-screen-size) takes its numeric argument as the new number
  661. Xof lines for EMACS to use.  The @b(M-^T) @i(change-screen-width)
  662. X@index(change-screen-width) command allows you to change the number of
  663. Xcolumns EMACS will use.  The defaults for these are 23 lines and 77
  664. Xcharacters across for a full screen window.
  665. X
  666. X@center(Note about Compiling MicroEMACS)
  667. X
  668. X@begin(quotation)
  669. X    If you are compiling the sources on the AMIGA to produce an
  670. Xexecutable image, and you are using the Lattice compiler, be sure to
  671. Xgive the CLI command 'STACK 40000' before compiling to make sure the
  672. Xcompiler has sufficient stack space to successfully complete
  673. Xcompiliation.
  674. X@end(quotation)
  675. X@newpage
  676. X@appendixsection(UNIX V5, V7, and BSD4.[23])
  677. X
  678. X    MicroEMACS under UNIX utilizes the @b(TERMCAP) @index(termcap)
  679. Xlibrary to provide machine independent screen functions.  Make sure that
  680. Xtermcap is availible and properly set on your account before attempting
  681. Xto use MicroEMACS. 
  682. X
  683. X    Under systems which support job control, you can use the
  684. X@b(^X-D) @i(suspend-emacs) @index(suspend-emacs) command to place EMACS
  685. Xinto the background.  This carries a much smaller overhead than bringing
  686. Xup a new shell under EMACS.  EMACS will properly redraw the screen when
  687. Xyou bring it back to the foreground.
  688. X
  689. X    If the symbol VT100 has been set to 1 in the @i(estruct.h)
  690. Xoptions file, EMACS will recognize the key sequence <ESC>[ as the lead
  691. Xin sequence for the FN function key prefix.
  692. X
  693. X    With the addition of some very machine/operating system specific
  694. Xcode, EMACS can prevent two or more people from modifying the same file
  695. Xat the same time.  @index(file locking) The upper level of a set of
  696. Xfunctions to provide file locking exist in the source file @b(LOCK.C). 
  697. XIt requires two machine specific functions written and linked into EMACS
  698. Xfor it to operate properly. 
  699. X
  700. X@begin(verbatim)
  701. X    char *dolock(fname)
  702. X
  703. X    char *fname;
  704. X
  705. X    dolock() locks a file, preventing others from modifying it. If
  706. X    it succeeds, it returns NULL, otherwise it returns a pointer to
  707. X    a string in the form "LOCK ERROR: explaination".
  708. X
  709. X    char *undolock(fname)
  710. X
  711. X    char *fname;
  712. X
  713. X    undolock() unlocks a file, allowing others to modifying it. If
  714. X    it succeeds, it returns NULL, otherwise it returns a pointer to
  715. X    a string in the form "LOCK ERROR: explaination".
  716. X@end(verbatim)
  717. X@newpage
  718. X@appendix(Mode Flags)
  719. X
  720. X    The two environment variables, $cmode and $gmode, contain a
  721. Xnumber the corresponds to the modes set for the current buffer and
  722. Xthe editor as a whole.  These are encoded as the sum of the following
  723. Xnumbers for each of the possible modes:
  724. X
  725. X@begin(verbatim)
  726. XWRAP      1        Word wrap
  727. XCMODE      2        C indentation and fence match
  728. XSPELL      4        Interactive spell checking (Not Implemented Yet)
  729. XEXACT      8        Exact matching for searches
  730. XVIEW     16        Read-only buffer
  731. XOVER     32        Overwrite mode
  732. XMAGIC     64        Regular expressions in search
  733. XCRYPT    128        Encrytion mode active
  734. XASAVE    256        Auto-save mode
  735. X@end(verbatim)
  736. X
  737. X    So, if you wished to set the current buffer to have CMODE,
  738. XEXACT, and MAGIC on, and all the others off, you would add up the values
  739. Xfor those three, CMODE 2  +  EXACT 8  +  MAGIC 64 = 74, and use a
  740. Xstatement like:
  741. X
  742. Xset $cmode 74
  743. X
  744. X    or, use the binary or operator to combine the different modes:
  745. X
  746. Xset $cmode &bor &bor 2 8 64
  747. X
  748. X@flushleft(@big[Internal Flags])
  749. X
  750. X    Some of the ways EMACS controls its internal functions can be
  751. Xmodified by the value in the $gflags environment variable.  Each bit in
  752. Xthis variable will be used to control a different function.
  753. X
  754. X@begin(verbatim)
  755. XGFFLAG        1    If this bit is set to zero, EMACS will not
  756. X            automatically switch to the buffer of the
  757. X            first file after executing the startup macros.
  758. X@end(verbatim)
  759. FRIDAY_NIGHT
  760. echo extracting - emacs.txt
  761. sed 's/^X//' > emacs.txt << 'FRIDAY_NIGHT'
  762. X
  763. X
  764. X
  765. X
  766. X
  767. X
  768. X
  769. X
  770. X
  771. X
  772. X
  773. X
  774. X
  775. X
  776. X
  777. X
  778. X
  779. X                          MicroEMACS
  780. X
  781. X                          Full Screen Text Editor
  782. X                          Reference Manual (preliminary draft)
  783. X
  784. X                          Version 3.9e
  785. X                          November 4, 1987
  786. X
  787. X                          (C)opyright 1987 by Daniel M. Lawrence
  788. X                          Reference Manual (C)opyright 1987
  789. X                                  by Brian Straight and Daniel M. Lawrence
  790. X                          All Rights Reserved
  791. X
  792. X                          MicroEMACS 3.9e  can  be  copied  and distributed
  793. X          freely
  794. X                          for any non-commercial purposes. MicroEMACS  3.9e
  795. X          can
  796. X                          only  be  incorporated into  commercial  software
  797. X          with
  798. X                          the permission of the current author.
  799. X
  800. X
  801. X
  802. X
  803. X
  804. X
  805. X
  806. X
  807. X
  808. X
  809. X
  810. X
  811. X
  812. X
  813. X
  814. X
  815. X
  816. X
  817. X
  818. X
  819. X
  820. X
  821. X
  822. X
  823. X
  824. X
  825. X
  826. X
  827. X
  828. X
  829. X
  830. X
  831. X
  832. X
  833. X
  834. X          Introduction
  835. X
  836. X                  MicroEMACS is a tool for creating and changing documents,
  837. X          programs, and other text  files.   It is both relatively easy for
  838. X          the novice to  use,  but  also  very  powerful in the hands of an
  839. X          expert. MicroEMACS can be extensively customized for the needs of
  840. X          the individual user.
  841. X
  842. X                  MicroEMACS allows  several files to be edited at the same
  843. X          time.  The  screen  can be split into different windows, and text
  844. X          may  be  moved  freely from one window to the next.  Depending on
  845. X          the  type  of  file  being  edited, MicroEMACS can change how  it
  846. X          behaves to make editing simple.    Editing  standard  text files,
  847. X          program files and  word  processing documents are all possible at
  848. X          the same time.
  849. X
  850. X                  There are extensive  capabilities to make word processing
  851. X          and editing  easier.  These include commands for string searching
  852. X          and replacing,  paragraph  reformatting  and  deleting, automatic
  853. X          word wrapping,  word move and deletes, easy case controlling, and
  854. X          automatic word counts.
  855. X
  856. X                  For complex and  repetitive editing tasks editing macroes
  857. X          can be written.  These macroes  allow  the user a great degree of
  858. X          flexibility in determining how MicroEMACS behaves.  Also, any and
  859. X          all the commands  can  be  used  by any keystroke by changing, or
  860. X          rebinding, what commands various keys  are  connected,  or bound,
  861. X          to.
  862. X
  863. X                  Special features are also available to perform  a diverse
  864. X          set of  operations such as file encryption, automatic backup file
  865. X          generation, entabbing  and  detabbing  lines,  executing  of  DOS
  866. X          commands and  filtering of text through other programs (like SORT
  867. X          to allow sorting text).
  868. X
  869. X          History
  870. X
  871. X                  EMACS was originally a  text  editor  written  by Richard
  872. X          Stahlman  at  MIT  in  the  early  1970s  for  Digital  Equipment
  873. X          computers. Various versions, rewrites  and  clones  have  made an
  874. X          appearence since.
  875. X
  876. X                  This version of MicroEMACS is derived  from  code written
  877. X          by Dave G. Conroy in 1985.  Later modifications were performed by
  878. X          Steve  Wilhite  and  George  Jones.   In December of 1985  Daniel
  879. X          Lawrence picked up the then current source (version 2.0) and made
  880. X          extensive modifications and additions  to  it  over the course of
  881. X          the next two years.  Updates and support for the  current version
  882. X          are still availible.  The current program author can be contacted
  883. X          by writing to:
  884. X
  885. X                  USMAIL: Daniel Lawrence
  886. X                          617 New York St
  887. X                          Lafayette, IN 47901
  888. X
  889. X
  890. X
  891. X
  892. X
  893. X
  894. X
  895. X
  896. X
  897. X
  898. X
  899. X                  UUCP:   ihnp4!pur-ee!pur-phy!duncan!lawrence
  900. X                  ARPA:   nwd@j.cc.purdue.edu
  901. X                  FIDO:   Fido 201/2 The Programmer's Room (317) 742-5533
  902. X
  903. X
  904. X
  905. X
  906. X
  907. X
  908. X
  909. X
  910. X
  911. X
  912. X
  913. X
  914. X
  915. X
  916. X
  917. X
  918. X
  919. X
  920. X
  921. X
  922. X
  923. X
  924. X
  925. X
  926. X
  927. X
  928. X
  929. X
  930. X
  931. X
  932. X
  933. X
  934. X
  935. X
  936. X
  937. X
  938. X
  939. X
  940. X
  941. X
  942. X
  943. X
  944. X
  945. X
  946. X
  947. X
  948. X
  949. X
  950. X
  951. X
  952. X
  953. X
  954. X
  955. X
  956. X
  957. X
  958. X
  959. X
  960. X
  961. X
  962. X
  963. X          Basic Concepts                        MicroEMACS Reference Manual
  964. X
  965. X
  966. X
  967. X
  968. X
  969. X
  970. X
  971. X
  972. X                                      Chapter 1
  973. X
  974. X                                   Basic Concepts
  975. X
  976. X
  977. X                  The current version of MicroEMACS  is  3.9e  (Third major
  978. X          re-write, ninth public release,  fifth  minor  edit), and for the
  979. X          rest of this document,  we  shall simply refer to this version as
  980. X          "EMACS".  Any modifications for  later versions will be listed in
  981. X          the appendixes at the end of this manual.
  982. X
  983. X
  984. X          1.1  Keys and the Keyboard
  985. X
  986. X
  987. X                  Many times throughout  this  manual  we  will  be talking
  988. X          about commands and the  keys  on the keyboard needed to use them.
  989. X          There  are  a  number of "special" keys which can be used and are
  990. X          listed here:
  991. X
  992. X          <NL>           NewLine which is also called RETURN or ENTER, this
  993. X                         key is used to end different commands.
  994. X
  995. X          ^              The control key can be used before  any alphabetic
  996. X                         character and some symbols.  For example, ^C means
  997. X                         to hold down the <CONTROL>  key and type the C key
  998. X                         at the same time.
  999. X
  1000. X          ^X             The CONTROL-X key is used at the beginning of many
  1001. X                         different commands.
  1002. X
  1003. X          META or M-     This is a special EMACS  key  used  to  begin many
  1004. X                         commands as well.   This  key  is pressed and then
  1005. X                         released  before  typing  the  next character.  On
  1006. X                         most systems, this is the <ESC> key, but it can be
  1007. X                         changed.  (consult appendix E to learn what key is
  1008. X                         used for META on your computer).
  1009. X
  1010. X                  Whenever a command is described, the manual will list the
  1011. X          actual  keystrokes needed to execute it  in  boldface  using  the
  1012. X          above conventions, and also the name of the command in italics.
  1013. X
  1014. X
  1015. X          1.2  Getting Started
  1016. X
  1017. X
  1018. X                  In  order to use EMACS, you must call  it  up  from  your
  1019. X          system or computer's command prompt.  On UNIX and MSDOS machines,
  1020. X
  1021. X
  1022. X          1
  1023. X
  1024. X
  1025. X
  1026. X
  1027. X
  1028. X
  1029. X          MicroEMACS Reference Manual                        Basic Concepts
  1030. X
  1031. X
  1032. X          just type "emacs" from the main command prompt and follow it with
  1033. X          the  <RETURN>  or  <ENTER> key (we will refer to this key as <NL>
  1034. X          for  "new-line"  for  the remainder of  this  manual).    On  the
  1035. X          Macintosh, the Amiga, the ATARI ST and other icon based operating
  1036. X          systems, double click on the uEMACS icon. Shortly  after  this, a
  1037. X          screen similar to the one below should appear.
  1038. X
  1039. X
  1040. X          1.3  Parts and Pieces
  1041. X
  1042. X
  1043. X                  The screen is divided into  a number of areas or windows.
  1044. X          On some systems  the  top  window  contains  a  function  list of
  1045. X          unshifted and shifted function keys.   We will discuss these keys
  1046. X          later.  Below  them  is an EMACS mode line which, as we will see,
  1047. X          informs you of the present mode of operation  of  the editor--for
  1048. X          example "(WRAP)" if  you  set  EMACS  to  wrap at the end of each
  1049. X          line. Under the mode  line  is the text window where text appears
  1050. X          and is manipulated.    Since  each  window has its own mode line,
  1051. X          below the text window is it's  mode  line.   The last line of the
  1052. X          screen is the command line where EMACS takes commands and reports
  1053. X          on what it is doing.
  1054. X
  1055. X          ===============================================================================
  1056. X          f1 search-> f2 <-search |    MicroEMACS:  Text Editor
  1057. X          f3 hunt->   f4 <-hunt   |
  1058. X          f5 fkeys    f6 help     |  Available function key Pages include:
  1059. X          f7 nxt wind f8 pg[    ] |    WORD  PROG  BOX
  1060. X          f9 save     f10 exit    |  [use the f8 key to load Pages]
  1061. X          ===============================================================================
  1062. X          -- MicroEMACS 3.9e () -- Function Keys
  1063. X          ---------------------------------------
  1064. X          ===============================================================================
  1065. X
  1066. X
  1067. X
  1068. X
  1069. X
  1070. X
  1071. X
  1072. X
  1073. X
  1074. X
  1075. X
  1076. X
  1077. X          ===============================================================================
  1078. X          -- MicroEMACS 3.9e () -- Main
  1079. X          ------------------------------------------------
  1080. X          ===============================================================================
  1081. X
  1082. X
  1083. X
  1084. X
  1085. X
  1086. X
  1087. X
  1088. X                                                                          2
  1089. X
  1090. X
  1091. X
  1092. X
  1093. X
  1094. X
  1095. X          Basic Concepts                        MicroEMACS Reference Manual
  1096. X
  1097. X
  1098. X                          Fig 1:  EMACS screen on an IBM-PC
  1099. X
  1100. X
  1101. X          1.4  Entering Text
  1102. X
  1103. X
  1104. X                  Entering text in EMACS is  simple.    Type  the following
  1105. X          sentence fragment:
  1106. X
  1107. X               Fang Rock lighthouse, center of a series  of mysterious
  1108. X               and
  1109. X
  1110. X          The text is displayed at the top of the text window.  Now type:
  1111. X
  1112. X               terrifying events at the turn of the century
  1113. X
  1114. X                  Notice the text to the  left of the cursor disappears and
  1115. X          a '$' sign appears.    Don't  panic--your  text is safe!!! You've
  1116. X          just discovered that EMACS doesn't "wrap" text to  the  next line
  1117. X          like most word processors  unless  you hit <NL>.  But since EMACS
  1118. X          is used for both word processing, and text editing, it has  a bit
  1119. X          of a dual personality.   You  can  change  the  way  it  works by
  1120. X          setting various modes.  In this case, you need to set  WRAP mode,
  1121. X          using the add-mode command, by typing ^X-M.  The command  line at
  1122. X          the base of the screen will prompt you for the  mode  you wish to
  1123. X          add.   Type  wrap  followed  by the <NL> key and any text you now
  1124. X          enter  will  be  wrapped.  However, the command doesn't wrap text
  1125. X          already entered.   To  get  rid  of  the  truncated  line, delete
  1126. X          characters with the <BACKSPACE> key until the '$' goes away.  Now
  1127. X          type in the words you deleted,  watch  how EMACS goes down to the
  1128. X          next line at the right time.  (In some versions of EMACS, WRAP is
  1129. X          a  default  mode  in which case you don't have to worry about the
  1130. X          instructions relating to adding this mode.)
  1131. X
  1132. X                  Now let's type  a  longer  insert.   Hit <NL> a couple of
  1133. X          times to tab down from the text you just entered.    Now type the
  1134. X          following paragraphs.   Press  <NL> twice to indicate a paragraph
  1135. X          break.
  1136. X
  1137. X               Fang Rock lighthouse, center of a series  of mysterious
  1138. X               and terrifying events at  the  turn  of the century, is
  1139. X               built  on a rocky island a few  miles  of  the  Channel
  1140. X               coast.  So small is  the island that wherever you stand
  1141. X               its rocks are wet with sea spray.
  1142. X
  1143. X               The lighthouse tower is in the center of the island.  A
  1144. X               steep  flight  of  steps leads to the heavy door in its
  1145. X               base.  Winding stairs lead up to the crew room.
  1146. X
  1147. X
  1148. X
  1149. X
  1150. X
  1151. X
  1152. X
  1153. X
  1154. X          3
  1155. X
  1156. X
  1157. X
  1158. X
  1159. X
  1160. X
  1161. X          MicroEMACS Reference Manual                        Basic Concepts
  1162. X
  1163. X
  1164. X          1.5  Basic cursor movement
  1165. X
  1166. X
  1167. X                  Now let's practice moving around in this text.    To move
  1168. X          the cursor back  to  the word "Winding," enter M-B previous-word.
  1169. X          This command moves the cursor backwards by one word  at  a  time.
  1170. X          Note you have to press the key combination every time  the cursor
  1171. X          steps back by one word.   Continuously pressing META and toggling
  1172. X          B  produces  an  error  message.    To  move  forward to the word
  1173. X          "stairs" enter M-F, which moves the cursor forward by one word at
  1174. X          a time.
  1175. X
  1176. X                  Notice that EMACS commands  are  usually  mnemonic--F for
  1177. X          forward, B for backward, for example.
  1178. X
  1179. X                  To move the  cursor  up one line, enter ^P previous-line,
  1180. X          down one line ^N next-line.  Practice this movement by moving the
  1181. X          cursor to the word "terrifying" in the second line.
  1182. X
  1183. X                  The  cursor  may  also be moved forward  or  backward  in
  1184. X          smaller increments.  To move forward by one  character,  enter ^F
  1185. X          forward-character,  to  move  backward,  ^B   backward-character.
  1186. X          EMACS also allows you to specify a number which is  normally used
  1187. X          to  tell  a  command to execute  many  times.    To  repeat  most
  1188. X          commands, press META and  then  the  number  before you enter the
  1189. X          command.   Thus,  the  command  META  5  ^F (M-5^F) will move the
  1190. X          cursor forward by five characters.  Try moving around in the text
  1191. X          by using these commands.    For extra practice, see how close you
  1192. X          can come to the word "small" in the first paragraph by  giving an
  1193. X          argument to the commands listed here.
  1194. X
  1195. X                  Two other  simple cursor commands that are useful to help
  1196. X          us move around in the text are M-N next-paragraph which moves the
  1197. X          cursor to the second paragraph, and M-P  previous-paragraph which
  1198. X          moves it back to the previous paragraph.  The cursor may  also be
  1199. X          moved rapidly from one end of  the  line  to the other.  Move the
  1200. X          cursor to the word "few" in the second line.  Press ^A beginning-
  1201. X          of-line.  Notice  the  cursor  moves  to the word "events" at the
  1202. X          beginning of the line.   Pressing ^E end-of-line moves the cursor
  1203. X          to the end of the line.
  1204. X
  1205. X                  Finally,  the  cursor  may be moved from any point in the
  1206. X          file to the end or beginning  of  the file.  Entering M-> end-of-
  1207. X          file moves the cursor to the end of the buffer, M-< beginning-of-
  1208. X          file to the first character of the file.
  1209. X
  1210. X                  On the IBM-PC, the ATARI  ST and many other machines, the
  1211. X          cursor  keys can also be used to move the cursor about.  Also, if
  1212. X          there is one available, moving the mouse will move the cursor.
  1213. X
  1214. X                  Practice  moving the cursor in the  text  until  you  are
  1215. X          comfortable with the commands we've explored in this chapter.
  1216. X
  1217. X
  1218. X
  1219. X
  1220. X                                                                          4
  1221. X
  1222. X
  1223. X
  1224. X
  1225. X
  1226. X
  1227. X          Basic Concepts                        MicroEMACS Reference Manual
  1228. X
  1229. X
  1230. X          1.6  Saving your text
  1231. X
  1232. X
  1233. X                  When you've  finished  practicing  cursor  movement, save
  1234. X          your file.  Your file currently resides in a BUFFER.   The buffer
  1235. X          is a temporary storage area for  your  text, and is lost when the
  1236. X          computer is  turned  off.    You can save the buffer to a file by
  1237. X          entering ^X-^S save-file.  Notice  that  EMACS  informs  you that
  1238. X          your file has no name and will not let you save it.
  1239. X
  1240. X                  To save your buffer to a file with a different  name than
  1241. X          it's current one (which is  empty), press ^X^W write-file.  EMACS
  1242. X          will  prompt  you  for the filename you wish to write.  Enter the
  1243. X          name fang.txt and press return.  On a micro, the drive light will
  1244. X          come  on, and EMACS will inform you it is writing the file.  When
  1245. X          it finishes, it will inform you of the  number  of  lines  it has
  1246. X          written to the disk.
  1247. X
  1248. X                  Congratulations!!  You've just  saved  your  first  EMACS
  1249. X          file!
  1250. X
  1251. X
  1252. X
  1253. X
  1254. X
  1255. X
  1256. X
  1257. X
  1258. X
  1259. X
  1260. X
  1261. X
  1262. X
  1263. X
  1264. X
  1265. X
  1266. X
  1267. X
  1268. X
  1269. X
  1270. X
  1271. X
  1272. X
  1273. X
  1274. X
  1275. X
  1276. X
  1277. X
  1278. X
  1279. X
  1280. X
  1281. X
  1282. X
  1283. X
  1284. X
  1285. X
  1286. X          5
  1287. X
  1288. X
  1289. X
  1290. X
  1291. X
  1292. X
  1293. X          MicroEMACS Reference Manual                        Basic Concepts
  1294. X
  1295. X
  1296. X
  1297. X
  1298. X
  1299. X
  1300. X                                  Chapter 1 Summary
  1301. X
  1302. X
  1303. X                  In chapter 1, you  learned  how to enter text, how to use
  1304. X          wrap mode,  how  to  move  the cursor, and to save a buffer.  The
  1305. X          following is a table of the commands covered in this  chapter and
  1306. X          their corresponding key bindings:
  1307. X
  1308. X          Key Binding             Keystroke       Effect
  1309. X
  1310. X          abort-command           ^G              aborts current command
  1311. X
  1312. X          add-mode                ^XM             allows addition of EMACS
  1313. X                                                  mode such as WRAP
  1314. X
  1315. X          backward-character      ^B              moves cursor left one character
  1316. X
  1317. X          beginning-of-file       M-<             moves cursor to beginning of file
  1318. X
  1319. X          beginning-of-line       ^A              moves cursor to beginning of line
  1320. X
  1321. X          end-of-file             M->             moves cursor to end of file
  1322. X
  1323. X          end-of-line             ^E              moves cursor to end of line
  1324. X
  1325. X          forward-character       ^F              moves cursor right one character
  1326. X
  1327. X          next-line               ^N              moves cursor to next line
  1328. X
  1329. X          next-paragraph          M-N             moves cursor to next paragraph
  1330. X
  1331. X          next-word               M-F             moves cursor forward one word
  1332. X
  1333. X          previous-line           ^P              moves cursor backward by one line
  1334. X
  1335. X          previous-paragraph      M-P             moves cursor to previous paragraph
  1336. X
  1337. X          previous-word           M-B             moves cursor backward by one word
  1338. X
  1339. X          save-file               ^X-^S           saves current buffer to a file
  1340. X
  1341. X          write-file              ^X-^W           save current buffer under a new
  1342. X                                                  name
  1343. X
  1344. X
  1345. X
  1346. X
  1347. X
  1348. X
  1349. X
  1350. X
  1351. X
  1352. X                                                                          6
  1353. X
  1354. X
  1355. X
  1356. X
  1357. X
  1358. X
  1359. X          Basic Editing--Simple Insertions and Deletions         MicroEMACS
  1360. X                                                           Reference Manual
  1361. X
  1362. X
  1363. X
  1364. X
  1365. X
  1366. X
  1367. X
  1368. X
  1369. X                                      Chapter 2
  1370. X
  1371. X                   Basic Editing--Simple Insertions and Deletions
  1372. X
  1373. X
  1374. X          2.1  A Word About Windows, Buffers, Screens, and Modes
  1375. X
  1376. X
  1377. X                  In the first chapter, you  learned how to create and save
  1378. X          a file in EMACS. Let's do some more editing on  this  file.  Call
  1379. X          up emacs by typing in the following command.
  1380. X
  1381. X                  emacs fang.txt
  1382. X
  1383. X                  On icon oriented  systems,  double  click  on  the uEMACS
  1384. X          icon, usually a file dialog box of some sort will appear.  Choose
  1385. X          FANG.TXT from the appropriate folder.
  1386. X
  1387. X                  Shortly after you invoke EMACS, the text should appear on
  1388. X          the screen ready for you to  edit.    The text you are looking at
  1389. X          currently resides in a buffer.   A  buffer is a temporary area of
  1390. X          computer  memory  which  is the primary unit internal to EMACS --
  1391. X          this is the place where EMACS goes to work.  The mode line at the
  1392. X          bottom of the screen lists the buffer name, FANG.TXT and the name
  1393. X          of the file with which this buffer is associated, FANG.TXT
  1394. X
  1395. X                  The computer talks to you  through the use of its screen.
  1396. X          This screen usually has an area of 24 lines each of 80 characters
  1397. X          across.  You can  use  EMACS to subdivide the screen into several
  1398. X          separate  work  areas,  or windows, each of which can be 'looking
  1399. X          into'  different  files  or sections of text.  Using windows, you
  1400. X          can work on several related texts at one time, copying and moving
  1401. X          blocks of text between windows with ease.  To keep track  of what
  1402. X          you are editing, each window is identified by a mode line  on the
  1403. X          last line of the window which lists the name of the  buffer which
  1404. X          it  is  looking  into, the file from which the text was read, and
  1405. X          how the text is being edited.
  1406. X
  1407. X                  An  EMACS  mode  tells EMACS how to deal with user input.
  1408. X          As we have already seen, the mode 'WRAP' controls how EMACS deals
  1409. X          with long lines (lines with over 79 characters) while the user is
  1410. X          typing  them  in.   The 'VIEW' mode, allows you to  read  a  file
  1411. X          without modifying it.  Modes  are associated with buffers and not
  1412. X          with files; hence, a  mode  needs to be explicitly set or removed
  1413. X          every time you edit a file.  A new file read into a buffer with a
  1414. X          previously specified mode will be edited under this mode.  If you
  1415. X
  1416. X
  1417. X
  1418. X          7
  1419. X
  1420. X
  1421. X
  1422. X
  1423. X
  1424. X
  1425. X          MicroEMACS Reference Manual  Basic Editing--Simple Insertions and
  1426. X                                                                  Deletions
  1427. X
  1428. X
  1429. X          use specific modes frequently, EMACS  allows you to set the modes
  1430. X          which are used by all new buffers, called global modes.
  1431. X
  1432. X
  1433. X          2.2  Insertions
  1434. X
  1435. X
  1436. X                  Your previously-saved text should look like this:
  1437. X
  1438. X               Fang Rock lighthouse, center of a series  of mysterious
  1439. X               and terrifying events at  the  turn  of the century, is
  1440. X               built  on a rocky island a few  miles  of  the  Channel
  1441. X               coast.  So small is  the island that wherever you stand
  1442. X               its rocks are wet with sea spray.
  1443. X
  1444. X               The lighthouse tower is in the center of the island.  A
  1445. X               steep  flight  of  steps leads to the heavy door in its
  1446. X               base.  Winding stairs lead up to the crew room.
  1447. X
  1448. X                  Let's assume you want  to  add  a  sentence in the second
  1449. X          paragraph after the word "base."  Move the cursor until it  is on
  1450. X          the "W" of "Winding". Now type the following:
  1451. X
  1452. X               This gives entry to the lower floor where the big steam
  1453. X               generator throbs steadily away, providing power for the
  1454. X               electric lantern.
  1455. X
  1456. X                  If  the line fails to wrap and you end up with a '$' sign
  1457. X          in the right margin,  just  enter  M-Q fill-paragraph to reformat
  1458. X          the  paragraph.    This  new  command  attempts  to  fill  out  a
  1459. X          paragraph.  Long lines  are  divided  up,  and words are shuffled
  1460. X          around to make the paragraph look nicer.
  1461. X
  1462. X                  Notice  that  all  visible  EMACS  characters  are  self-
  1463. X          inserting -- all you had to do was type the characters  to insert
  1464. X          and the existing text made space  for  it.  With a few exceptions
  1465. X          discussed later, all non-printing characters (such as  control or
  1466. X          escape sequences) are commands.  To insert spaces, simply use the
  1467. X          space bar.  Now move to the first line of the  file  and  type ^O
  1468. X          open-line (Oh, not zero).  You've just learned how  to  insert  a
  1469. X          blank line in your text.
  1470. X
  1471. X
  1472. X          2.3  Deletions
  1473. X
  1474. X
  1475. X                  EMACS offers  a number of deletion options.  For example,
  1476. X          move the cursor until it's under the period  at  the  end  of the
  1477. X          insertion you just did.  Press the backspace key.  Notice the "n"
  1478. X          on "lantern"  disappeared.  The backspace implemented on EMACS is
  1479.