home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / nfsml202.zip / EMACS.RC next >
Text File  |  1991-09-01  |  6KB  |  253 lines

  1. ;    EMACS.RC:    Standard micro Startup program
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4. ;            Last Update: 10/20/87
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ; If you screen "SNOWS", comment this line
  10.     set $flicker "FALSE"
  11.  
  12. ; To use an IBM-PC EGA card, uncomment the following line
  13. ;    set $sres "EGA"
  14.     set $sres "VGA"
  15.  
  16. ;    ***** Rebind the Function key group
  17.  
  18. bind-to-key search-forward        FN1
  19. bind-to-key search-reverse        FN2
  20. bind-to-key hunt-forward        FN3
  21. bind-to-key hunt-backward        FN4
  22. bind-to-key execute-macro-1        FN5
  23. bind-to-key execute-macro-2        FN6
  24. bind-to-key next-window            FN7
  25. bind-to-key execute-macro-3        FN8
  26. bind-to-key save-file            FN9
  27. bind-to-key exit-emacs            FN0
  28. bind-to-key beginning-of-line        FN<
  29. bind-to-key end-of-line            FN>
  30. bind-to-key search-forward        A-F
  31. bind-to-key hunt-forward        A-C
  32.  
  33. bind-to-key execute-macro-10        S-FN1
  34. bind-to-key execute-macro-11        S-FN2
  35. bind-to-key execute-macro-12        S-FN3
  36. bind-to-key execute-macro-13        S-FN4
  37. bind-to-key execute-macro-14        S-FN5
  38. bind-to-key execute-macro-15        S-FN6
  39. bind-to-key execute-macro-16        S-FN7
  40. bind-to-key execute-macro-17        S-FN8
  41. bind-to-key execute-macro-18        S-FN9
  42. bind-to-key execute-macro-19        S-FN0
  43.  
  44. ;    Set Default Global modes
  45.  
  46. add-global-mode "blue"
  47. ;bind-to-key next-page FN<
  48. ;bind-to-key previous-page FNC
  49. ;bind-to-key meta-prefix `
  50.  
  51. ;    Toggle function key window display
  52.  
  53. 1    store-macro
  54.     !if %rcfkeys
  55.         !goto rcfoff
  56.     !endif
  57.  
  58. ;    toggle function key window on
  59.     save-window
  60.     1 next-window
  61.     !if &sequal $cbufname "emacs.hlp"
  62.         delete-window
  63.     !endif
  64.     !if ¬ &sequal $cbufname "Function Keys"
  65.         1 split-current-window
  66.         1 select-buffer "Function Keys"
  67.         add-mode "red"
  68.         !force 5 resize-window
  69.         1 goto-line
  70.     !endif
  71.     set %rcfkeys TRUE
  72.     !force restore-window
  73.     !if &sequal $cbufname "Function Keys"
  74.         next-window
  75.     !endif
  76.     write-message "[Function key window ON]"
  77.     !return
  78.  
  79.     ;Toggle the function key window off
  80. *rcfoff
  81.     save-window
  82.     1 next-window
  83.     !if &sequal "Function Keys" $cbufname
  84.         delete-window
  85.     !endif
  86.     !force restore-window
  87.     write-message "[Function key window OFF]"
  88.     set %rcfkeys FALSE
  89. !endm
  90.  
  91. ;    Toggle HELP file onscreen
  92.  
  93. 2 store-macro
  94.     1 next-window
  95.  
  96.     ;Make sure the function key window isn't up!
  97.     !if &sequal $cbufname "Function Keys"
  98.         delete-window
  99.     !endif
  100.     set %rcfkeys FALSE
  101.  
  102.     ;Bring up page 1
  103.     !if ¬ &seq $cbufname "emacs.hlp"
  104.         help
  105.         8 resize-window
  106.         add-mode "red"
  107.         beginning-of-file
  108.         2 forward-character
  109.     !endif
  110.  
  111. *rchelp
  112.  
  113.     write-message "[PgUp/PgDn] Page    [FN6] EXIT     ^G  Exit leaving page on screen"
  114.     update-screen
  115.     set %rctmp >cmd
  116.     !if &seq %rctmp FNZ
  117.         beginning-of-line
  118.         !force search-reverse "=>"
  119.         1 redraw-display
  120.         !goto rchelp
  121.     !endif
  122.     !if &seq %rctmp FNV
  123.         beginning-of-line
  124.         2 forward-character
  125.         !force search-forward "=>"
  126.         1 redraw-display
  127.         !goto rchelp
  128.     !endif
  129.     !if &seq %rctmp FN6
  130.         delete-window
  131.         !if &seq %rcfkeys TRUE
  132.             set %rcfkeys FALSE
  133.             execute-macro-1
  134.         !endif
  135.         write-message "[Help Exited]"
  136.         !return
  137.     !endif
  138.     !if &seq %rctmp ^G
  139.         next-window
  140.         set %rcfkeys FALSE
  141.         write-message "[Help Aborted]"
  142.         !return
  143.     !endif
  144.     !goto rchelp
  145. !endm
  146.  
  147. ;    Load a new page
  148.  
  149. 3    store-macro
  150.     !if &seq &find newpage.cmd ""
  151.         write-message "[Can not find NEWPAGE.CMD]"
  152.         !return
  153.     !endif
  154.     execute-file newpage.cmd
  155. !endm
  156.  
  157. ;procedure to clean out the current page (which is nothing right now)
  158.  
  159. store-procedure    clean
  160.     ; nothing by default
  161. !endm
  162.  
  163. ;    Set up auto CMODE
  164.  
  165. 20    store-macro
  166.     set %rctmp &sin $cfname "."
  167.     !if &equ %rctmp 0
  168.         !return
  169.     !endif
  170.     set %rctmp &mid $cfname &add %rctmp 1 5
  171.     !if &or &seq %rctmp "c" &seq %rctmp "h"
  172.         add-mode "cmode"
  173.     !endif
  174.     !if &seq %rctmp "mss"
  175.         add-mode "wrap"
  176.     !endif
  177. !endm
  178. set $readhook execute-macro-20
  179.  
  180. ;    This function activates the function key window as
  181. ;    a legitimate place to call up function keys
  182.  
  183. 21    store-macro
  184.  
  185.     ;remember where we started, and do the mouse movement
  186.     save-window
  187.     mouse-move-down
  188.  
  189.     ;If not in the function key window... leave
  190.     !if ¬ &sequal $cbufname "Function Keys"
  191.         !return
  192.     !endif
  193.  
  194.     ;Find out what function key were gonna do
  195.     add-mode magic
  196.     2 forward-character
  197.     set %rctmp $search
  198.     !force search-reverse "[fF][0-9]"
  199.     !if &seq $status FALSE
  200.         delete-mode magic
  201.         set $search %rctmp
  202.         !return
  203.     !endif
  204.  
  205.     ;we are on the "f" or "F".  Get the function key type and number now
  206.     set $search %rctmp
  207.     set %fcase lower
  208.     !if &equ $curchar 70
  209.         set %fcase upper
  210.     !endif
  211.     1 forward-character
  212.     set %fnum &chr $curchar
  213.     1 forward-character
  214.     set %fnum &cat %fnum &chr $curchar
  215.     set %fnum &add %fnum 0
  216.     !if &equ %fnum 10
  217.         set %fnum "0"
  218.     !endif
  219.     set %fname &cat "FN" %fnum
  220.     !if &seq %fcase upper
  221.         set %fname &cat "S-" %fname
  222.     !endif
  223.  
  224.     ;save the function
  225.     set %rccmd &bind %fname
  226.     delete-mode MAGIC
  227.  
  228.     ;swallow the up-button
  229.     set %rctmp >c
  230.  
  231.     ;restore the window and exit
  232.     restore-window
  233.  
  234.     ;and then execute it
  235.     execute-named-command &ind %rccmd
  236. !endm    
  237. bind-to-key execute-macro-21 MSa
  238.  
  239. ;    bring up the function key window
  240.  
  241.     1 split-current-window
  242.     select-buffer "Function Keys"
  243.     insert-string "f1 search-> f2 <-search █    MicroEMACS:  Text Editor~n"
  244.     insert-string "f3 hunt->   f4 <-hunt   █ ~n"
  245.     insert-string "f5 fkeys    f6 help     █  Available function key Pages include:~n"
  246.     insert-string "f7 nxt wind f8 pg[    ] █    WORD  BOX  EMACS  PASCAL  C   COBOL~n"
  247.     insert-string "f9 save     f10 exit    █  [use the f8 key to load Pages]~n"
  248.     unmark-buffer
  249.     delete-window
  250.     set %rcfkeys FALSE
  251.     execute-macro-1
  252.     set $discmd TRUE
  253.