home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / MM1 / GRAPHICS / fontcollection_MM1.lzh / FNTCOL16 / CMDS / emacsrc < prev    next >
Text File  |  1995-09-14  |  6KB  |  261 lines

  1. ;    EMACS.RC:    Standard MicroEMACS Startup program
  2. ;            for MicroEMACS 3.13 and above
  3. ;            (C)opyright 1987-99 by Daniel M Lawrence
  4. ;            Last Update: 11/13/93
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ;    If you hate clocks or position counters, comment these
  10. set $timeflag TRUE
  11. set $posflag TRUE
  12.  
  13. ;    Set Default Global modes
  14.  
  15. add-global-mode "blue"
  16. add-global-mode "WHITE"
  17. ;bind-to-key meta-prefix `    ;for annoying keyboards with ` at the top left
  18.  
  19. ;    Toggle function key window display
  20.  
  21. store-procedure toggle-fkeys
  22.     !if %rcfkeys
  23.         !goto rcfoff
  24.     !endif
  25.  
  26. ;    toggle function key window on
  27.     save-window
  28.     1 next-window
  29.     !if &sequal $cbufname "emacs.hlp"
  30.         delete-window
  31.     !endif
  32.     !if ¬ &sequal $cbufname "Function Keys"
  33.         1 split-current-window
  34.         1 select-buffer "Function Keys"
  35.         add-mode "red"
  36.         !force 5 resize-window
  37.         1 goto-line
  38.     !endif
  39.     set %rcfkeys TRUE
  40.     !force restore-window
  41.     !if &sequal $cbufname "Function Keys"
  42.         next-window
  43.     !endif
  44.     write-message "[Function key window ON]"
  45.     !return
  46.  
  47.     ;Toggle the function key window off
  48. *rcfoff
  49.     save-window
  50.     1 next-window
  51.     !if &sequal "Function Keys" $cbufname
  52.         delete-window
  53.     !endif
  54.     !force restore-window
  55.     write-message "[Function key window OFF]"
  56.     set %rcfkeys FALSE
  57. !endm
  58.  
  59. ;    Bring up Online-help system
  60.  
  61. store-procedure get-help
  62.     set $discmd FALSE
  63.     source ehelp.cmd
  64.     set $discmd TRUE
  65. !endm
  66.  
  67. ;    Load a new page
  68.  
  69. store-procedure get-page-loader
  70.     !if &seq &find newpage.cmd ""
  71.         write-message "[Can not find NEWPAGE.CMD]"
  72.         !return
  73.     !endif
  74.     execute-file newpage.cmd
  75. !endm
  76.  
  77. ;procedure to clean out the current page (which is nothing right now)
  78.  
  79. store-procedure clean
  80.     ; nothing by default
  81. !endm
  82.  
  83. ;    Set up auto CMODE
  84.  
  85. store-procedure set-default-mode
  86.     set %rctmp &sin $cfname "."
  87.     !if &equ %rctmp 0
  88.         !return
  89.     !endif
  90.     set %rctmp &mid $cfname &add %rctmp 1 5
  91.     !if &or &seq %rctmp "c" &seq %rctmp "h"
  92.         add-mode "cmode"
  93.     !endif
  94.     !if &or &seq %rctmp "cpp" &seq %rctmp "hpp"
  95.         add-mode "cmode"
  96.     !endif
  97.     !if &or &seq %rctmp "mss" &seq %rctmp "txt"
  98.         add-mode "wrap"
  99.     !endif
  100. !endm
  101. set $readhook set-default-mode
  102.  
  103. ;    This function activates the function key window as
  104. ;    a legitimate place to call up function keys using the mouse
  105.  
  106. store-procedure mouse-clicks
  107.  
  108.     ;remember where we started, and do the mouse movement
  109.     save-window
  110.     !force mouse-move-down
  111.  
  112.     ;If not in the function key window... leave
  113.     !if ¬ &sequal $cbufname "Function Keys"
  114.         !return
  115.     !endif
  116.  
  117.     ;First pos is a screen reposition, let it through
  118.     !if &and &equ $xpos 0 &equ $ypos 0
  119.         restore-window
  120.         !return
  121.     !endif
  122.  
  123.     ;Find out what function key were gonna do
  124.     add-mode magic
  125.     2 forward-character
  126.     set %rctmp $search
  127.     !force search-reverse "[fF][0-9]"
  128.     !if &seq $status FALSE
  129.         delete-mode magic
  130.         set $search %rctmp
  131.         !return
  132.     !endif
  133.  
  134.     ;we are on the "f" or "F".  Get the function key type and number now
  135.     set $search %rctmp
  136.     set %fcase lower
  137.     !if &equ $curchar 70
  138.         set %fcase upper
  139.     !endif
  140.     1 forward-character
  141.     set %fnum &chr $curchar
  142.     1 forward-character
  143.     set %fnum &cat %fnum &chr $curchar
  144.     set %fnum &add %fnum 0
  145.     !if &equ %fnum 10
  146.         set %fnum "0"
  147.     !endif
  148.     set %fname &cat "FN" %fnum
  149.     !if &seq %fcase upper
  150.         set %fname &cat "S-" %fname
  151.     !endif
  152.  
  153.     ;save the function
  154.     set %rccmd &bind %fname
  155.     delete-mode MAGIC
  156.  
  157.     ;swallow the up-button
  158.     set %rctmp >c
  159.  
  160.     ;restore the window and exit
  161.     restore-window
  162.  
  163.     ;procedures don't need the square brackets
  164.     !if &seq &left %rccmd 1 "["
  165.         set %rccmd &mid %rccmd 2 &sub &len %rccmd 2
  166.         %rccmd
  167.         !return
  168.     !endif
  169.  
  170.     ;and then execute it
  171.     !force execute-named-command %rccmd
  172. !endm   
  173. macro-to-key mouse-clicks MSa
  174.  
  175. ;    ***** Rebind the Function key group
  176.  
  177. bind-to-key reverse-incremental-search    FN1
  178. bind-to-key incremental-search  FN2
  179. bind-to-key hunt-forward        FN4
  180. bind-to-key hunt-backward        FN3
  181. macro-to-key toggle-fkeys        FN5
  182. macro-to-key get-help            FN6
  183. bind-to-key next-window         FN7
  184. macro-to-key get-page-loader        FN8
  185. bind-to-key save-file            FN9
  186. bind-to-key exit-emacs            FN0
  187.  
  188. ;    bring up the function key window
  189.  
  190.     1 split-current-window
  191.     select-buffer "Function Keys"
  192.     insert-string "f1 <-search f2 search-> █    MicroEMACS:  Text Editor~n"
  193.     insert-string "f3 <-hunt   f4 hunt->   █ ~n"
  194.     insert-string "f5 fkeys    f6 help     █  Available function key Pages include:~n"
  195.     insert-string "f7 nxt wind f8 pg[    ] █    Word  Box  Emacs  Pascal  C  cObol Lisp~n"
  196.     insert-string "f9 save     f10 exit    █  [use the f8 key to load Pages]~n"
  197.     unmark-buffer
  198.     delete-window
  199.     set %rcfkeys FALSE
  200.  
  201.     !if &seq $os "UNIX"
  202.  
  203.         ;Allow mainframes to simulate function
  204.         ;keys with ^C<n> and ^C shifted-<n>
  205.         
  206.         store-procedure emulate-fkeys
  207.             !if ¬ $pending
  208.                 write-message "FN-"
  209.             !endif
  210.             set %rcchar >key
  211.             set %rcchar &sindex "1234567890!@#$%^&*()" %rcchar
  212.             !if &equ %rcchar 0
  213.                 write-message "[Not Bound]"
  214.                 !return
  215.             !endif
  216.             clear-message-line
  217.             set %rctmp "FN"
  218.             !if &gre %rcchar 10
  219.                 set %rctmp &cat "S-" %rctmp
  220.             !endif
  221.             set %rcchar &mid "12345678901234567890" %rcchar 1
  222.             set %rctmp &bind &cat %rctmp %rcchar
  223.             !if &seq &lef %rctmp 1 "["
  224.                 set %rctmp &mid %rctmp 2 &sub &len %rctmp 2
  225.                 run %rctmp
  226.                 !return
  227.             !endif
  228.             !force execute-named-command %rctmp
  229.         !endm
  230.  
  231.         macro-to-key emulate-fkeys ^C
  232.         
  233.     !endif
  234.  
  235.     !if &seq $os "MSWIN"
  236.         source "mewin.cmd"
  237.     !else
  238.         toggle-fkeys
  239.     !endif
  240.  
  241. !if &seq $os "OS2"
  242.     set $sres VGA
  243.     set $sres CGA
  244. !endif
  245.  
  246.      set $discmd TRUE
  247.  
  248. bind-to-key incremental-search A-S
  249. bind-to-key reverse-incremental-search A-R
  250. bind-to-key search-forward M-s
  251. bind-to-key hunt-backward A-B
  252. bind-to-key hunt-forward A-F
  253. bind-to-key save-file M-y
  254. bind-to-key quote-character ^XQ
  255.  
  256. set $gmode 256
  257. set $hardtab 4
  258. set $softtab 4
  259.  
  260.  
  261.