DERMOTT@DREA-XX.ARPA.UUCP (03/27/87)
--------------------------------
MicroEmacs Macros on VAX for EDT fans
Here is a rather crude macro file for VAX-VMS MicroEmacs that attempts to
emulate the VAX EDT keypad functions on a VT100 (also VT200 in
VT100 mode).
I had to add some code (from Earl Horton ) to INPUT.C
to recognize the 3 byte VT100 functon codes but
I didn't "hardwire" the numeric keypad on.
This file has macros to enable and disable the keypad.
NOTE - the ESCAPE character (\033) doesn't print so it
shows in this file as {ESC}. Put it in with ^Q^[.
usuage : EMACS @VTEDT.RC filenames
or execute-buffer vtedt.rc
or change name to EMACS.RC to load automatically.
DAVID DERMOTT
DREA
DARTMOUTH NOVA SCOTIA CANADA
----------------------------------------------
;VTEDT.RC
;MicroEMACS 3.8b macros for VAX EDT keypad functions on VT100
; not all functions are here
; ENTER key doesn't work for search string and command name-
; use RETURN
;
; escape key shows as {ESC} ,enter it as ^Q^[
;
;first turn keypad on with ^x-3
;turn off keypad with ^X-4
;variables for GOLD (PF1)key and search direction
set %gold 0
set %srchdir 0
;macros for turning numeric keypad on and off
; escape key shows as {ESC} ,enter it as ^Q^[
31 store-macro
write-message "{ESC}= keypad on "
!endm
32 store-macro
write-message "{ESC}> keypad off "
!endm
bind-to-key execute-macro-31 ^X3
bind-to-key execute-macro-32 ^X4
;ENTER key on pad set to RETURN
bind-to-key newline FNM
;bindings for PF1 - PF4
bind-to-key execute-macro-33 FNP
bind-to-key help FNQ
bind-to-key execute-macro-35 FNR
bind-to-key execute-macro-36 FNS
;pf1 -pf4
;PF1 set gold flag
33 store-macro
set %gold 1
!endm
;
;PF3 FNDNXT & FIND
35 store-macro
!if &equal %gold 0
!if &equal %srchdir 0
hunt-forward
!else
hunt-backward
!endif
!else
!if &equal %srchdir 0
search-forward @"search-string<ret>"
!else
search-backward @"search-string<ret>"
!endif
!endif
write-message "searching "
set %gold 0
!endm
;PF4 DEL L & UNDEL L
36 store-macro
!if &equal %gold 0
beginning-of-line
kill-to-end-of-line
!else
yank
!endif
set %gold 0
!endm
;keypad . SET MARK
bind-to-key set-mark FNn
;keypad - delete word &UND WORD
bind-to-key execute-macro-37 FNm
37 store-macro
!if &equal %gold 0
delete-next-word
!else
yank
!endif
set %gold 0
!endm
;
;keypad , DEL C &UND C
bind-to-key execute-macro-38 FNl
38 store-macro
!if &equal %gold 0
delete-next-character
!else
;no op
!endif
set %gold 0
!endm
;
;keypad 0-9
bind-to-key execute-macro-20 FNp
bind-to-key execute-macro-21 FNq
bind-to-key execute-macro-22 FNr
bind-to-key execute-macro-23 FNs
bind-to-key execute-macro-24 FNt
bind-to-key execute-macro-25 FNu
bind-to-key execute-macro-26 FNv
bind-to-key execute-macro-27 FNw
bind-to-key execute-macro-28 FNx
bind-to-key execute-macro-29 FNy
;pad 0 LINE & OPEN LINE
20 store-macro
!if &equal %gold 0
next-line
beginning-of-line
!else
open-line
!endif
set %gold 0
!endm
;pad 1 WORD &CHANGECASE
21 store-macro
!if &equal %gold 0
;no op
!else
;no op
!endif
set %gold 0
!endm
;PAD 2 EOL &del EOL
22 store-macro
!if &equal %gold 0
end-of-line
!else
kill-to-end-of-line
!endif
set %gold 0
!endm
;pad 3 CHAR & SPECINS
23 store-macro
!if &equal %gold 0
;no op
!else
;no op
!endif
set %gold 0
!endm
;pad 4 ADVANCE &bottom
24 store-macro
!if &equal %gold 0
set %srchdir 0
write-message "forward"
!else
end-of-file
!endif
set %gold 0
!endm
;pad 5 BACKUP &TOP
25 store-macro
!if &equal %gold 0
set %srchdir 1
write-message "reverse"
!else
beginning-of-file
!endif
set %gold 0
!endm
;keypad 6 CUT and PASTE
26 store-macro
!if &equal %gold 0
kill-region
!else
yank
!endif
set %gold 0
!endm
;pad 7 PAGE & COMMAND
27 store-macro
!if &equal %gold 0
write-message "search for FF"
!if &equal %srchdir 0
search-forward "~f"
!else
search-reverse "~f"
!endif
!else
execute-named-command @"command:"
!endif
set %gold 0
!endm
;pad 8 SECT & FILL
28 store-macro
!if &equal %gold 0
!if &equal %srchdir 0
next-page
!else
previous-page
!else
;no op
!endif
set %gold 0
!endm
;pad 9 APPEND &REPLACE
29 store-macro
!if &equal %gold 0
;no op
!else
;no op
!endif
set %gold 0
!endm
-------