home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / modes / edt / edt-apollo.el < prev    next >
Encoding:
Text File  |  1991-10-25  |  22.3 KB  |  520 lines

  1. ;;; File:  edt-apollo.el, v 1.1
  2. ;;;
  3. ;;;            -----   -----------   -------   -----------------
  4. ;;;            E D T   K e y p a d   M o d e   E m u l a t i o n
  5. ;;;            -----   -----------   -------   -----------------
  6. ;;;
  7. ;;;       -----   -----------   ---------------------   ---------------
  8. ;;;       F o r   A p o l l o   L o w - P r o f i l e   K e y b o a r d
  9. ;;;       -----   -----------   ---------------------   ---------------
  10. ;;;
  11. ;;;                        BETA Distribution Version 0.5
  12. ;;;
  13. ;;; Copyright (C) 1986 Free Software Foundation, Inc.
  14. ;;; Copyright (C) 1991 Kevin Gallagher
  15. ;;;
  16. ;;;   WARNING!  WARNING!  WARNING!  WARNING!  WARNING!  WARNING!  WARNING!
  17. ;;;
  18. ;;;     This EDT emulation for the Apollo Low-Profile Keyboard assumes
  19. ;;;     that you have applied Leonard N. Zubkoff's (lnz@lucid.com)
  20. ;;;     Apollo Modifications for GNU Emacs, Version 18.54, or later.
  21. ;;;
  22. ;;;   WARNING!  WARNING!  WARNING!  WARNING!  WARNING!  WARNING!  WARNING!
  23. ;;;
  24. ;;;
  25. ;;; This file contains GNU Emacs Apollo specific functions and Apollo
  26. ;;; Low-Profile Keyboard specific EDT bindings and functions.  
  27. ;;;
  28. ;;; The function edt-bind-function-key is based upon
  29. ;;; bind-apollo-function-key found in apollo.el.
  30. ;;;
  31. ;;; Send bug reports and suggestions for improvement to Kevin Gallagher
  32. ;;; (kgallagh@digi.lonestar.org).
  33. ;;;
  34.  
  35. ;;; Leonard N. Zubkoff's Apollo Modifications for Version 18.54
  36. ;;; support the function keys differently than his method used in
  37. ;;; subsequent versions.  So, we need to give version 18.54 special
  38. ;;; handling.
  39. ;;;
  40. ;;; If the 1st 15 characters of the Emacs version string has been
  41. ;;; altered in a site specific installation of GNU Emacs, the
  42. ;;; following test may fail to locate the version string correctly.
  43. ;;; If this was done at your site, it was a bad idea and should be
  44. ;;; undone.
  45.  
  46. (setq edt-old-emacs (string-equal "18.54" (substring (emacs-version) 10 15)))
  47.  
  48. ;;;;
  49. ;;;; KEY TRANSLATIONS
  50. ;;;;
  51.  
  52. ;; Since apollo.el does not assign names to keypad keys until Version
  53. ;; 18.55, we do this here for Version 18.54.  (We chose to use the EDT
  54. ;; Emulation keypad names for the Apollo keypad keys to avoid the need
  55. ;; for two levels of translation, in case you are wondering why we did
  56. ;; not use the 18.55 version names.)
  57. ;;
  58. ;; Note that the Apollo numeric keypad has the same physical layout as
  59. ;; the VT100 keypad, except for the markings on two keys.  The Apollo
  60. ;; "+" keypad key is located where the VT100 keyboard has its "-"
  61. ;; keypad key.  And the Apollo "-" keypad key is located where the
  62. ;; VT100 has its "," keypad key.  So, when binding the Apollo "+" and
  63. ;; "-" keypad keys, we treat them as VT100 "-" and "," keypad keys,
  64. ;; in that order.
  65. ;;
  66. ;; Version 18.54 recognizes shifted keypad keys for all keypad keys
  67. ;; except the enter key.  It does NOT recognize control keypad
  68. ;; sequences.
  69.  
  70. (defvar *apollo-old-emacs-keypad*
  71.   '(("KP0" . "0") ("KP1" . "1") ("KP2" . "2") ("KP3" . "3") ("KP4" . "4")
  72.     ("KP5" . "5") ("KP6" . "6") ("KP7" . "7") ("KP8" . "8") ("KP9" . "9")
  73.     ("KP-" . "+") ("KP," . "-") ("KPE" . "\^M") ("KPP" . ".")
  74.     ("KP0S" . ")") ("KP1S" . "!") ("KP2S" . "@") ("KP3S" . "#") ("KP4S" . "$")
  75.     ("KP5S" . "%") ("KP6S" . "^") ("KP7S" . "&") ("KP8S" . "*") ("KP9S" . "(")
  76.     ("KP+S" . "=") ("KP-S" . "_") ("KPPS" . ",")))
  77.  
  78.  
  79. ;; VT100/VT200/VT300 function key and keypad keynames are mapped to
  80. ;; corresponding Apollo keynames, below.  This is done for keys with
  81. ;; the same function but different names on the two keyboards.  When
  82. ;; there is no obvious Apollo function key to map to a VT100/VT200/VT300
  83. ;; key, we map the key to the empty string.  This informs the function
  84. ;; edt-bind-function-key, defined later in this file, to ignore any
  85. ;; request to define such a key.  This is necessary because the file
  86. ;; edt.el attempts to bind ALL standard VT100/VT200/VT300 function keys,
  87. ;; by default.
  88. ;;
  89. ;; (EDT users will appreciate the fact that we did NOT follow Apollo's
  90. ;; lead and map PF1-PF4 to Apollo's F2-F5 keys, as is done in the
  91. ;; Apollo VT100 emulator!)
  92.  
  93. (defvar *apollo-edt-keys*
  94.   '(("PF1" . "R3") ("PF2" . "R4") ("PF3" . "R5") ("PF4" . "R6") 
  95.     ("UP" . "L8") ("DOWN" . "LE") ("LEFT" . "LA") ("RIGHT" . "LC")
  96.     ("KP0" . "NP0") ("KP1" . "NP1") ("KP2" . "NP2") ("KP3" . "NP3") 
  97.     ("KP4" . "NP4") ("KP5" . "NP5") ("KP6" . "NP6") ("KP7" . "NP7") 
  98.     ("KP8" . "NP8") ("KP9" . "NP9") ("KP-" . "NPG") ("KP," . "NPF") 
  99.     ("KPP" . "NPP") ("KPE" . "NPE") ("FIND" . "") ("INSERT" . "")
  100.     ("REMOVE" . "") ("SELECT" . "") ("NEXT" . "") ("PREVIOUS" . "")
  101.     ;; VT200 F10 is mapped to F0; F20 to Shifted F0; F11-F14 to 
  102.     ;; Shifted F1-F4; F17-F19 to Shifted F7-F9; DO (F15) to Shifted F5.
  103.     ;; HELP (F16) to Shifted F6.
  104.     ("F10" . "F0") ("F11" . "F1S") ("F12" . "F2S") ("F13" . "F3S")
  105.     ("F14" . "F4S") ("DO" . "F5S") ("HELP" . "F6S") ("F17" . "F7S")
  106.     ("F18" . "F8S") ("F19" . "F9S") ("F20" . "F0S")))
  107.  
  108. ;; Combine the list of EDT key names with the list of Apollo function
  109. ;; keys found in apollo.el.
  110.  
  111. (setq *apollo-edt-function-keys* 
  112.       (append *apollo-edt-keys* *apollo-function-keys*
  113.               ;; The return key is called CR in 18.54 and RET in 18.55 and above.
  114.               ;; By mapping RET to CR, when using 18.54, RET will work in all
  115.               ;; versions.
  116.               (if edt-old-emacs '(("RET" . "CR")))))
  117.  
  118. ;;;;
  119. ;;;; BINDS VT100/VT200/VT300 FUNCTION KEYS
  120. ;;;;
  121. ;; The function edt-bind-function-key is keyboard/terminal dependent.
  122.  
  123. ;; The version below is somewhat messy because of the special handling
  124. ;; added to it to support the Apollo mods in Version 18.54.
  125.  
  126. (defun edt-bind-function-key 
  127.     (function-key binding gold-binding &optional default)
  128.   "Bind commands to a function key in the EDT Emulator."
  129.   (catch 'edt-key-not-supported
  130.     (let ((numeric-code (cdr (assoc function-key  *apollo-edt-function-keys*)))
  131.           (key-sequence))
  132.       (if (null numeric-code)
  133.           (error "%s is not a legal function key name" function-key)
  134.           (if (stringp numeric-code)
  135.               (if (string-equal "" numeric-code)
  136.                   (throw 'edt-key-not-supported t)
  137.                   (setq numeric-code 
  138.                         (cdr (assoc numeric-code *apollo-edt-function-keys*))))))
  139.       ;; If numeric-code is null at this point and this is Emacs
  140.       ;; Version 18.54, then function-key should be a keypad key,
  141.       ;; which requires special handling.
  142.       (if (null numeric-code)
  143.           (if (not edt-old-emacs) 
  144.               (error "%s is not set up properly in edt-apollo.el" function-key)
  145.               (progn
  146.                 ;; Keypad keys require special handling in Emacs, Version 18.54.
  147.                 (setq numeric-code 
  148.                       (cdr (assoc function-key *apollo-old-emacs-keypad*)))
  149.                 (if (null numeric-code)
  150.                     (error "%s is not a legal function key name" function-key)
  151.                     (progn
  152.                       ;;One code for entire keypad.
  153.                       (enable-apollo-function-key 158) 
  154.                       (setq key-sequence (concat "\M-*\M-\C-~" numeric-code))))))
  155.           (progn
  156.             (enable-apollo-function-key numeric-code)
  157.             (setq key-sequence 
  158.                   (if edt-old-emacs
  159.                       (concat "\M-*" (char-to-string numeric-code))
  160.                       (concat "\C-^" 
  161.                               (char-to-string 
  162.                                 (logior 72 (lsh numeric-code -6)))
  163.                               (char-to-string 
  164.                                 (logior 64 (logand numeric-code 63))))))))
  165.       (if default
  166.           (progn
  167.             (define-key edt-default-global-map key-sequence binding)
  168.             (define-key 'edt-default-gold-map key-sequence gold-binding))
  169.           (progn
  170.             (define-key edt-user-global-map key-sequence binding)
  171.             (define-key 'edt-user-gold-map key-sequence gold-binding))))))
  172.  
  173.  
  174. ;;;;
  175. ;;;; Setup extra default EDT key bindings.
  176. ;;;;
  177.  
  178. ;;; The following function is optional.  If defined, it is called
  179. ;;; during EDT emulation setup.  It permits the binding of
  180. ;;; extra function keys not found on VT100/VT200/VT300 terminals.
  181.  
  182. (defun edt-setup-extra-default-bindings ()
  183.   "Setup EDT default bindings for extra terminal keys."
  184.  
  185.   ;; Shifted PF Keys - Make some Apollo-like assignments.
  186.   (edt-bind-function-key "R3S" 'edt-key-not-assigned 'edt-key-not-assigned t)
  187.   (edt-bind-function-key "R4S" 'save-buffer 'edt-key-not-assigned t)
  188.   (edt-bind-function-key "R5S" 'apollo-abort 'edt-key-not-assigned t)
  189.   (edt-bind-function-key "R6S" 'manual-entry 'edt-key-not-assigned t)
  190.  
  191.   ;; AGAIN Key
  192.   (edt-bind-function-key "R2" 'edt-key-not-assigned 'edt-key-not-assigned t)
  193.   (edt-bind-function-key "R2S" 'toggle-read-only 'edt-key-not-assigned t)
  194.  
  195.   ;; Function Keys
  196.   ;; These Apollo function keys are not bound in edt.el because VT200
  197.   ;; series function keys F1-F5 do not send signals to the host.  So
  198.   ;; we bind the Apollo keys here.
  199.   (edt-bind-function-key "F1" 'edt-key-not-assigned 'edt-key-not-assigned t)
  200.   (edt-bind-function-key "F2" 'edt-key-not-assigned 'edt-key-not-assigned t)
  201.   (edt-bind-function-key "F3" 'edt-key-not-assigned 'edt-key-not-assigned t)
  202.   (edt-bind-function-key "F4" 'edt-key-not-assigned 'edt-key-not-assigned t)
  203.   (edt-bind-function-key "F5" 'edt-key-not-assigned 'edt-key-not-assigned t)
  204.  
  205.   ;; Other Keys
  206.   ;;
  207.   ;; Apollo mods, by default, do not support re-defining the following
  208.   ;; keys, except when Emacs source changes are made to enable
  209.   ;; modification of these keys.  So, the following key re-definitions
  210.   ;; may be ignored at your site.  (See APOLLO.README that comes with
  211.   ;; the Apollo distribution.)  In addition, Version 18.54 Apollo mods
  212.   ;; do not support re-defining the DELETE key under any
  213.   ;; circumstances!
  214.  
  215.   (edt-bind-function-key "RET" 'newline 'newline-and-indent t)
  216.   (edt-bind-function-key "BS" 'edt-beginning-of-line 'delete-other-windows t)
  217.   (if (not edt-old-emacs)
  218.     (edt-bind-function-key "DEL" 'backward-delete-char-untabify 'delete-window t))
  219. )
  220.  
  221. ;;;;
  222. ;;;; SET UP ADDITIONAL PREFIX MAPS.
  223. ;;;;
  224.  
  225. ;;; The following functions are also optional.  If defined, they are
  226. ;;; called during EDT emulation setup.  If a terminal generates more
  227. ;;; than one character sequence prefix for its function keys, then
  228. ;;; separate keymaps must be maintained for each additional prefix.
  229. ;;; For example, the VT200/VT300 series terminals have "\eO" and "\e["
  230. ;;; as function key prefixes.  These maps must be created and assigned
  231. ;;; to the prefix character sequences in the appropriate global map.
  232.  
  233. ;;; Although the Apollo function keys in Emacs versions 18.55, and
  234. ;;; above, all have "\C-^" as a prefix, eight external "sub-prefix"
  235. ;;; maps are defined as part of the implementation.  In order to keep
  236. ;;; the EDT default bindings, the EDT user bindings, and the initial
  237. ;;; Emacs bindings independent, separate versions of these
  238. ;;; "sub-prefix" maps must be maintained for the three sets of
  239. ;;; bindings.  (See apollo.el.)
  240. ;;;
  241. ;;; Apollo Emacs version 18.54 has no additional prefix maps.
  242. ;;;
  243.  
  244. (if (not edt-old-emacs)
  245.     (progn
  246.       (defun edt-additional-default-prefix-map-setup ()
  247.         "Setup additional terminal specific prefix maps."
  248.         (fset 'edt-default-prefix (copy-keymap 'apollo-prefix))
  249.         (define-key edt-default-global-map "\C-^" 'edt-default-prefix)
  250.         (fset 'edt-default-prefix-1 (copy-keymap 'apollo-prefix-1))
  251.         (fset 'edt-default-prefix-2 (copy-keymap 'apollo-prefix-2))
  252.         (fset 'edt-default-prefix-3 (copy-keymap 'apollo-prefix-3))
  253.         (fset 'edt-default-prefix-4 (copy-keymap 'apollo-prefix-4))
  254.         (fset 'edt-default-prefix-5 (copy-keymap 'apollo-prefix-5))
  255.         (fset 'edt-default-prefix-6 (copy-keymap 'apollo-prefix-6))
  256.         (fset 'edt-default-prefix-7 (copy-keymap 'apollo-prefix-7))
  257.         (fset 'edt-default-prefix-8 (copy-keymap 'apollo-prefix-8))
  258.         (define-key 'edt-default-prefix "H" 'edt-default-prefix-1)
  259.         (define-key 'edt-default-prefix "I" 'edt-default-prefix-2)
  260.         (define-key 'edt-default-prefix "J" 'edt-default-prefix-3)
  261.         (define-key 'edt-default-prefix "K" 'edt-default-prefix-4)
  262.         (define-key 'edt-default-prefix "L" 'edt-default-prefix-5)
  263.         (define-key 'edt-default-prefix "M" 'edt-default-prefix-6)
  264.         (define-key 'edt-default-prefix "N" 'edt-default-prefix-7)
  265.         (define-key 'edt-default-prefix "O" 'edt-default-prefix-8)
  266.         )
  267.       (defun edt-additional-user-prefix-map-setup ()
  268.         "Setup additional terminal specific prefix maps."
  269.         (fset 'edt-user-prefix (copy-keymap 'edt-default-prefix))
  270.         (define-key edt-user-global-map "\C-^" 'edt-user-prefix)
  271.         (fset 'edt-user-prefix-1 (copy-keymap 'edt-default-prefix-1))
  272.         (fset 'edt-user-prefix-2 (copy-keymap 'edt-default-prefix-2))
  273.         (fset 'edt-user-prefix-3 (copy-keymap 'edt-default-prefix-3))
  274.         (fset 'edt-user-prefix-4 (copy-keymap 'edt-default-prefix-4))
  275.         (fset 'edt-user-prefix-5 (copy-keymap 'edt-default-prefix-5))
  276.         (fset 'edt-user-prefix-6 (copy-keymap 'edt-default-prefix-6))
  277.         (fset 'edt-user-prefix-7 (copy-keymap 'edt-default-prefix-7))
  278.         (fset 'edt-user-prefix-8 (copy-keymap 'edt-default-prefix-8))
  279.         (define-key 'edt-user-prefix "H" 'edt-user-prefix-1)
  280.         (define-key 'edt-user-prefix "I" 'edt-user-prefix-2)
  281.         (define-key 'edt-user-prefix "J" 'edt-user-prefix-3)
  282.         (define-key 'edt-user-prefix "K" 'edt-user-prefix-4)
  283.         (define-key 'edt-user-prefix "L" 'edt-user-prefix-5)
  284.         (define-key 'edt-user-prefix "M" 'edt-user-prefix-6)
  285.         (define-key 'edt-user-prefix "N" 'edt-user-prefix-7)
  286.         (define-key 'edt-user-prefix "O" 'edt-user-prefix-8)
  287.         )
  288.       )
  289.     )
  290.  
  291. ;;;;
  292. ;;;; TERMINAL SPECIFIC VERSIONS OF COMMANDS
  293. ;;;;
  294.  
  295. ;;; Screen width commands often need terminal specific enhancements.
  296. ;;; The following two commands are specific to an Apollo 19-inch
  297. ;;; Landscape 1280x1024 Monitor.  The "execute-dm-command" lines
  298. ;;; produce windows of sizes 80 and 132 characters wide only if a
  299. ;;; fix-length font, such as f7x13, or equivalent, is in use.  These
  300. ;;; place the windows in a fixed location on the screen, which may or
  301. ;;; may not be acceptable to individual people.  Such users should
  302. ;;; write their own versions of these two commands and place them in
  303. ;;; edt-user.el. 
  304. ;;;
  305. ;;; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  306. ;;; The following Apollo DM command will create an Emacs window to
  307. ;;; match the 80 column mode setting:
  308. ;;;
  309. ;;;   (230,0)dr;(980,996)cp -n Emacs -c 'e' /gnuemacs/emacs; wc -a
  310. ;;;
  311. ;;; You may also find the following DM key definitions of interest:
  312. ;;;
  313. ;;;   kd f2 wi Emacs -w; icon Emacs -W; wp Emacs -t ke
  314. ;;;   kd f2s (230,0)dr;(980,996)cp -n Emacs -c 'e' /gnuemacs/emacs; wc -a ke
  315. ;;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  316.  
  317. ;;;
  318. ;;; SET APOLLO WINDOW 80
  319. ;;;
  320.  
  321. (defun edt-set-screen-width-80 ()
  322.   "Set Apollo Emacs pad size to 80 columns."
  323.   (interactive)
  324.   (execute-dm-command "twb -l;dr;(230,0)wg;twb -r;twb -b;dr;(980,996)wg;tl")
  325.   (set-screen-width 80))
  326.  
  327. ;;;
  328. ;;; SET APOLLO WINDOW 132
  329. ;;;
  330.  
  331. (defun edt-set-screen-width-132 ()
  332.   "Set Apollo Emacs pad size to 132 columns."
  333.   (interactive)
  334.   (execute-dm-command "twb -l;dr;(0,0)wg;twb -r;twb -b;dr;(1279,996)wg;tl")
  335.   (set-screen-width 132))
  336.  
  337.  
  338. ;;;
  339. ;;; APOLLO MOUSE MARK
  340. ;;;
  341.  
  342. (defun edt-apollo-mouse-mark ()
  343.   "Select the point at which to begin mouse editing functions."
  344.   (interactive)
  345.   (apollo-mouse-move-point)
  346.   (set-mark-command nil)
  347.   (point-to-register 1))
  348.  
  349. ;;;
  350. ;;; APOLLO MOUSE COPY
  351. ;;;
  352.  
  353. (defun edt-apollo-mouse-copy ()
  354.   "Copy text between mark and mouse cursor."
  355.   (interactive)
  356.   (apollo-mouse-move-point)
  357.   (set-mark-command nil)
  358.   (point-to-register 2)
  359.   (if (eq (register-to-point 1) (register-to-point 2))
  360.       nil 
  361.       (kill-ring-save (register-to-point 1) (register-to-point 2))))
  362.  
  363. ;;;
  364. ;;; APOLLO MOUSE CUT
  365. ;;;
  366.  
  367. (defun edt-apollo-mouse-cut ()
  368.   "Cut text between mark and mouse cursor."
  369.   (interactive)
  370.   (apollo-mouse-move-point)
  371.   (set-mark-command nil)
  372.   (point-to-register 2)
  373.   (if (eq (register-to-point 1) (register-to-point 2)) 
  374.       nil 
  375.       (kill-region (register-to-point 1) (register-to-point 2))))
  376.  
  377. ;;;
  378. ;;; APOLLO MOUSE PASTE
  379. ;;;
  380.  
  381. (defun edt-apollo-mouse-paste ()
  382.   "Paste text previously cut or copied."
  383.   (interactive)
  384.   (apollo-mouse-move-point)
  385.   (set-mark-command nil)
  386.   (point-to-register 1)
  387.   (yank)
  388.   (register-to-point 1))
  389.  
  390.  
  391. ;;;
  392. ;;; DEFAULT EDT KEYPAD HELP
  393. ;;;
  394. ;; This version is essentially identical to that defined in edt.el,
  395. ;; except that it shows the Apollo specific markings found on some of
  396. ;; the keys.
  397. ;;
  398. ;; Upper case commands in the keypad diagram below indicate that the
  399. ;; emulation should look and feel very much like EDT.  Lower case
  400. ;; commands are enhancements and/or additions to the EDT keypad
  401. ;; commands or are native Emacs commands.
  402.  
  403. (defun edt-keypad-help ()
  404.   "
  405.                               DEFAULT EDT Keypad Active
  406.  
  407.                                   +----------+----------+----------+----------+
  408.    F7: Copy Rectangle             |Prev Line |Next Line |Bkwd Char |Frwd Char |
  409.    F8: Cut Rect Overstrike        |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
  410.  G-F8: Paste Rect Overstrike      |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
  411.    F9: Cut Rect Insert            +----------+----------+----------+----------+
  412.  G-F9: Paste Rect Insert         
  413.   F11: ESC                            PF1        PF2        PF3        PF4
  414.                        +----------+----------+----------+----------+----------+
  415.                        |          |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
  416.                        |  (AGAIN) |  (READ)  |  (EDIT)  |  (EXIT)  |  (HOLD)  |
  417.                        |          |Mark Wisel|Desc Funct|   FIND   |  UND L   |
  418.                        +----------+----------+----------+----------+----------+
  419.   F12: Begining of Line           +----------+----------+----------+----------+
  420. G-F12: Delete Other Windows       |   PAGE   |   SECT   |  APPEND  |  DEL W   |
  421.   F13: Delete to Begin of Word    |    (7)   |    (8)   |    (9)   |   (+)    |
  422.  HELP: Emacs Help                 |Ex Ext Cmd|Fill Regio| REPLACE  |  UND W   |
  423.    DO: Execute extended command   +----------+----------+----------+----------+
  424.                                   |  ADVANCE |  BACKUP  |   CUT    |  DEL C   |
  425.   C-g: Keyboard Quit              |    (4)   |    (5)   |    (6)   |   (-)    |
  426. G-C-g: Keyboard Quit              |   BOTTOM |    TOP   |   Yank   |  UND C   |
  427.   C-h: Beginning of Line          +----------+----------+----------+----------+
  428. G-C-h: Emacs Help                 |   WORD   |    EOL   |   CHAR   |   Next   |
  429.   C-i: Tab Insert                 |    (1)   |    (2)   |    (3)   |  Window  |
  430.   C-j: Delete to Begin of Word    | CHNGCASE |  DEL EOL |Quoted Ins|          |
  431.   C-k: Define Key                 +---------------------+----------+  (ENTER) |
  432. G-C-k: Restore Key                |         LINE        |SELECT/RES|          |
  433.   C-l: Form Feed Insert           |         (0)         |    (.)   |   Query  |
  434.   C-n: Set Screen Width 80        |      Open Line      |Center Lin|  Replace |
  435.   C-r: Isearch Backward           +---------------------+----------+----------+
  436.   C-s: Isearch Forward         
  437.   C-t: Display the Time        
  438.   C-u: Delete to Begin of Line   
  439.   C-v: Redraw Display            
  440.   C-w: Set Screen Width 132      
  441.   C-z: Suspend Emacs             
  442. G-C-\\: Split Window             
  443.                                  
  444.   G-b: Buffer Menu               
  445.   G-c: Compile                   
  446.   G-d: Delete Window             
  447.   G-e: Exit                      
  448.   G-f: Find File                 
  449.   G-g: Find File Other Window    
  450.   G-h: Keypad Help               
  451.   G-i: Insert File               
  452.   G-k: Toggle Capitalization Word
  453.   G-l: Downcase Region           
  454.   G-m: Save Some Buffers         
  455.   G-n: Next Error                
  456.   G-o: Switch to Next Window     
  457.   G-q: Quit                      
  458.   G-r: Revert File               
  459.   G-s: Save Buffer               
  460.   G-u: Upcase Region             
  461.   G-v: Find File Other Window    
  462.   G-w: Write file                
  463.   G-y: EDT Emulation OFF         
  464.   G-z: Switch to User EDT Key Bindings
  465.   G-1: Delete Other Windows      
  466.   G-2: Split Window              
  467.   G-%: Go to Percentage          
  468.   G- : Undo  (GOLD Spacebar)     
  469.   G-=: Go to Line                
  470.   G-`: What line"                
  471.  
  472.   (interactive)
  473.   (describe-function 'edt-keypad-help))
  474.  
  475.  
  476. ;;;
  477. ;;; CUSTOMIZE DEFAULT EMACS BINDINGS
  478. ;;;
  479. ;; Some site-specific and/or computer-specific Emacs installations may
  480. ;; contain some built-in support for function keys on a given terminal
  481. ;; and may provide some default bindings to those keys.  Sometimes
  482. ;; these bindings are made by using Emacs macros to equate the
  483. ;; function key to control key, for example.  This means that when the
  484. ;; EDT emulation re-defines that control key, the function key default
  485. ;; definition is re-defined, as well, often causing undesired results.
  486. ;; To avoid this problem, when EDT emulation begins initialization, it
  487. ;; looks to see if the function edt-customize-default-emacs-bindings
  488. ;; has been defined.  If so, it calls this function before starting
  489. ;; the EDT Emulation initialization.
  490.  
  491. ;; The Apollo default assignments to several Apollo function keys do,
  492. ;; indeed, have this problem, so we modify the bindings of those keys
  493. ;; to eliminate the problem. 
  494.  
  495. (defun edt-customize-default-emacs-bindings ()
  496.   "Change some emacs defaults before EDT emulation initialization."
  497.   (bind-apollo-function-key "LINE_DEL" 'edt-delete-entire-line)
  498.   (bind-apollo-function-key "CHAR_DEL" 'edt-delete-character)
  499.   (bind-apollo-function-key "L_BAR_ARROW" 'beginning-of-line)
  500.   (bind-apollo-function-key "R_BAR_ARROW" 'end-of-line)
  501.   (bind-apollo-function-key "R3S" 'apollo-find-file) ;Shift READ
  502.   (bind-apollo-function-key "L2S" 'edt-undelete-line) ;Shift LINE DEL
  503.   (bind-apollo-function-key "L3S" 'edt-undelete-character) ;Shift CHAR DEL
  504.   (bind-apollo-function-key "LAS" 'edt-one-word-backward) ;Shift LEFT ARROW
  505.   (bind-apollo-function-key "LCS" 'edt-one-word-forward) ;Shift RIGHT ARROW
  506.   (bind-apollo-function-key "L8S" 
  507.                             'edt-scroll-window-backward-line) ;Shift UP ARROW
  508.   (bind-apollo-function-key "LES" 
  509.                             'edt-scroll-window-forward-line) ;Shift DOWN ARROW
  510.   (bind-apollo-function-key "LF" 'scroll-up) ;DOWN BOX ARROW
  511. )
  512.  
  513. ;; A user version of this function is available: 
  514. ;;
  515. ;;          edt-user-customize-default-emacs-bindings
  516. ;;
  517. ;; If defined in edt-user.el, it will be called immediately after 
  518. ;; edt-customize-default-emacs-bindings and before EDT emulation
  519. ;; initialization begins.
  520.