To use it, add the following line to your ~/.emacs file:
(require 'fkeys "/mit/consult/lib/elisp/fkeys")NOTE: It is assumed that you have the consult locker attached. You can put the statement attach consult in your .environment file to have that done automatically.
If you are on a DECstation, the following variables will be defined:
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F12, F13, F14, F17, F18, F19, F20, INSERT, HELP, DO, FIND, SELECTNote that the key F11 is the ESCape key, and the keys F15 and F16 do not exist.
On the RS/6000, the following are defined:
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PRINT-SCREEN, INSERTOn the RS/6000 only, you can also bind the following:
SCROLL-LOCK, PAUSE, HOME, PAGE-UP, PAGE-DOWNNote: Emacs on the RS/6000, when run with -nw, does NOT know about the PRINT-SCREEN, SCROLL-LOCK, and PAUSE keys.
Finally, fkeys.el also automatically defines the elisp variable fnkey-map, which is the keymap used to access these keys.
So, for example, to define the first few function keys:
(define-key fnkey-map F1 'save-buffer) (define-key fnkey-map F2 'do-this) (define-key fnkey-map F3 'do-that)Easy enough. To special-case bindings in ~/.emacs depending on what type of platform you are on, you can use the machtype elisp function defined by fkeys.el (actually by /mit/consult/lib/elisp/toolbox.el). Note that you only need to do this if you want the same key to do different things on different workstations (ex. F10 on DEC does the same thing as F14 on the RS/6000). In most cases you probably will not need to do this.
(let ((machine-type (machtype))) (cond ((equal machine-type "decmips") ... define my DEC key bindings here ... ) ((equal machine-type "rsaix") ... define my RS/6000 key bindings here ... )))machtype returns whatever typing machtype at the athena% prompt returns.
KNOWN PROBLEMS: If you run Emacs on another display with the -display option, you will probably have problems if the remote host (on which the Emacs window is showing up) is a different type of workstation than the local host (the one actually running Emacs), and thus fkeys.el will configure the function keys for the local host and not the remote host.