home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / UE311CMD.ZIP / EDT.CMD < prev    next >
OS/2 REXX Batch file  |  1990-06-19  |  4KB  |  136 lines

  1. ; EDT Keypad Emulator (first order approximation - partial implementation)
  2. ; For MicroEmacs 3.10_J (version which allows multiple bindings of meta-prefix)
  3. ; VMS and ATARI ST version only.
  4. ; by Roy Lomicka February 2, 1988
  5.  
  6. ; Name the keys.  Note with V3.10_J, there are very few differences between
  7. ; the Atari and VMS versions
  8.  
  9. ;turn keypad commands on with ^X3, off with ^X4 (ANSI versions only)
  10.  
  11. bind-to-key execute-macro-39 ^X3
  12. 39 store-macro
  13. write-message &cat &chr 27 "= keypad on"
  14. !endm
  15.  
  16. bind-to-key execute-macro-40 ^X4
  17. 40 store-macro
  18. write-message &cat &chr 27 "> keypad off"
  19. !endm
  20.  
  21. ; Currently uses macros 31-38
  22.  
  23. bind-to-key meta-prefix    FN^(
  24. set $sterm FN^E
  25.  
  26. ; Unbind currently unimplemented EDT keys:
  27. !force unbind-key    M-FN^(
  28. !force unbind-key    FN^)        ; Help
  29. !force unbind-key    M-FN^)
  30. !force unbind-key    FN^9        ; Append
  31. !force unbind-key    M-FN^9        ; Replace
  32. !force unbind-key    M-FN^1        ; Change case
  33. !force unbind-key    M-FN^3        ; Special insert
  34. !force unbind-key    M-FN^.        ; Reset
  35. !force unbind-key    FN^E        ; Enter
  36. !force unbind-key    M-FN^E        ; Substitute
  37.  
  38. bind-to-key execute-macro-31        FN^4    ; Advance
  39. 31 store-macro
  40. set $discmd FALSE
  41. bind-to-key search-forward        M-FN^/    ; Find
  42. bind-to-key hunt-forward        FN^/    ; Find next
  43. bind-to-key execute-macro-33        FN^7    ; Page (next-ff)
  44. bind-to-key next-page            FN^8    ; Section
  45. bind-to-key next-word            FN^1    ; Word
  46. bind-to-key forward-character        FN^3    ; Char
  47. bind-to-key execute-macro-35        FN^0    ; Beginning of line (next-bol)
  48. bind-to-key execute-macro-37        FN^2    ; End of line (next-eol)
  49. set $discmd TRUE
  50. write-message "EDT Directional Mode = Advance"
  51. !endm
  52.  
  53. execute-macro-31
  54.  
  55. bind-to-key execute-macro-32        FN^5    ; Backup
  56. 32 store-macro
  57. set $discmd FALSE
  58. bind-to-key search-reverse        M-FN^/    ; Find
  59. bind-to-key hunt-backward        FN^/    ; Find next
  60. bind-to-key execute-macro-34        FN^7    ; Page (prev-ff)
  61. bind-to-key previous-page        FN^8    ; Section
  62. bind-to-key previous-word        FN^1    ; Word
  63. bind-to-key backward-character        FN^3    ; Char
  64. bind-to-key execute-macro-36        FN^0    ; Beginning of line (next-bol)
  65. bind-to-key execute-macro-38        FN^2    ; End of line (next-eol)
  66. set $discmd TRUE
  67. write-message "EDT Directional Mode = Backup"
  68. !endm
  69.  
  70. ; Caution - Delete eol, Delete line, and Delete word
  71. ;        use the same buffer as Cut, so Paste and
  72. ;        the Undelete keys are bound identically. 
  73. ;        Note that although Delete char is defined 
  74. ;        in this group, it does not participate in 
  75. ;        the Cut/Paste/Delete/Undelete process.
  76.  
  77. bind-to-key kill-to-end-of-line M-FN^2    ; Delete eol
  78. bind-to-key kill-to-end-of-line        FN^*    ; Delete line
  79. bind-to-key delete-next-word        FN^-    ; Delete word
  80. bind-to-key delete-next-character    FN^,    ; Delete char
  81. bind-to-key yank            M-FN^*    ; Undelete line
  82. bind-to-key yank            M-FN^-    ; Undelete word
  83. bind-to-key yank            M-FN^,    ; Undelete char
  84.  
  85. bind-to-key execute-named-command M-FN^7 ; Command
  86. bind-to-key fill-paragraph        M-FN^8    ; Fill
  87.  
  88. bind-to-key end-of-file            M-FN^4    ; Bottom
  89. bind-to-key beginning-of-file        M-FN^5    ; Top
  90.  
  91. bind-to-key kill-region            FN^6    ; Cut
  92. bind-to-key yank            M-FN^6    ; Paste
  93.  
  94. bind-to-key open-line            M-FN^0    ; Open line
  95.  
  96. bind-to-key set-mark            FN^.    ; Select
  97.  
  98. ; next-ff
  99. 33 store-macro
  100. set %search $search
  101. !force search-forward "~f"
  102. set $search %search
  103. !endm
  104.  
  105. ; prev-ff
  106. 34 store-macro
  107. set %search $search
  108. !force search-reverse "~f"
  109. set $search %search
  110. !endm
  111.  
  112. ; next-bol
  113. 35 store-macro
  114.   beginning-of-line
  115.   next-line
  116. !endm
  117.  
  118. ; prev-bol
  119. 36 store-macro
  120.   backward-character
  121.   beginning-of-line
  122. !endm
  123.  
  124.  
  125. ; next-eol
  126. 37 store-macro
  127.   forward-character
  128.   end-of-line
  129. !endm
  130.  
  131. ; prev-eol
  132. 38 store-macro
  133.   previous-line                             
  134.   end-of-line
  135. !endm
  136.