home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / memacs32.zip / mewin.cmd < prev    next >
OS/2 REXX Batch file  |  1993-08-07  |  3KB  |  109 lines

  1. ;    Example startup program for Micro-EMACS 3.12 for Windows
  2. ;
  3. ; Pierre Perret - April 1993
  4.  
  5. set $mmove 1            ; do not generate too many mouse events
  6. set $posflag TRUE       ; show line positionning info in modeline
  7. set $flicker FALSE    ; This animates the grinder cursor
  8.  
  9. store-procedure save-all-buffers
  10. ; This macro saves all the modified buffers to their respective
  11. ; files
  12.     set %tmp $cbufname
  13.     !while TRUE
  14.         !force save-file
  15.         !force next-buffer
  16.         !if &seq %tmp $cbufname
  17.             !return
  18.         !endif
  19.     !endwhile
  20. !endm
  21. macro-to-key save-all-buffers M-^Z  ; bind to ESC Ctrl+Z
  22.  
  23. macro-to-menu save-all-buffers ">&File>Save a&ll@8"
  24.  
  25. ; setup some cool colors
  26. add-mode blue          ; background
  27. add-global-mode blue
  28. add-mode WHITE          ; foreground
  29. add-global-mode WHITE
  30.  
  31. ; resize the screen for 100 columns (not appropriate for pure VGA)
  32. ; 100  change-screen-width
  33.  
  34. ; this macro allows easy resizing of the current screen
  35. store-procedure Set-Screen-Size
  36.     set %tmp @&cat &cat "Screen width (" $curwidth "): "
  37.     !if ¬ &sequal %tmp ""
  38.         set $curwidth %tmp
  39.     !endif
  40.     set %tmp @&cat &cat "Screen height (" $pagelen "): "
  41.     !if ¬ &sequal %tmp ""
  42.         set $pagelen %tmp
  43.     !endif
  44. !endm
  45.  
  46. ; this macro allows easy setting of the fill column
  47. store-procedure  Set-Fill-Column
  48.     set %tmp @&cat &cat "Fill column (" $fillcol "): "
  49.     !if ¬ &sequal %tmp ""
  50.         set $fillcol %tmp
  51.     !endif
  52. !endm
  53.  
  54. ; get rid of some menu entries
  55. ; to replace them by a nicer macro that actually prompts the user
  56. unbind-menu     ">S&creen>Si&ze>= &Width"
  57. unbind-menu     "= &Height"
  58. macro-to-menu   Set-Screen-Size "&Set:"
  59. unbind-menu     ">&Edit>= &Fill column"
  60. macro-to-menu   Set-Fill-Column "&Fill column:"
  61.  
  62. ; load Windows-specific macros
  63. write-message "[Loading MDI macros...]"
  64. execute-file "mdi.cmd"
  65.  
  66. ; uncomment the following lines to load the sample development macros
  67. ; write-message "[loading DEV macros...]"
  68. ; execute-file "dev.cmd"
  69.  
  70. write-message "[Loading CUA-feel macros...]"
  71. execute-file "cua.cmd"
  72.  
  73. !if ¬ &seq &find "custom.cmd" ""
  74.     write-message "[loading CUSTOM macros...]
  75.     execute-file "custom.cmd"
  76. !endif
  77. write-message "[Still setting up...]"
  78.  
  79. store-procedure    extension
  80. ; figure out the filename extension. returns lowercase result in %ext
  81. ; if no extension, returns ""
  82.     set %tmp &rig $cfname 4
  83.     set %ext &sin %tmp "."
  84.     !if &equ %ext 0
  85.         set %ext ""
  86.     !else
  87.         set %ext &low &mid %tmp &add %ext 1 3
  88.     !endif
  89. !endm
  90.  
  91. store-procedure readhook-proc
  92.     run extension
  93.     !if &sin "|c|h|cpp|hpp|dlg|def|rc|cmd|" &cat &cat "|" %ext "|"
  94.         add-mode cmode
  95.     !else
  96.         !if &sin "||me|1st|doc|txt|" &cat &cat "|" %ext "|"
  97.             add-mode wrap
  98.         !endif
  99.     !endif
  100. !endm
  101. set $readhook readhook-proc
  102.  
  103. set $ssave FALSE
  104.  
  105. ;4    handle-tab        ;Pierre's preferences!
  106. ;bind-to-key end-of-word M-F
  107. ;bind-to-key end-of-word FN^F
  108. clear-message-line
  109.