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

  1. From: paul@cgh.UUCP (Paul Homchick)
  2. Newsgroups: comp.sources.misc
  3. Subject: MicroEMACS 3.8i Documentation (Formatted) 2 of 2
  4. Message-ID: <2764@ncoast.UUCP>
  5. Date: 3 Jul 87 00:12:26 GMT
  6. Sender: allbery@ncoast.UUCP
  7. Lines: 2122
  8. Approved: allbery@ncoast.UUCP
  9. X-Archive: comp.sources.misc/8707/4
  10.  
  11. MicroEmacs 3.8i Documentation formatted from MicroSCRIBE original.
  12.                  +++ Part Two of Two +++
  13. (Differs from the original uEmacs distribution by fixing some spelling
  14.  errors and formattating problems)
  15. -----snip-----snip-----snip-----snip-----snip-----snip-----snip-----snip-----
  16.  
  17. Screen Formatting                 MicroEMACS Reference Manual
  18.  
  19. 9.3  Changing Case
  20.  
  21.     There may be occasions when you find it necessary to  change the
  22. case of the text you've entered.  EMACS allows you to change the case of
  23. even large amounts of text with ease.  Let's try and  convert  a  few of
  24. the office traditionalists to the joy  of  word processing.  Type in the
  25. following text:
  26.  
  27.      Throw away your typewriter and  learn to use a word processor.
  28.      Word processing  is relatively easy to learn and will increase
  29.      your productivity enormously.  Enter the Computer Age and find
  30.      out just how much fun it can be!!
  31.  
  32.     Let's give it a  little  more  impact  by capitalizing the first
  33. four words.  The first    step is to define the region of text just as you
  34. would  if  you were doing an extensive deletion.  Set the  mark  at  the
  35. beginning of the paragraph with M-<space> set-mark and    move  the cursor
  36. to the space beyond  "typewriter."  Now  enter    ^X-^U case-region-upper.
  37. Your text should now look like this:
  38.  
  39.      THROW AWAY YOUR TYPEWRITER and  learn to use a word processor.
  40.      Word processing  is relatively easy to learn and will increase
  41.      your productivity enormously.  Enter the Computer Age and find
  42.      out just how much fun it can be!!
  43.  
  44.     If  you  want  to change the text back to lower case, type ^X-^L
  45. case-region-lower.    You  can    also  capitalize individual words.    To
  46. capitalize the word "fun", position the cursor in front of the    word and
  47. type  M-U  case-word-upper.   The word is now capitalized.  To change it
  48. back to lower case, move the  cursor  back  to the beginning of the word
  49. and type M-L case-word-lower.
  50.  
  51.     You  may  also    capitalize  individual    letters in EMACS.    The
  52. command M-C case-word-capitalize capitalizes the first letter  after the
  53. point.    This command would normally be issued with the cursor positioned
  54. in front of the first letter of the word you wish to capitalize.  If you
  55. issue it  in  the  middle  of  a  word, you can end up with some strAnge
  56. looking text.
  57.  
  58. 9.4  Tabs
  59.  
  60.     Unless    your  formatter  is  instructed  to  take   screen  text
  61. literally  (as    MicroSCRIBE  does  in  the  'verbatim'    environment  for
  62. example), tabs in EMACS generally affect screen formatting only.
  63.  
  64.     When EMACS is first started, it sets the default  tab  to  every
  65. eighth column.    As long as you stay with default,  every  time you press
  66. the tab key a tab character, ^I is inserted.  This character, like other
  67. control  characters,  is  invisible  --   but  it  makes  a  subtle  and
  68. significant difference to your file and editing.
  69.  
  70. 32
  71.  
  72. MicroEMACS Reference Manual                   Screen Formatting
  73.  
  74.     For example, in default mode, press the tab key  and  then  type
  75. the word Test.    "Test" appears at the eighth column.    Move your cursor
  76. to the beginning of the word and delete  the  backward    character.   The
  77. word doesn't  move  back  just    one  character,  but flushes to the left
  78. margin.    The    reason for this behavior is easily explained.     In  tab
  79. default, EMACS inserts    a  'real'  tab    character when you press the tab
  80. key.  This character is inserted at the default position, but  NO SPACES
  81. are inserted between the  tab  character and the margin (or previous tab
  82. character).  As you will  recall, EMACS only recognizes characters (such
  83. as  spaces  or    letters) and thus when the tab character is removed, the
  84. text beyond the tab is flushed back to the margin or previous tab mark.
  85.  
  86.     This situation changes if you alter  the  default configuration.
  87. The default value may  be  changed by entering a numeric argument before
  88. pressing  the  tab key.  As we saw earlier, pressing the  META    key  and
  89. entering a  number  allows  you  to  specify  how EMACS performs a given
  90. action.   In this case, let's specify an argument of 10 and hit the  tab
  91. key.
  92.  
  93.     Now hit the tab key again  and    type  Test.  Notice the word now
  94. appears at the    tenth column.  Now move to the beginning of the word and
  95. delete the backward character. "Test" moves back by one character.
  96.  
  97.     EMACS behaves differently in these circumstances because  the ^I
  98. handle-tab function deals with tabbing in two distinct ways.  In default
  99. conditions,  or  if  the  numeric  argument of zero is used,  handle-tab
  100. inserts a true tab character.  If, however, a non-zero    numeric argument
  101. is specified, handle-tab inserts the  correct number of spaces needed to
  102. position the cursor at the next specified tab  position.    It    does NOT
  103. insert the single tab character and hence any  editing    functions should
  104. take account of the number of spaces between tabbed columns.
  105.  
  106.     Many times you would like to take a line which has  been created
  107. using the tab character and change it to use just  spaces.   The command
  108. ^X-^D  detab-line  changes  any tabs from the point to the  end  of  the
  109. current line into the right  number  of  spaces  so  the  line    does not
  110. change.  This  is very useful for times when the file must be printed or
  111. transferred to a machine which does not understand tabs.
  112.  
  113.     Also, the inverse command,  ^X-^E  entab-lines    changes multiple
  114. spaces to tabs where possible.    This is a good way to shrink the size of
  115. large  documents,  especially  with data tables.  Both of these commands
  116. can take a numeric argument which  will  be interpreted as the number of
  117. lines to en/detab.
  118.  
  119.                                       33
  120.  
  121. Screen Formatting                 MicroEMACS Reference Manual
  122.  
  123.                Chapter 9 Summary
  124.  
  125.     In  Chapter  9    introduced some of the    formatting  features  of
  126. EMACS. Text-wrap, paragraph reformatting,  and    tabs  were  discussed in
  127. some  detail.     The commands in the following table were covered in the
  128. chapter.
  129.  
  130. Key Binding        Keystroke            Effect
  131. Add-Mode/WRAP        ^X-M[WRAP]    Add wrap mode to current buffer
  132.  
  133. Delete-Mode/WRAP    ^X-^M[WRAP]    Remove wrap mode from current buffer
  134.  
  135. Set-Fill-Column         ^X-F        Set fill column to given numeric
  136.                     argument
  137.  
  138. Fill-Paragraph        M-Q        Logically reformats the current
  139.                     paragraph
  140.  
  141. Case-Word-Upper         M-U        Text from point to end of the
  142.                     current word is changed to uppercase
  143.  
  144. Case-Word-Lower         M-L        Text from point to end of the
  145.                     current word is changed to lowercase
  146.  
  147. Case-Word-Capitalize    M-C        First word (or letter) after the
  148.                     point is capitalized
  149.  
  150. Case-Region-Upper    ^X-^U        The current region is uppercased
  151.  
  152. Case-Region-Lower    ^X-^L        The current region is lowercased
  153.  
  154. Handle-Tab        ^I        Tab interval is set to the given
  155.                     numeric argument
  156. Entab-Line        ^X-^E        Changes multiple spaces to tabs
  157.                     characters where possible
  158. Detab-Line        ^X-^D        Changes tab characters to the
  159.                     appropriate number of spaces
  160.  
  161. 34
  162.  
  163. MicroEMACS Reference Manual                 Keyboard Macros
  164.  
  165.                    Chapter 10
  166.  
  167.                 Keyboard Macros
  168.  
  169.     In many applications, it may be necessary to repeat a  series of
  170. characters or commands frequently.  For example, a paper may require the
  171. frequent repetition of a complex formula or a long name.    You may also
  172. have a series of EMACS commands that you invoke  frequently.    Keyboard
  173. macros    offer  a  convenient  method  of recording and    repeating  these
  174. commands.
  175.  
  176.     Imagine,  for  example,  you are writing a  scholarly  paper  on
  177. Asplenium platyneuron, the spleenwort fern.  Even the dedicated botanist
  178. would  probably  find  it  a  task  bordering  on  the agonizing to type
  179. Asplenium platyneuron frequently throughout the paper.      An alternative
  180. method is 'record' the name in a keyboard macro.  Try it yourself.
  181.  
  182.     The  command  ^X-(  begin-macro  starts  recording  the  all the
  183. keystrokes  and  commands  you input.    After  you've  typed  it,  enter
  184. Asplenium platyneuron.    To stop recording, type ^X-)  end-macro.   EMACS
  185. has stored all the keystrokes between  the  two commands.  To repeat the
  186. name  you've  stored,  just  enter  ^X-E  execute-macro,  and  the  name
  187. "Asplenium platyneuron" appears.  You can repeat this action as often as
  188. you want, and of course as  with  any  EMACS command, you may precede it
  189. with a numerical argument.
  190.  
  191.     Because  EMACS    records  keystrokes,  you  may    freely    intermix
  192. commands and text.  Unfortunately, you can only  store    one  macro  at a
  193. time.     Thus, if you begin to    record    another  macro,  the  previously
  194. defined macro is lost. Be careful to ensure that  you've  finished  with
  195. one macro before defining another.  If you  have  a  series  of commands
  196. that  you  would  like    to  'record'  for  future use, use the macro  or
  197. procedure facilities detailed in chapter <X>.
  198.  
  199.                                       35
  200.  
  201. Keyboard Macros                              MicroEMACS Reference Manual
  202.  
  203.                Chapter 10 Summary
  204.  
  205.     Chapter 10 covered keyboard macros.  You learned  how  to record
  206. keystrokes and how to repeat the stored sequence.
  207.  
  208. Key Binding        Keystroke        Effect
  209.  
  210. Start-Macro        ^X-(        Starts recording all keyboard input
  211.  
  212. End-Macro        ^X-)        Stops recording keystrokes for macro
  213.  
  214. Execute-Macro        ^X-E        Entire sequence of recorded
  215.                     keystrokes is replayed
  216.  
  217. 36
  218.  
  219. MicroEMACS Reference Manual                   MicroEMACS Macros
  220.  
  221.                    Chapter 11
  222.  
  223.                MicroEMACS Macros
  224.  
  225.     Macros are programs that are used to customize the editor and to
  226. perform complicated  editing  tasks.    They  may  be stored in files or
  227. buffers and may be executed using an appropriate command, or bound  to a
  228. particular  keystroke.      Portions  of    the standard start-up  file  are
  229. implement via macros, as well as the example menu system.   The execute-
  230. macro-<n>  commands  cause  the  macro,  numbered  from  1  to 40, to be
  231. executed.  The execute-file command allows you to execute a macro stored
  232. in a disk file, and the  execute-buffer  command allows you to execute a
  233. macro  stored  in  a buffer.  Macros are stored for  easy  execution  by
  234. executing files that contain the store-macro command.
  235.  
  236.     There are many different  aspects  to  the macro language within
  237. MicroEMACS.  Editor commands  are  the    various commands that manipulate
  238. text, buffers, windows, etc, within the editor.  Directives are commands
  239. which  control    what  lines get executed within a macro.  Also there are
  240. various types of variables.    Environmental  variables both control and
  241. report on different aspects  of  the editor.  User variables hold string
  242. values which may be changed and inspected.  Buffer variables  allow text
  243. to be placed into variables.  Interactive variable allow the  program to
  244. prompt the user for information.  Functions can be  used  to  manipulate
  245. all these variables.
  246.  
  247. 11.1  Variables
  248.  
  249.     Variables  in MicroEMACS can be used  to  return  values  within
  250. expressions,  as repeat counts to editing commands, or    as  text  to  be
  251. inserted into buffers and messages.  The value of these variables is set
  252. using the set  (^X-A)  command.    For    example, to set the current fill
  253. column to 64 characters, the following macro line would be used:
  254.  
  255.     set $fillcol 64
  256.  
  257.     or  to    have  the contents of %name inserted at the point in the
  258. current buffer, the command to use would be:
  259.  
  260.     insert-string %name
  261.  
  262.                                       37
  263.  
  264. MicroEMACS Macros                 MicroEMACS Reference Manual
  265.  
  266. 11.1.1    Environmental Variables
  267.  
  268.     "What good is a quote if you can't change it?"
  269.  
  270.     These variables are used to  change different aspects of the way
  271. the editor works.  Also they will return the current settings if used as
  272. part of an expression.    All environmental variable names  begin  with  a
  273. dollar sign ($) and are in lower case.
  274.  
  275. $fillcol     Current fill column
  276.  
  277. $pagelen     Number of screen lines used currently
  278.  
  279. $curwidth     Number of columns used currently
  280.  
  281. $curcol          Current column of point in current buffer
  282.  
  283. $curline     Current line of point in current buffer
  284.  
  285. $flicker     Flicker Flag set to TRUE if IBM CGA set  to  FALSE  for
  286.          most others
  287.  
  288. $cbufname     Name of the current buffer
  289.  
  290. $cfname          File name of the current buffer
  291.  
  292. $sres         Current screen resolution (CGA, MONO or EGA on the IBM-
  293.          PC  driver. LOW, MEDIUM, HIGH or  DENSE  on  the  Atari
  294.          ST1040, NORMAL on all others)
  295.  
  296. $debug         Flag to trigger macro debugging (try it...  you'll like
  297.          it!)
  298.  
  299. $status          return status    of the success of the last command (TRUE
  300.          or FALSE) usually used with !force
  301.  
  302. $palette     string used to control the palette register settings on
  303.          graphics versions. The  usually form consists of groups
  304.          of three  octal digits setting the red, green, and blue
  305.          levels.
  306.  
  307. $asave         The number  of  inserted  characters  between automatic
  308.          file-saves in ASAVE mode.
  309.  
  310. $acount          The  countdown  of  inserted  characters until the next
  311.          save-file.
  312.  
  313. $lastkey     Last keyboard character typed
  314.  
  315. $curchar     Character currently at the point
  316.  
  317. 38
  318.  
  319. MicroEMACS Reference Manual                   MicroEMACS Macros
  320.  
  321. $discmd          Flag to  disable the echoing of messages on the command
  322.          line
  323.  
  324. $version     Contains the current MicroEMACS version number
  325.  
  326. $progname     Always  contains  the    string "MicroEMACS" for standard
  327.          MicroEMACS. Could  be something else if used as part of
  328.          someone else's program
  329.  
  330. $seed         integer seed of the random number generator
  331.  
  332. $disinp          Flag  to  disable  the  echoing  of  characters  during
  333.          command line input
  334.  
  335.     Obviously, many more of these  variables  will    be  available in
  336. future releases of MicroEMACS.    (Yes,  send a vote for your favorite new
  337. environmental variables today).
  338.  
  339. 11.1.2    User variables
  340.  
  341.     User  variables  allow    you,  the  user,  to  store strings  and
  342. manipulate them.  These strings can be pieces of text, numbers    (in text
  343. form), or the logical values TRUE and FALSE.    These  variables  can be
  344. combined, tested, inserted  into  buffers, and otherwise used to control
  345. the way your macros execute.   At  the    moment, up to 100 user variables
  346. may be    in  use  in  one editing session.  All users variable names must
  347. begin with a percent  sign  (%) and may contain any printing characters.
  348. Only the first 10 characters are significant (i.e differences beyond the
  349. tenth character are ignored).  Most operators will truncate strings to a
  350. length of 128 characters.
  351.  
  352. 11.1.3    Buffer Variables
  353.  
  354.     Buffer    variables  are    special in that they can only be queried
  355. and cannot be set.  What buffer variables are is a way to take text from
  356. a buffer and place it  in a variable. For example, if I have a buffer by
  357. the name of RIGEL2, and it contains the text:
  358.  
  359.     Richmond
  360.     Lafayette
  361.     <*>Bloomington        (where <*> is the current point)
  362.     Indianapolis
  363.     Gary
  364.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  365.  
  366.     and within a command I reference #rigel2, like:
  367.  
  368.     insert-string #rigel2
  369.  
  370.                                       39
  371.  
  372. MicroEMACS Macros                 MicroEMACS Reference Manual
  373.  
  374.     MicroEMACS would start at the current point in the RIGEL2 buffer
  375. and  grab  all the text up to the end of that line and pass  that  back.
  376. Then it would advance the point to the beginning of the next line. Thus,
  377. after our  last command executes, the string "Bloomington" gets inserted
  378. into the current buffer, and the buffer RIGEL2 now looks like this:
  379.  
  380.     Richmond
  381.     Lafayette
  382.     Bloomington
  383.     <*>Indianapolis         (where <*> is the current point)
  384.     Gary
  385.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  386.  
  387.     as you have probably noticed,  a buffer variable consists of the
  388. buffer name, preceded by a pound sign (#).
  389.  
  390. 11.1.4    Interactive variables
  391.  
  392.     Interactive variables are  actually  a method to prompt the user
  393. for a string.  This is done by using an at sign (@) followed either with
  394. a quoted string, or a variable containing a string.   The  string is the
  395. placed on the  bottom line, and the editor waits for the user to type in
  396. a string.  Then the  string  typed  in    by  the users is returned as the
  397. value of the interactive variable.  For example:
  398.  
  399.     set %quest "What file? "
  400.     find-file @%quest
  401.  
  402.     will ask the user for a file name, and then attempt to find it.
  403.  
  404. 11.2  Functions
  405.  
  406.     Functions can be  used    to manipulate variables in various ways.
  407. Functions can have one,  two,  or three arguments.  These arguments will
  408. always    be  placed  after the function on the current command line.  For
  409. example, if we wanted to increase the current fill column by  two, using
  410. emacs's set (^X-A) command, we would write:
  411.  
  412.     set $fillcol &add $fillcol 2
  413.      \    \      \      \     \____second operand
  414.       \     \    \      \_________first operand
  415.        \      \     \_______________function to execute
  416.         \       \_____________________variable to set
  417.          \___________________________set (^X-A) command
  418.  
  419.     Function names always begin with  the  ampersand  (&) character,
  420. and  are  only    significant to the  first  three  characters  after  the
  421. ampersand.    Functions  will  normal  expect  one  of    three  types  of
  422. arguments, and will automatically convert types when needed.
  423.  
  424. 40
  425.  
  426. MicroEMACS Reference Manual                   MicroEMACS Macros
  427.  
  428. <num>         an ascii string of digits  which  is  interpreted  as a
  429.          numeric value.  Any string  which does not start with a
  430.          digit or a minus sign (-) will be considered zero.
  431.  
  432. <str>         An arbitrary string  of  characters.     At  the moment,
  433.          strings are limited to 128 characters in length.
  434.  
  435. <log>         A logical value  consisting  of  the  string  "TRUE" or
  436.          "FALSE".  Numeric strings will also evaluate to "FALSE"
  437.          if they are equal to zero, and "TRUE" if they    are non-
  438.          zero.    Arbitrary text    strings  will  have the value of
  439.          "FALSE".
  440.  
  441.     A list    of  the  currently  available  functions  follows: (Once
  442. again, send in those votes on what kind of functions  you  would like to
  443. see  added!)  Functions  are  always  used in lower case, the  uppercase
  444. letters  in  the  function table are the short form of the function (i.e
  445. &div for ÷).
  446.  
  447. Numeric Functions:    (returns <num>)
  448.  
  449. &ADD        <num> <num>    Add two numbers
  450. &SUB        <num> <num>    Subtract the second number from the first
  451. &TIMes        <num> <num>    Multiply two numbers
  452. &DIVide         <num> <num>    Divide the first number by the second
  453.                 giving an integer result
  454. &MOD        <num> <num>    Return the reminder of dividing the
  455.                 first number by the second
  456. &NEGate         <neg>        Multiply the arg by -1
  457. &LENgth         <str>        Returns length of string
  458. &ASCii        <str>        Return the ascii code of the first
  459.                 character in <str>
  460. &RND        <num>        Returns a random integer between 1 and <num>
  461. &ABS        <num>        Returns the absolute value of <num>
  462.  
  463. String manipulation functions:    (returns <str>)
  464.  
  465. &CAT        <str> <str>    Concatenate the two strings to form one
  466. &LEFt        <str> <num>    return the <num> leftmost characters
  467.                 from <str>
  468. &RIGht        <str> <num>    return the <num> rightmost characters
  469.                 from <str>
  470. &MID        <str> <num1> <num2>
  471.                 Starting from <num1> position in <str>,
  472.                 return <num2> characters.
  473. &UPPer        <str>        Uppercase <str>
  474. &LOWer        <str>        lowercase <str>
  475. &CHR        <num>        return a string with the character
  476.                 represented by ascii code <num>
  477. >K                return a string containing a single
  478.                 keystroke from the user
  479.  
  480. Logical Testing functions:    (returns <log>)
  481.  
  482.                                       41
  483.  
  484. MicroEMACS Macros                 MicroEMACS Reference Manual
  485.  
  486. &NOT        <log>        Return the opposite logical value
  487. &AND        <log1> <log2>    Returns TRUE if BOTH logical arguments
  488.                 are TRUE
  489. &OR        <log1> <log2>    Returns TRUE if either argument
  490.                 is TRUE
  491. &EQUal        <num> <num>    If <num> and <num> are numerically
  492.                 equal, return TRUE
  493. &LESs        <num1> <num2>    If <num1> is less than <num2>, return
  494.                 TRUE.
  495. &GREater    <num1> <num2>    If <num1> is greater than, or equal to
  496.                 <num2>, return TRUE.
  497. &SEQual         <str1> <str2>    If the two strings are the same, return
  498.                 TRUE.
  499. &SLEss        <str1> <str2>    If <str1> is less alphabetically than
  500.                 <str2>, return TRUE.
  501. &SGReater    <str1> <str2>    If <str1> is alphabetically greater than
  502.                 or equal to <str2>, return TRUE.
  503.  
  504. Special Functions:
  505.  
  506. &INDirect    <str>        Evaluate <str> as a variable.
  507.  
  508.     This last function deserves more explanation. The  &IND function
  509. evaluates its argument, takes the resulting string, and then uses  it as
  510. a variable name.  For example, given the following code sequence:
  511.  
  512.     ; set up reference table
  513.  
  514.     set %one    "elephant"
  515.     set %two    "giraffe"
  516.     set %thee    "donkey"
  517.  
  518.     set %index "two"
  519.     insert-string &ind %index
  520.  
  521.     the  string  "giraffe"    would have been inserted at the point in
  522. the current buffer.  This indirection  can  be safely nested up to about
  523. 10 levels.
  524.  
  525. 11.3  Directives
  526.  
  527.     Directives are commands which only operate  within  an executing
  528. macro, i.e  they  do  not  make sense as a single command. As such, they
  529. cannot be called up singly or bound to keystroke.  Used  within  macros,
  530. they control what lines are executed and in what order.
  531.  
  532.     Directives always start with the exclamation mark  (!) character
  533. and must be the first thing placed on a line. Directives executed singly
  534. (via the execute-command-line command) interactively will be ignored.
  535.  
  536. 42
  537.  
  538. MicroEMACS Reference Manual                   MicroEMACS Macros
  539.  
  540. 11.3.1    !ENDM Directive
  541.  
  542.     This  directive  is  used to terminate a macro being stored. For
  543. example, if a file is being executed contains the text:
  544.  
  545.     ;    Read in a file in view mode, and make the window red
  546.  
  547.     26    store-macro
  548.         find-file @"File to view: "
  549.         add-mode "view"
  550.         add-mode "red"
  551.     !endm
  552.  
  553.     write-message "[Consult macro has been loaded]"
  554.  
  555.     only the lines between the  store-macro  command  and  the !ENDM
  556. directive are stored in macro 26.
  557.  
  558. 11.3.2    !FORCE Directive
  559.  
  560.     When  MicroEMACS executes a macro, if  any  command  fails,  the
  561. macro is  terminated  at  that    point. If a line is preceded by a !FORCE
  562. directive, execution  continues weather the command succeeds or not. For
  563. example:
  564.  
  565.     ;    Merge the top two windows
  566.  
  567.     save-window        ;remember what window we are at
  568.     1 next-window        ;go to the top window
  569.     delete-window        ;merge it with the second window
  570.     !force restore-window    ;This will continue regardless
  571.     add-mode "red"
  572.  
  573. 11.3.3    !IF, !ELSE, and !ENDIF Directives
  574.  
  575.     This  directive  allows  statements  only  to be executed  if  a
  576. condition specified in the  directive  is met.    Every line following the
  577. !IF directive, until  the  first  !ELSE  or  !ENDIF  directive,  is only
  578. executed  if  the  expression following the !IF directive evaluates to a
  579. TRUE value.   For  example,  the  following  macro  segment  creates the
  580. portion of a text file automatically.  (yes  believe  me,  this  will be
  581. easier to understand then that last explanation....)
  582.  
  583.     !if &sequal %curplace "timespace vortex"
  584.         insert-string "First, rematerialize~n"
  585.     !endif
  586.     !if &sequal %planet "earth"    ;If we have landed on earth...
  587.  
  588.                                       43
  589.  
  590. MicroEMACS Macros                 MicroEMACS Reference Manual
  591.  
  592.         !if &sequal %time "late 20th century"  ;and we are then
  593.             write-message "Contact U.N.I.T."
  594.         !else
  595.             insert-string "Investigate the situation....~n"
  596.             insert-string "(SAY 'stay here Sara')~n"
  597.         !endif
  598.     !else
  599.         set %conditions @"Atmosphere conditions outside? "
  600.         !if &sequal %conditions "safe"
  601.             insert-string &cat "Go outside......" "~n"
  602.             insert-string "lock the door~n"
  603.         !else
  604.             insert-string "Dematerialize..try somewhere else"
  605.             newline
  606.         !endif
  607.     !endif
  608.  
  609. 11.3.4    !GOTO Directive
  610.  
  611.     Flow can be controlled within a MicroEMACS macro using the !GOTO
  612. directive. It takes as an argument a label. A label  consists  of a line
  613. starting  with an asterisk (*) and then an  alphanumeric  label.    Only
  614. labels in the currently executing macro can be jumped to, and  trying to
  615. jump to  a  non-existing  label  terminates  execution    of a macro.  For
  616. example..
  617.  
  618.     ;Create a block of DATA statements for a BASIC program
  619.  
  620.         insert-string "1000 DATA "
  621.         set %linenum 1000
  622.  
  623.     *nxtin
  624.         update-screen        ;make sure we see the changes
  625.         set %data @"Next number: "
  626.         !if &equal %data 0
  627.             !goto finish
  628.         !endif
  629.  
  630.         !if &greater $curcol 60
  631.             2 delete-previous-character
  632.             newline
  633.             set %linenum &add %linenum 10
  634.             insert-string &cat %linenum " DATA "
  635.         !endif
  636.  
  637.         insert-string &cat %data ", "
  638.         !goto nxtin
  639.  
  640.     *finish
  641.  
  642.         2 delete-previous-character
  643.  
  644. 44
  645.  
  646. MicroEMACS Reference Manual                   MicroEMACS Macros
  647.  
  648.         newline
  649.  
  650. 11.3.5    !RETURN Directive
  651.  
  652.     The !RETURN Directive  causes  the current macro to exit, either
  653. returning to the caller (if any) or to interactive mode.  For example:
  654.  
  655.     ;    Check the monitor type and set %mtyp
  656.  
  657.     !if &sres "CGA"
  658.         set %mtyp 1
  659.         !return
  660.     !else
  661.         set %mtyp 2
  662.     !endif
  663.  
  664.     insert-string "You are on a MONOCHROME machine!~n"
  665.  
  666.                                       45
  667.  
  668. A                         MicroEMACS Reference Manual
  669.  
  670.                    Appendix A
  671.  
  672.               MicroEMACS commands
  673.  
  674.     Below  is a complete list of the commands  in  EMACS,  the  keys
  675. normally used to do the command,  and  what the command does.  Remember,
  676. on some computers there may also  be  additional ways of using a command
  677. (cursor keys and special function keys for example).
  678.  
  679. Command                 Binding         Meaning
  680. abort-command         ^G    This allows the user to abort out of any
  681.                 command that is waiting for input
  682.  
  683. add-mode         ^X-M    Add a mode to the current buffer
  684.  
  685. add-global-mode          M-M    Add a global mode for all new buffers
  686.  
  687. apropos                  M-A    List out commands whose name contains
  688.                 the string specified
  689.  
  690. backward-character     ^B    Move one character to the left
  691.  
  692. begin-macro         ^X-(    Begin recording a keyboard macro
  693.  
  694. beginning-of-file     M-<    Move to the beginning of the file in
  695.                 the current buffer
  696.  
  697. beginning-of-line     ^A    Move to the beginning of the current line
  698.  
  699. bind-to-key         M-K    Bind a key to a function
  700.  
  701. buffer-position          ^X-=    List the position of the cursor in the
  702.                 current window on the command line
  703.  
  704. case-region-lower     ^X-^L    Make a marked region all lower case
  705.  
  706. case-region-upper     ^X-^U    Make a marked region all upper case
  707.  
  708. case-word-capitalize     M-C    Capitalize the following word
  709.  
  710. case-word-lower          M-L    Lower case the following word
  711.  
  712. case-word-upper          M-U    Upper case the following word
  713.  
  714. change-file-name     ^X-N    Change the name of the file in the
  715.                 current buffer
  716.  
  717. 46
  718.  
  719. MicroEMACS Reference Manual                           A
  720.  
  721. change-screen-size     M-^S    Change the number of lines of the screen
  722.                 currently being used
  723.  
  724. change-screen-width     M-^T    Change the number of columns of the
  725.                 screen currently being used
  726.  
  727. clear-and-redraw     ^L    Clear the physical screen and redraw it
  728.  
  729. clear-message-line    (none)    Clear the command line
  730.  
  731. copy-region         M-W    Copy the currently marked region into
  732.                 the kill buffer
  733.  
  734. count-words         M-^C    Count how many words, lines and
  735.                 characters are in the current marked region
  736.  
  737. ctlx-prefix         ^X    Change the key used as the ^X prefix
  738.  
  739. delete-blank-lines     ^X-^O    Delete all blank lines around the cursor
  740.  
  741. delete-buffer         ^X-K    Delete a buffer which is not being
  742.                 currently displayed in a window
  743.  
  744. delete-mode         ^X-^M    Turn off a mode in the current buffer
  745.  
  746. delete-global-mode     M-^M    Turn off a global mode
  747.  
  748. delete-next-character     ^D    Delete the character following the cursor
  749.  
  750. delete-next-word     M-D    Delete the word following the cursor
  751.  
  752. delete-other-windows     ^X-1    Make the current window cover the entire
  753.                 screen
  754.  
  755. delete-previous-character^H    Delete the character to the left of the
  756.                 cursor
  757.  
  758. delete-previous-word     M-^H    Delete the word to the left of the cursor
  759.  
  760. delete-window         ^X-0    Remove the current window from the screen
  761.  
  762. describe-bindings    (none)    Make a list of all legal commands
  763.  
  764. describe-key         ^X-?    Describe what command is bound to a
  765.                 keystroke sequence
  766.  
  767. detab-line         ^X-^D    Change all tabs in a line to the
  768.                 equivalent spaces
  769.  
  770. end-macro         ^X-)    stop recording a keyboard macro
  771.  
  772. end-of-file         M->    Move cursor to the end of the current buffer
  773.  
  774. end-of-line         ^E    Move to the end of the current line
  775.  
  776.                                       47
  777.  
  778. A                         MicroEMACS Reference Manual
  779.  
  780. entab-line         ^X-^E    Change multiple spaces to tabs where
  781.                 possible
  782.  
  783. exchange-point-and-mark  ^X-^X    Move cursor to the last marked spot,
  784.                 make the original position be marked
  785.  
  786. execute-buffer        (none)    Execute a buffer as a macro
  787.  
  788. execute-command-line    (none)    Execute a line typed on the command
  789.                 line as a macro command
  790.  
  791. execute-file         FNB    Execute a file as a macro
  792.  
  793. execute-macro         ^X-E    Execute the keyboard macro (play back
  794.                 the recorded keystrokes)
  795. execute-macro-<n>    (none)    Execute numbered macro <N> where <N> is
  796.                 an integer from 1 to 40
  797.  
  798. execute-named-command     M-X    Execute a command by name
  799.  
  800. execute-procedure     M-^E    Execute a procedure by name
  801.  
  802. exit-emacs         ^X-^C    Exit EMACS. If there are unwritten,
  803.                 changed buffers EMACS will ask to confirm
  804.  
  805. fill-paragraph         M-Q    Fill the current paragraph
  806.  
  807. filter-buffer         ^X-#    Filter the current buffer through an
  808.                 external filter
  809.  
  810. find-file         ^X-^F    Find a file to edit in the current window
  811.  
  812. forward-character     ^F    Move cursor one character to the right
  813.  
  814. goto-line         M-G    Goto a numbered line
  815.  
  816. goto-matching-fence     M-^F    Goto the matching fence
  817.  
  818. grow-window         ^X-^    Make the current window larger
  819.  
  820. handle-tab         ^I    Insert a tab or set tab stops
  821.  
  822. hunt-forward         FN=    Hunt for the next match of the last
  823.                 search string
  824.  
  825. hunt-backward         FN>    Hunt for the last match of the last
  826.                 search string
  827.  
  828. help             M-?    Read EMACS.HLP into a buffer and display it
  829.  
  830. i-shell                  ^X-C    Shell up to a new command processor
  831.  
  832. incremental-search     ^X-S    Search for a string, incrementally
  833.  
  834. 48
  835.  
  836. MicroEMACS Reference Manual                           A
  837.  
  838. insert-file         ^X-^I    insert a file at the cursor in the
  839.                 current file
  840.  
  841. insert-space         ^C    Insert a space to the right of the cursor
  842.  
  843. insert-string        (none)    Insert a string at the cursor
  844.  
  845. kill-paragraph         M-^W    Delete the current paragraph
  846.  
  847. kill-region         ^W    Delete the current marked region, moving
  848.                 it to the kill buffer
  849.  
  850. kill-to-end-of-line     ^K    Delete the rest of the current line
  851.  
  852. list-buffers         ^X-^B    List all existing buffers
  853.  
  854. meta-prefix         <ESC>    Key used to precede all META commands
  855.  
  856. move-window-down     ^X-^N    Move all the lines in the current window down
  857.  
  858. move-window-up         ^X-^P    Move all the lines in the current window up
  859.  
  860. name-buffer         M-^N    Change the name of the current buffer
  861.  
  862. newline                  ^M    Insert a <NL> at the cursor
  863.  
  864. newline-and-indent     ^J    Insert a <NL> at the cursor and indent
  865.                 the new line the same as the preceding line
  866.  
  867. next-buffer         ^X-X    Bring the next buffer in the list into
  868.                 the current window
  869.  
  870. next-line         ^N    Move the cursor down one line
  871.  
  872. next-page         ^V    Move the cursor down one page
  873.  
  874. next-paragraph         M-N    Move cursor to the next paragraph
  875.  
  876. next-window         ^X-O    Move cursor to the next window
  877.  
  878. next-word         M-F    Move cursor to the beginning of the
  879.                 next word
  880.  
  881. open-line         ^O    Open a line at the cursor
  882.  
  883. pipe-command         ^X-@    Execute an external command and place
  884.                 its output in a buffer
  885.  
  886. previous-line         ^P    Move cursor up one line
  887.  
  888. previous-page         ^Z    Move cursor up one page
  889.  
  890. previous-paragraph     M-P    Move back one paragraph
  891.  
  892.                                       49
  893.  
  894. A                         MicroEMACS Reference Manual
  895.  
  896. previous-window          ^X-P    Move the cursor to the last window
  897.  
  898. previous-word         M-B    Move the cursor to the beginning of the
  899.                 word to the left of the cursor
  900.  
  901. query-replace-string     M-^R    Replace all of one string with another
  902.                 string, interactively querying the user
  903.  
  904. quick-exit         M-Z    Exit EMACS, writing out all changed buffers
  905.  
  906. quote-character          ^Q    Insert the next character literally
  907.  
  908. read-file         ^X-^R    Read a file into the current buffer
  909.  
  910. redraw-display         M-^L    Redraw the display, centering the
  911.                 current line
  912.  
  913. resize-window         ^X-W    Change the number of lines in the
  914.                 current window
  915.  
  916. restore-window        (none)    Move cursor to the last saved window
  917.  
  918. replace-string         M-R    Replace all occurrences of one string
  919.                 with another string from the cursor
  920.                 to the end of the buffer
  921.  
  922. reverse-incremental-search^X-R    Search backwards, incrementally
  923.  
  924. run             M-^E    Execute a named procedure
  925.  
  926. save-file         ^X-^S    Save the current buffer if it is changed
  927.  
  928. save-window        (none)    Remember current window (to restore later)
  929.  
  930. scroll-next-up         M-^Z    Scroll the next window up
  931.  
  932. scroll-next-down     M-^V    Scroll the next window down
  933.  
  934. search-forward         ^S    Search for a string
  935.  
  936. search-reverse         ^R    Search backwards for a string
  937.  
  938. select-buffer         ^X-B    Select a buffer to display in the
  939.                 current window
  940.  
  941. set             ^X-A    Set a variable to a value
  942.  
  943. set-encryption-key     M-E    Set the encryption key of the current buffer
  944.  
  945. set-fill-column          ^X-F    Set the current fill column
  946.  
  947. set-mark            Set the mark
  948.  
  949. shell-command         ^X-!    Execute an external command
  950.  
  951. 50
  952.  
  953. MicroEMACS Reference Manual                           A
  954.  
  955. shrink-window         ^X-^Z    Make the current window smaller
  956.  
  957. split-current-window     ^X-2    Split the current window in two
  958.  
  959. store-macro        (none)    Store the following macro lines to a
  960.                 numbered macro
  961.  
  962. store-procedure         (none)    Store the following macro lines to a
  963.                 named procedure
  964.  
  965. transpose-characters     ^T    Transpose the character at the cursor
  966.                 with the character to the left
  967.  
  968. trim-line         ^X-^T    Trim any trailing whitespace from line
  969.  
  970. unbind-key         M-^K    Unbind a key from a function
  971.  
  972. universal-argument     ^U    Execute the following command 4 times
  973.  
  974. unmark-buffer         M-~    Unmark the current buffer (so it is
  975.                 no longer changed)
  976.  
  977. update-screen        (none)    Force a screen update during macro execution
  978.  
  979. view-file         ^X-^V    Find a file,and put it in view mode
  980.  
  981. wrap-word         M-FNW    Wrap the current word, this is an
  982.                 internal function
  983.  
  984. write-file         ^X-^W    Write the current buffer under a new
  985.                 file name
  986.  
  987. write-message        (none)    Display a string on the command line
  988.  
  989. yank             ^Y    yank the kill buffer into the current
  990.                 buffer at the cursor
  991.  
  992.                                       51
  993.  
  994. B                         MicroEMACS Reference Manual
  995.  
  996.                    Appendix B
  997.  
  998.               MicroEMACS Bindings
  999.  
  1000.     Below is a complete list of the key bindings used in MicroEMACS.
  1001. This can be used as a wall chart reference for MicroEMACS commands.
  1002.  
  1003.              Default Key Bindings for MicroEmacs 3.8i
  1004.  
  1005.  ^A   Move to start of line          ESC A   Apropos (list some commands)
  1006.  ^B   Move backward by characters     ESC B   Backup by words
  1007.  ^C   Insert space              ESC C   Initial capitalize word
  1008.  ^D   Forward delete              ESC D   Delete forward word
  1009.  ^E   Goto end of line              ESC E   Reset Encryption Key
  1010.  ^F   Move forward by characters      ESC F   Advance by words
  1011.  ^G   Abort out of things          ESC G   Go to a line
  1012.  ^H   Backward delete
  1013.  ^I   Insert tab/Set tab stops
  1014.  ^J   Insert CR-LF, then indent
  1015.  ^K   Kill forward              ESC K   Bind Key to function
  1016.  ^L   Refresh the screen          ESC L   Lower case word
  1017.  ^M   Insert CR-LF              ESC M   Add global mode
  1018.  ^N   Move forward by lines          ESC N   Goto End paragraph
  1019.  ^O   Open up a blank line
  1020.  ^P   Move backward by lines          ESC P   Goto Beginning of paragraph
  1021.  ^Q   Insert literal              ESC Q   Fill current paragraph
  1022.  ^R   Search backwards              ESC R   Search and replace
  1023.  ^S   Search forward
  1024.  ^T   Transpose characters
  1025.  ^U   Repeat command four times       ESC U   Upper case word
  1026.  ^V   Move forward by pages          ESC V   Move backward by pages
  1027.  ^W   Kill region              ESC W   Copy region to kill buffer
  1028.  ^Y   Yank back from killbuffer       ESC X   Execute named command
  1029.  ^Z   Move backward by pages          ESC Z   Save all buffers and exit
  1030.  
  1031.  ESC ^C   Count words in region       ESC ~   Unmark current buffer
  1032.  ESC ^F   Goto matching fence          ESC !   Reposition window
  1033.  ESC ^H   Delete backward word          ESC <   Move to start of buffer
  1034.  ESC ^K   Unbind Key from function    ESC >   Move to end of buffer
  1035.  ESC ^L   Reposition window          ESC .   Set mark
  1036.  ESC ^M   Delete global mode          ESC space    Set mark
  1037.  ESC ^N   Rename current buffer       ESC rubout   Delete backward word
  1038.  ESC ^R   Search & replace w/query      rubout   Backward delete
  1039.  ESC ^S   Change screen rows
  1040.  ESC ^T   Change screen columns
  1041.  ESC ^V   Scroll next window down
  1042.  ESC ^W   Delete Paragraph
  1043.  
  1044. 52
  1045.  
  1046. MicroEMACS Reference Manual                           B
  1047.  
  1048.  ESC ^Z   Scroll next window up
  1049.  
  1050.  ^X ?    Describe a key           ^X !   Run 1 command in a subjob
  1051.  ^X =    Show the cursor position   ^X @    Pipe DOS command to buffer
  1052.  ^X ^    Enlarge display window       ^X #   Filter buffer thru DOS filter
  1053.  ^X 0    Delete current window       ^X (   Begin macro
  1054.  ^X 1    Delete other windows       ^X )   End macro
  1055.  ^X 2    Split current window
  1056.                    ^X A   Set variable value
  1057.  ^X ^B     Display buffer list       ^X B   Switch a window to a buffer
  1058.  ^X ^C     Exit MicroEMACS       ^X C   Start a new command processor
  1059.                    ^X D   Suspend MicroEMACS (BSD4.2 only)
  1060.                    ^X E   Execute macro
  1061.  ^X ^F     Find file           ^X F   Set fill column
  1062.  ^X ^I     Insert file
  1063.                    ^X K   Delete buffer
  1064.  ^X ^L     Lower case region
  1065.  ^X ^M     Delete Mode           ^X M   Add a mode
  1066.  ^X ^N     Move window down       ^X N   Rename current filename
  1067.  ^X ^O     Delete blank lines       ^X O   Move to the next window
  1068.  ^X ^P     Move window up            ^X P   Move to the previous window
  1069.  ^X ^R     Get a file from disk       ^X R   Incremental reverse search
  1070.  ^X ^S     Save current file       ^X S   Incremental forward search
  1071.  ^X ^U     Upper case region
  1072.  ^X ^V     View file
  1073.  ^X ^W     Write a file to disk       ^X W   resize Window
  1074.  ^X ^X     Swap "." and mark       ^X X   Use next buffer
  1075.  ^X ^Z     Shrink window           ^X Z   Enlarge display window
  1076.  
  1077. Only under PCDOS:
  1078.  <ALT>-S Hunt forward         SHIFT <F1> - <F10>
  1079.  <ALT>-R Hunt backward         Execute macros 1 - 10
  1080.  
  1081. Usable Modes
  1082. WRAP     Lines going past right margin "wrap" to a new line
  1083. VIEW     Read-Only mode where no modifications are allowed
  1084. CMODE     Change behavior of some commands to work with C better
  1085. EXACT     Exact case matching on search strings
  1086. OVER     Overwrite typed characters instead of inserting them
  1087. CRYPT     Current buffer will be encrypted on write, decrypted on read
  1088. MAGIC     Use regular expression matching in searches
  1089. ASAVE     Save the file every 256 inserted characters
  1090.  
  1091. WHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK    Sets foreground color
  1092. white/cyan/magenta/yellow/blue/red/green/black    Sets background color
  1093.  
  1094.                                       53
  1095.  
  1096. C                         MicroEMACS Reference Manual
  1097.  
  1098.                    Appendix C
  1099.  
  1100.                Supported machines
  1101.  
  1102.     The following table lists all the hardware/compilers for which I
  1103. currently support MicroEMACS.    This  is  not  exclusive of all machines
  1104. which MicroEMACS will  run on, but I have either run it myself, or had a
  1105. first hand report of it running.
  1106.  
  1107. Hardware    OS        Compiler    Comments
  1108. VAX 780         UNIX V5         native
  1109.         UNIX V7         native
  1110.         BSD 4.2         native        job control supported
  1111.         *VMS        native        only some terminals supported
  1112.  
  1113. NCR Tower    UNIX V5         native
  1114.  
  1115. Fortune 32:16    UNIX V7         native
  1116.  
  1117. IBM-PC        MSDOS 2/3.2    Lattice 2.15    Large CODE/Large DATA
  1118.                 AZTEC 3.4e    Small CODE/Large DATA
  1119.                 *MSC 4.0
  1120.                 *MWC 86
  1121.  
  1122. HP150        MSDOS        Lattice 2.15    Function key labels
  1123.                         for the touch screen
  1124.  
  1125. HP110        MSDOS        Lattice 2.15
  1126.                 Aztec 3.4e
  1127.  
  1128. *Data General 10
  1129.         MSDOS        Lattice 2.15
  1130.  
  1131. *Texas Instruments Professional
  1132.         MSDOS        Lattice 2.15
  1133.  
  1134. Amiga        Intuition    Lattice 3.03    no mouse or menus yet
  1135.                 *Aztec 3
  1136.  
  1137. ST520        TOS        Lattice 3.10    no menus yet,
  1138.                         no shell commands
  1139.  
  1140. Systems to be supported (i.e some code is already written:)
  1141. Macintosh    Finder 5.0    Aztec
  1142.  
  1143. *means that I do not own or have access to the listed compiler and/or
  1144.  machine and must rely upon others to help support it.
  1145.  
  1146. 54
  1147.  
  1148. MicroEMACS Reference Manual                           D
  1149.  
  1150.                    Appendix D
  1151.  
  1152.             Machine Dependent Notes
  1153.  
  1154.     This   appendix   lists   some     notes    specific  to  individual
  1155. implementations  of MicroEMACS. Every attempt has  been  made  to  allow
  1156. EMACS to be identical on all  machines,  but  we have also tried to take
  1157. advantage of function keys, cursor  keys, mice, and special screen modes
  1158. where possible.
  1159.  
  1160. D.1  IBM-PC/XT/AT and its clones
  1161.  
  1162.     The  IBM-PC  family  of computers is supported with a variety of
  1163. different display adapters.  EMACS will attempt to discover what adapter
  1164. is connected and use the proper driver for it. Below is  a  list  of the
  1165. currently supported video adapters:
  1166.  
  1167. Adapter                         $sres        Original mode used
  1168. Monochrome Graphics Adapter    MONO        MONO
  1169. Color Graphics Adapter        CGA        CGA
  1170. Enhanced graphics Adapter    EGA        CGA
  1171.  
  1172.     EMACS also takes advantage of various function keys and the keys
  1173. on the keypad on an IBM-PC.  The function keys    are  initially not bound
  1174. to any particular functions (except by the emacs.rc  startup  file), but
  1175. the keypad keys do default to the following:
  1176.  
  1177. Keypad key    Function
  1178. Home        beginning-of-file
  1179. CSRS UP         previous-line
  1180. Pg Up        previous-page
  1181. CSRS LEFT    backward-character
  1182. CSRS RIGHT    forward-character
  1183. End        end-of-file
  1184. CSRS DOWN    next-line
  1185. Pg Dn        Next-page
  1186.  
  1187.     All these special keys    are  indicated in EMACS macros by use of
  1188. the FN prefix.    Below is a list of many of the keys and  the  codes used
  1189. to specify them.  Also the codes may be gotten by using the describe-key
  1190. (^X ?) command on the suspect key.
  1191.  
  1192.                                       55
  1193.  
  1194. D                         MicroEMACS Reference Manual
  1195.  
  1196.             IBM PC function keys in MicroEmacs
  1197.  
  1198.     function    Function    ^function    Alt-function
  1199.  f1)      FN;          FNT          FN^          FNh
  1200.  f2)      FN<          FNU          FN_          FNi
  1201.  f3)      FN=          FNV          FN`          FNj
  1202.  f4)      FN>          FNW          FNa          FNk
  1203.  f5)      FN?          FNX          FNb          FNl
  1204.  f6)      FN@          FNY          FNc          FNm
  1205.  f7)      FNA          FNZ          FNd          FNn
  1206.  f8)      FNB          FN[          FNe          FNo
  1207.  f9)      FNC          FN\          FNf          FNp
  1208. f10)      FND          FN]          FNg          FNq
  1209.  
  1210. home)      FNG                  FNw
  1211. CuUp)      FNH
  1212. PgUp)      FNI                  FN {Alt 132}
  1213. CuLf)      FNK                  FNs
  1214.  5  )
  1215. CuRt)      FNM                  FNt
  1216.  End)      FNO                  FNu
  1217. CuDn)      FNP
  1218. PgDn)      FNQ                  FNv
  1219.  Ins)      FNR
  1220.  Del)      FNS
  1221.  
  1222. 56
  1223.  
  1224. MicroEMACS Reference Manual                           D
  1225.  
  1226. D.2  Atari 520/1040ST
  1227.  
  1228.     The ATARI ST family of computers have a dual personality.   They
  1229. may use either a monochrome or a color screen. EMACS supports two screen
  1230. resolutions on each monitor.
  1231.  
  1232. Monitor $sres size #color $palette format
  1233. Color    LOW    40x25    16    000111222333444555666777
  1234.     MEDIUM    80x25    4    000111222333
  1235. Mono    HIGH    80x25    2    000
  1236.     DENSE    80x40    2    000
  1237.  
  1238.     The $palette environment variable can  be  used  to  change what
  1239. color  is  associated  with each color name.  With a color monitor, each
  1240. group  of three digits indicates an octal  number  specifying  the  RED,
  1241. GREEN  and BLUE levels of that color.  Each color digit can vary from  0
  1242. to  7.      For example, the initial setting of $palette in LOW resolution
  1243. is:
  1244.  
  1245.     000700070770007707077777
  1246.  
  1247.     which broken up is:
  1248.  
  1249.     000 700 070 770 007 707 077 777
  1250.  
  1251.     which means:
  1252.  
  1253.     000    Black
  1254.     700    Red
  1255.     070    Green
  1256.     770    Yellow
  1257.     007    Blue
  1258.     707    Magenta
  1259.     077    Cyan
  1260.     777    White
  1261.  
  1262.      Note: DENSE mode is not yet supported in  3.8i.    It  will be
  1263.      soon
  1264.  
  1265.     Also the mouse generates FN prefix codes when moved, or when one
  1266. of  the  two  buttons is pressed. Initially the movement of the mouse is
  1267. bound to movement of the cursor,  and  the left mouse button generates a
  1268. set-mark (M-space) command.   The  cursor keys and the function keys are
  1269. bound similarly to IBM-PC.
  1270.  
  1271.                                       57
  1272.  
  1273. D                         MicroEMACS Reference Manual
  1274.  
  1275. D.3  Amiga 1000
  1276.  
  1277.     The Commodore AMIGA 1000 version  of  MicroEMACS  does    not have
  1278. extensive support of the mouse or of pull down menus as of yet.  It does
  1279. however come up in a  window, and it is possible to re-size it to run in
  1280. different sized  windows.  The M-^S change-screen-size takes its numeric
  1281. argument as the  new number of lines for EMACS to use.    The M-^T change-
  1282. screen-width  command  allows  you to change the number of columns EMACS
  1283. will  use.  The defaults for these are 23 lines and 77 characters across
  1284. for a full screen window.
  1285.  
  1286.             Note about Compiling MicroEMACS
  1287.  
  1288.          If  you  are  compiling the sources on  the  AMIGA  to
  1289.      produce an executable image, and  you  are  using    the Lattice
  1290.      compiler, be sure to give the CLI command 'STACK 40000' before
  1291.      compiling to make sure the compiler has sufficient stack space
  1292.      to successfully complete compilation.
  1293.  
  1294. 58
  1295.  
  1296. MicroEMACS Reference Manual                           D
  1297.  
  1298. D.4  UNIX V5, V7, and BSD4.[23]
  1299.  
  1300.     MicroEMACS under UNIX utilizes the  TERMCAP  library  to provide
  1301. machine  independent  screen  functions.    Make  sure    that termcap  is
  1302. available  and properly set on your account  before  attempting  to  use
  1303. MicroEMACS.
  1304.  
  1305.     Under  systems    which  support job control, you can use the ^X-D
  1306. suspend-emacs command to place EMACS  into the background.  This carries
  1307. a much smaller overhead than bringing up a new shell under EMACS.  EMACS
  1308. will  properly    redraw    the  screen  when  you    bring  it  back  to  the
  1309. foreground.
  1310.  
  1311.     With the addition of some very machine/operating system specific
  1312. code, EMACS can prevent two or more people from modifying the  same file
  1313. at the same  time. The upper level of a set of functions to provide file
  1314. locking  exist    in the source file LOCK.C.    It  requires  two  machine
  1315. specific  functions  written  and  linked  into EMACS for it to  operate
  1316. properly.
  1317.  
  1318.     char *dolock(fname)
  1319.  
  1320.     char *fname;
  1321.  
  1322.     dolock() locks a file, preventing others from modifying it. If
  1323.     it succeeds, it returns NULL, otherwise it returns a pointer to
  1324.     a string in the form "LOCK ERROR: explanation".
  1325.  
  1326.     char *undolock(fname)
  1327.  
  1328.     char *fname;
  1329.  
  1330.     undolock() unlocks a file, allowing others to modifying it. If
  1331.     it succeeds, it returns NULL, otherwise it returns a pointer to
  1332.     a string in the form "LOCK ERROR: explanation".
  1333.  
  1334.                                       59
  1335.  
  1336. Index                         MicroEMACS Reference Manual
  1337.  
  1338.                     Index
  1339.  
  1340.     <NL> 12                         entab-lines 33
  1341.                     execute-buffer 37
  1342.     A                execute-file 37
  1343.     add-global-mode 23        execute-macro 35
  1344.     add-mode 3, 23            execute-macro-<n> 37
  1345.                     exit-emacs 8
  1346.     B
  1347.     backward-character 4        F
  1348.     begin-macro 35            file locking 59
  1349.     beginning-of-file 4, 7        fill-paragraph 7, 31
  1350.     beginning-of-line 4        fill column 26
  1351.     buffer 4, 6            find-file 17, 18, 20
  1352.     buffers 20            forward-character 4
  1353.  
  1354.     C                H
  1355.     case-region-lower 32        handle-tab 33
  1356.     case-word-capitalize 32
  1357.     case-word-lower 32        K
  1358.     case-word-upper 32        kill-region 9
  1359.     change-screen-size 58        kill-to-end-of-line 8
  1360.     change-screen-width 58        kill buffer 10
  1361.     color 23
  1362.     control-x 1            L
  1363.     control key 1            list-buffers 21, 23
  1364.     copy-region 10
  1365.     cursor keys 4            M
  1366.                     mark 9
  1367.     D                meta key 1
  1368.     default string 13        mode line 2, 6
  1369.     delete-blank-lines 8        modes 3, 23
  1370.     delete-buffer 21        move-window-down 18
  1371.     delete-global-mode 23        move-window-up 18
  1372.     delete-mode 23
  1373.     delete-next-character 8         N
  1374.     delete-next-word 8        newline 1
  1375.     delete-previous-        next-buffer 20
  1376.          character 7        next-line 3
  1377.     delete-previous-word 8        next-paragraph 4
  1378.     detab-line 33
  1379.                     O
  1380.     E                open-line 7
  1381.     encryption 24
  1382.     end-macro 35            P
  1383.     end-of-file 4            point 9
  1384.     end-of-line 4            previous-line 3
  1385.  
  1386. 60
  1387.  
  1388. MicroEMACS Reference Manual                       Index
  1389.  
  1390.     previous-paragraph 4        set-fill-column 31
  1391.     previous-window 17        set-mark 9
  1392.     previous-word 3                 special keys 1
  1393.                     split-current-window 17
  1394.     Q                suspend-emacs 59
  1395.     query-replace 14
  1396.     query-replace-string 14         T
  1397.                     tab handling 33
  1398.     R                termcap 59
  1399.     replace-string 13        text window 2
  1400.  
  1401.     S                W
  1402.     save-file 4            window 6
  1403.     screen 6            windows 2, 17
  1404.     scroll-next-down 18        wrap-word 26
  1405.     scroll-next-up 18        wrapping text 31
  1406.     search-forward 12        write-file 4
  1407.     search-reverse 13
  1408.     select-buffer 20        Y
  1409.     set-encryption-key 24        yank 10
  1410.  
  1411.                                       61
  1412.  
  1413.                  Table of Contents
  1414.  
  1415.      Chapter 1    Basic Concepts                                    1
  1416.     1.1  Keys and the Keyboard . . . . . . . . . . . . . . .  1
  1417.     1.2  Getting Started . . . . . . . . . . . . . . . . . .  1
  1418.     1.3  Parts and Pieces  . . . . . . . . . . . . . . . . .  2
  1419.     1.4  Entering Text . . . . . . . . . . . . . . . . . . .  2
  1420.     1.5  Basic cursor movement . . . . . . . . . . . . . . .  3
  1421.     1.6  Saving your text  . . . . . . . . . . . . . . . . .  4
  1422.  
  1423.      Chapter 2    Basic Editing--Simple Insertions and Deletions    6
  1424.     2.1  A Word About Windows, Buffers, Screens, and Modes .  6
  1425.     2.2  Insertions  . . . . . . . . . . . . . . . . . . . .  7
  1426.     2.3  Deletions . . . . . . . . . . . . . . . . . . . . .  7
  1427.  
  1428.      Chapter 3    Using Regions                                     9
  1429.     3.1  Defining and Deleting a Region  . . . . . . . . . .  9
  1430.     3.2  Yanking a Region  . . . . . . . . . . . . . . . . . 10
  1431.  
  1432.      Chapter 4    Search and Replace                               12
  1433.     4.1  Forward Search  . . . . . . . . . . . . . . . . . . 12
  1434.     4.2  Exact Searches  . . . . . . . . . . . . . . . . . . 13
  1435.     4.3  Backward Search . . . . . . . . . . . . . . . . . . 13
  1436.     4.4  Searching and Replacing . . . . . . . . . . . . . . 13
  1437.     4.5  Query-Replace . . . . . . . . . . . . . . . . . . . 14
  1438.  
  1439.      Chapter 5    Windows                                          17
  1440.     5.1  Creating Windows  . . . . . . . . . . . . . . . . . 17
  1441.     5.2  Deleting Windows  . . . . . . . . . . . . . . . . . 18
  1442.     5.3  Resizing Windows  . . . . . . . . . . . . . . . . . 18
  1443.     5.4  Other Window commands . . . . . . . . . . . . . . . 18
  1444.  
  1445.      Chapter 6    Buffers                                          20
  1446.  
  1447.      Chapter 7    Modes                                            23
  1448.     7.1  ASAVE mode  . . . . . . . . . . . . . . . . . . . . 23
  1449.     7.2  CMODE mode  . . . . . . . . . . . . . . . . . . . . 24
  1450.     7.3  CRYPT mode  . . . . . . . . . . . . . . . . . . . . 24
  1451.     7.4  EXACT mode  . . . . . . . . . . . . . . . . . . . . 24
  1452.     7.5  MAGIC mode  . . . . . . . . . . . . . . . . . . . . 25
  1453.     7.6  OVER mode . . . . . . . . . . . . . . . . . . . . . 26
  1454.     7.7  WRAP mode . . . . . . . . . . . . . . . . . . . . . 26
  1455.     7.8  VIEW mode . . . . . . . . . . . . . . . . . . . . . 26
  1456.  
  1457.                     i
  1458.  
  1459.      Chapter 8    Files                                            28
  1460.  
  1461.      Chapter 9    Screen Formatting                                31
  1462.     9.1  Wrapping Text . . . . . . . . . . . . . . . . . . . 31
  1463.     9.2  Reformatting Paragraphs . . . . . . . . . . . . . . 31
  1464.     9.3  Changing Case . . . . . . . . . . . . . . . . . . . 31
  1465.     9.4  Tabs  . . . . . . . . . . . . . . . . . . . . . . . 32
  1466.  
  1467.      Chapter 10  Keyboard Macros                                 35
  1468.  
  1469.      Chapter 11  MicroEMACS Macros                               37
  1470.     11.1  Variables  . . . . . . . . . . . . . . . . . . . . 37
  1471.        11.1.1  Environmental Variables . . . . . . . . . . . 38
  1472.        11.1.2  User variables  . . . . . . . . . . . . . . . 39
  1473.        11.1.3  Buffer Variables  . . . . . . . . . . . . . . 39
  1474.        11.1.4  Interactive variables . . . . . . . . . . . . 40
  1475.     11.2  Functions  . . . . . . . . . . . . . . . . . . . . 40
  1476.     11.3  Directives . . . . . . . . . . . . . . . . . . . . 42
  1477.        11.3.1  !ENDM Directive . . . . . . . . . . . . . . . 43
  1478.        11.3.2  !FORCE Directive  . . . . . . . . . . . . . . 43
  1479.        11.3.3  !IF, !ELSE, and !ENDIF Directives . . . . . . 43
  1480.        11.3.4  !GOTO Directive . . . . . . . . . . . . . . . 44
  1481.        11.3.5  !RETURN Directive . . . . . . . . . . . . . . 45
  1482.  
  1483.      Appendix A  MicroEMACS commands                 46
  1484.  
  1485.      Appendix B  MicroEMACS Bindings                 52
  1486.  
  1487.      Appendix C  Supported machines                 54
  1488.  
  1489.      Appendix D  Machine Dependent Notes             55
  1490.     D.1  IBM-PC/XT/AT and its clones . . . . . . . . . . . . 55
  1491.     D.2  Atari 520/1040ST  . . . . . . . . . . . . . . . . . 57
  1492.     D.3  Amiga 1000  . . . . . . . . . . . . . . . . . . . . 58
  1493.     D.4  UNIX V5, V7, and BSD4.[23]  . . . . . . . . . . . . 59
  1494.  
  1495.                    ii
  1496.  
  1497. -----snip-----snip-----snip-----snip-----snip-----snip-----snip-----snip-----
  1498.  
  1499. -- 
  1500.                             Paul Homchick
  1501. Chimitt Gilman Homchick, Inc.; One Radnor Station, Suite 300; Radnor, PA 19087
  1502.              {seismo!bpa | ihnp4!cbmvax} !vu-vlsi!cgh!paul
  1503.