emacs/lisp/emulation/edt-mapper.el

524 lines
18 KiB
EmacsLisp
Raw Normal View History

* lisp/emulation/: Use lexical-binding * lisp/emulation/cua-base.el: Use lexical-binding. Remove redundant `:group` arguments. (cua-mode): Don't use `:require` since the autoload on `define-minor-mode` takes care of loading the mode when custom-setting it. * lisp/emulation/cua-gmrk.el: Use lexical-binding. (cua--copy-rectangle-to-global-mark): Remove unused var `src-buf`. * lisp/emulation/edt-mapper.el: Use lexical-binding. * lisp/emulation/edt.el: Use lexical-binding. Remove redundant `:group` arguments. (edt-with-position): Allow `top`, `left`, and `far` to be left unused in `body`. * lisp/emulation/keypad.el: Use lexical-binding. * lisp/emulation/viper-cmd.el: Move `provide` to the end. (viper-read-string-with-history): Strength reduce `eval` to `symbol-value`. * lisp/emulation/viper-ex.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. * lisp/emulation/viper-init.el: Use lexical-binding. * lisp/emulation/viper-keym.el (viper-toggle-key): Use `dolist`. (viper-insert-diehard-map): Use `string`. (viper-modify-major-mode): Use `alist-get` and `setf`. * lisp/emulation/viper-macs.el (viper-ex-work-buf): Move `provide` to the end. (viper-record-kbd-macro): Strength reduce `eval` to `symbol-value`. (viper-describe-kbd-macros): Return value is not significant. (viper-keyseq-is-a-possible-macro): Use `seq-some`. (viper-common-seq-prefix): Use `seq-every-p`. * lisp/emulation/viper-mous.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. (viper-remember-current-frame): Accept arbitrary ignored args. (viper-parse-mouse-key): Strength reduce `eval` to `symbol-value`. Remove unused var `key-spec`. (viper-bind-mouse-search-key, viper-bind-mouse-insert-key): Apply de Morgan. * lisp/emulation/viper-util.el: Move `provide` to the end. (viper-move-marker-locally, viper-push-onto-ring, viper-save-setting): Strength reduce `eval` to `symbol-value`. (viper-event-vector-p, viper-char-symbol-sequence-p, viper-char-array-p): Use `seq-every-p`. * lisp/emulation/viper.el (viper-non-hook-settings): Eta-reduce use of `viper-remember-current-frame`.
2021-03-06 13:03:12 -05:00
;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs -*- lexical-binding: t; -*-
1995-02-08 01:25:15 +00:00
2022-01-01 02:45:51 -05:00
;; Copyright (C) 1994-1995, 2000-2022 Free Software Foundation, Inc.
1995-02-08 01:25:15 +00:00
;; Author: Kevin Gallagher <kevin.gal@verizon.net>
1995-02-08 01:25:15 +00:00
;; Keywords: emulations
;; Package: edt
1995-02-08 01:25:15 +00:00
1995-02-08 01:26:46 +00:00
;; This file is part of GNU Emacs.
1995-02-08 01:25:15 +00:00
;; GNU Emacs is free software: you can redistribute it and/or modify
1995-02-08 01:25:15 +00:00
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
1995-02-08 01:25:15 +00:00
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
1995-02-08 01:25:15 +00:00
;;; Commentary:
;;
1995-02-08 01:25:15 +00:00
;; [Part of the GNU Emacs EDT Emulation.]
1995-02-08 01:25:15 +00:00
2021-04-16 14:35:25 +02:00
;; This Emacs Lisp program can be used to create an Emacs Lisp file
;; that defines the mapping of the user's keyboard to the LK-201
;; keyboard function keys and keypad keys (around which EDT has been
;; designed). Please read the "Usage" AND "Known Problems" sections
;; below before attempting to run this program. (The design of this
;; file, edt-mapper.el, was heavily influenced by tpu-mapper.el.)
;; Version 4.0 contains the following enhancements:
;; 1. If you access a workstation using an X Server, note that the
;; initialization file generated by edt-mapper.el will now
;; contain the name of the X Server vendor. This is a
;; convenience for those who have access to their Unix account
;; from more than one type of X Server. Since different X
;; Servers typically require different EDT emulation
;; initialization files, edt-mapper.el will now generate these
;; different initialization files and save them with different
;; names.
;; 2. Also, edt-mapper.el is now capable of binding an ASCII key
;; sequence, providing the ASCII key sequence prefix is already
;; known by Emacs to be a prefix. As a result, some
;; terminal/keyboard/window system configurations, which don't
;; have a complete set of sensible function key map bindings, can
;; still be configured for EDT Emulation.
;; Usage:
;; Simply load this file into Emacs and run the function edt-mapper,
;; using the following command.
1995-02-08 01:25:15 +00:00
;; emacs -q -l edt-mapper -f edt-mapper
1995-02-08 01:25:15 +00:00
Update docstrings and comments to use "init file" terminology. * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise.
2012-09-17 13:41:04 +08:00
;; The "-q" option prevents loading of your init file (commands
;; therein might confuse this program).
1995-02-08 01:25:15 +00:00
;; An instruction screen showing the typical LK-201 terminal
;; functions keys will be displayed, and you will be prompted to
;; press the keys on your keyboard which you want to emulate the
;; corresponding LK-201 keys.
1995-02-08 01:25:15 +00:00
;; Finally, you will be prompted for the name of the file to store
;; the key definitions. If you chose the default, it will be found
;; and loaded automatically when the EDT emulation is started. If
;; you specify a different file name, you will need to set the
;; variable "edt-keys-file" before starting the EDT emulation.
Update docstrings and comments to use "init file" terminology. * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise.
2012-09-17 13:41:04 +08:00
;; Here's how you might go about doing that in your init file:
1995-02-08 01:25:15 +00:00
;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys"))
;; Known Problems:
;; Sometimes, edt-mapper will ignore a key you press, and just
;; continue to prompt for the same key. This can happen when your
;; window manager sucks up the key and doesn't pass it on to Emacs,
;; or it could be an Emacs bug. Either way, there's nothing that
;; edt-mapper can do about it. You must press RETURN, to skip the
;; current key and continue. Later, you and/or your local Emacs guru
;; can try to figure out why the key is being ignored.
1995-02-08 01:25:15 +00:00
;;; History:
2002-10-18 08:59:10 +00:00
;;
1995-02-08 01:25:15 +00:00
;; Version 4.0 2000 Added 2 New Features
1995-02-08 01:25:15 +00:00
;;; Code:
1995-02-08 01:25:15 +00:00
;;;
;;; Determine Window System, and X Server Vendor (if appropriate).
1995-02-08 01:25:15 +00:00
;;;
(define-obsolete-variable-alias 'edt-window-system 'window-system "27.1")
(defconst edt-xserver (when (eq window-system 'x)
(declare-function x-server-vendor "xfns.c"
(&optional terminal))
;; The Cygwin window manager has a `/' in its
;; name, which breaks the generated file name of
;; the custom key map file. Replace `/' with a
;; `-' to work around that.
(replace-regexp-in-string "[ /]" "-"
(x-server-vendor)))
"Indicates X server vendor name, if applicable.")
1995-02-08 01:25:15 +00:00
;;;
;;; Key variables
;;;
;; FIXME some/all of these should be let-bound, not global.
1995-02-08 01:25:15 +00:00
(defvar edt-key nil)
(defvar edt-enter nil)
(defvar edt-return nil)
(defvar edt-key-seq nil)
(defvar edt-enter-seq nil)
(defvar edt-return-seq nil)
(defvar edt-term nil)
1995-02-08 01:25:15 +00:00
;; To silence the byte-compiler
2008-06-07 02:44:49 +00:00
(defvar EDT-key-name)
(defvar edt-save-function-key-map)
2002-10-18 08:59:10 +00:00
;;;
;;; Key mapping functions
1995-02-08 01:25:15 +00:00
;;;
(defun edt-map-key (ident descrip)
(interactive)
(setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip)))
(cond ((not (equal edt-key edt-return))
(set-buffer "Keys")
(insert (if (vectorp edt-key)
(format " (\"%s\" . %s)\n" ident edt-key)
(format " (\"%s\" . \"%s\")\n" ident edt-key)))
(set-buffer "Directions"))
;; bogosity to get next prompt to come up, if the user hits <CR>!
;; check periodically to see if this is still needed...
(t
(set-buffer "Keys")
(insert (format " (\"%s\" . \"\" )\n" ident))
(set-buffer "Directions")))
edt-key)
1995-02-08 01:25:15 +00:00
(defun edt-mapper ()
(if noninteractive
(user-error "edt-mapper cannot be loaded in batch mode"))
;; Determine Terminal Type (if appropriate).
(if (and window-system (not (eq window-system 'tty)))
(setq edt-term nil)
(setq edt-term (getenv "TERM")))
;;
;; Implements a workaround for a feature that was added to simple.el.
;;
;; Many function keys have no Emacs functions assigned to them by
;; default. A subset of these are typically assigned functions in the
;; EDT emulation. This includes all the keypad keys and a some others
;; like Delete.
;;
;; Logic in simple.el maps some of these unassigned function keys to
;; ordinary typing keys. Where this is the case, a call to
;; read-key-sequence, below, does not return the name of the function
;; key pressed by the user but, instead, it returns the name of the
;; key to which it has been mapped. It needs to know the name of the
;; key pressed by the user. As a workaround, we assign a function to
;; each of the unassigned function keys of interest, here. These
;; assignments override the mapping to other keys and are only
;; temporary since, when edt-mapper is finished executing, it causes
;; Emacs to exit.
;;
(mapc
(lambda (function-key)
(if (not (lookup-key (current-global-map) function-key))
* lisp/emulation/: Use lexical-binding * lisp/emulation/cua-base.el: Use lexical-binding. Remove redundant `:group` arguments. (cua-mode): Don't use `:require` since the autoload on `define-minor-mode` takes care of loading the mode when custom-setting it. * lisp/emulation/cua-gmrk.el: Use lexical-binding. (cua--copy-rectangle-to-global-mark): Remove unused var `src-buf`. * lisp/emulation/edt-mapper.el: Use lexical-binding. * lisp/emulation/edt.el: Use lexical-binding. Remove redundant `:group` arguments. (edt-with-position): Allow `top`, `left`, and `far` to be left unused in `body`. * lisp/emulation/keypad.el: Use lexical-binding. * lisp/emulation/viper-cmd.el: Move `provide` to the end. (viper-read-string-with-history): Strength reduce `eval` to `symbol-value`. * lisp/emulation/viper-ex.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. * lisp/emulation/viper-init.el: Use lexical-binding. * lisp/emulation/viper-keym.el (viper-toggle-key): Use `dolist`. (viper-insert-diehard-map): Use `string`. (viper-modify-major-mode): Use `alist-get` and `setf`. * lisp/emulation/viper-macs.el (viper-ex-work-buf): Move `provide` to the end. (viper-record-kbd-macro): Strength reduce `eval` to `symbol-value`. (viper-describe-kbd-macros): Return value is not significant. (viper-keyseq-is-a-possible-macro): Use `seq-some`. (viper-common-seq-prefix): Use `seq-every-p`. * lisp/emulation/viper-mous.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. (viper-remember-current-frame): Accept arbitrary ignored args. (viper-parse-mouse-key): Strength reduce `eval` to `symbol-value`. Remove unused var `key-spec`. (viper-bind-mouse-search-key, viper-bind-mouse-insert-key): Apply de Morgan. * lisp/emulation/viper-util.el: Move `provide` to the end. (viper-move-marker-locally, viper-push-onto-ring, viper-save-setting): Strength reduce `eval` to `symbol-value`. (viper-event-vector-p, viper-char-symbol-sequence-p, viper-char-array-p): Use `seq-every-p`. * lisp/emulation/viper.el (viper-non-hook-settings): Eta-reduce use of `viper-remember-current-frame`.
2021-03-06 13:03:12 -05:00
(define-key (current-global-map) function-key #'forward-char)))
'([kp-0] [kp-1] [kp-2] [kp-3] [kp-4]
[kp-5] [kp-6] [kp-7] [kp-8] [kp-9]
[kp-space]
[kp-tab]
[kp-enter]
[kp-multiply]
[kp-add]
[kp-separator]
[kp-subtract]
[kp-decimal]
[kp-divide]
[kp-equal]
[backspace]
[delete]
[tab]
[linefeed]
[clear]))
;;
;; Make sure the window is big enough to display the instructions,
;; except where window cannot be re-sized.
;;
(if (and window-system (not (eq window-system 'tty)))
(set-frame-size (selected-frame) 80 36))
;;
;; Create buffers - Directions and Keys
;;
(if (not (get-buffer "Directions")) (generate-new-buffer "Directions"))
(if (not (get-buffer "Keys")) (generate-new-buffer "Keys"))
;;
;; Put header in the Keys buffer
;;
(set-buffer "Keys")
(insert "\
1995-02-08 01:25:15 +00:00
;;
;; Key definitions for the EDT emulation within GNU Emacs
;;
\(defconst *EDT-keys*
1995-02-08 01:25:15 +00:00
'(
")
;;
;; Display directions
;;
(switch-to-buffer "Directions")
(if (and window-system (not (eq window-system 'tty)))
(insert "
1995-02-08 01:25:15 +00:00
EDT MAPPER
You will be asked to press keys to create a custom mapping (under a
Window Manager) of your keypad keys and function keys so that they can
emulate the LK-201 keypad and function keys or the subset of keys found
on a VT-100 series terminal keyboard. (The LK-201 keyboard is the
standard keyboard attached to VT-200 series terminals, and above.)
1995-02-08 01:25:15 +00:00
Sometimes, edt-mapper will ignore a key you press, and just continue to
prompt for the same key. This can happen when your window manager sucks
2006-11-06 02:35:03 +00:00
up the key and doesn't pass it on to Emacs, or it could be an Emacs bug.
1995-02-08 01:25:15 +00:00
Either way, there's nothing that edt-mapper can do about it. You must
press RETURN, to skip the current key and continue. Later, you and/or
your local system guru can try to figure out why the key is being ignored.
1995-02-08 01:25:15 +00:00
Start by pressing the RETURN key, and continue by pressing the keys
specified in the mini-buffer. If you want to entirely omit a key,
because your keyboard does not have a corresponding key, for example,
1995-02-08 01:25:15 +00:00
just press RETURN at the prompt.
")
(insert "
EDT MAPPER
You will be asked to press keys to create a custom mapping of your
keypad keys and function keys so that they can emulate the LK-201
keypad and function keys or the subset of keys found on a VT-100
series terminal keyboard. (The LK-201 keyboard is the standard
keyboard attached to VT-200 series terminals, and above.)
2002-10-18 08:59:10 +00:00
If you are using a real LK-201 keyboard, you should map the keys
exactly as they are on the keyboard.
Start by pressing the RETURN key, and continue by pressing the keys
specified in the mini-buffer. If you want to entirely omit a key,
because your keyboard does not have a corresponding key, for example,
just press RETURN at the prompt.
"))
(delete-other-windows)
;;
;; Save <CR> for future reference.
;;
;; For Emacs running in a Window System, first hide bindings in
;; function-key-map.
;;
(if window-system
(progn
(setq edt-save-function-key-map function-key-map)
(setq function-key-map (make-sparse-keymap))))
(setq edt-return (read-key-sequence "Hit carriage-return <CR> to continue "))
;;
;; Remove prefix-key bindings to F1 and F2 in global-map so they can be
;; bound in the EDT Emulation mode.
;;
(global-unset-key [f1])
(global-unset-key [f2])
;;
;; Display Keypad Diagram and Begin Prompting for Keys
;;
(set-buffer "Directions")
(delete-region (point-min) (point-max))
(if (and window-system (not (eq window-system 'tty)))
(insert "
1995-02-08 01:25:15 +00:00
PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
Here's a picture of the standard LK-201 keypad for reference:
2014-01-15 22:24:06 -08:00
________________________ _______________________________
| HELP | DO | | F17 | F18 | F19 | F20 |
| | | | | | | |
|_______|________________| |_______|_______|_______|_______|
________________________ _______________________________
| FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
| | | | | | | | |
|_______|________|_______| |_______|_______|_______|_______|
|SELECT |PREVIOUS|NEXT | | KP7 | KP8 | KP9 | KP- |
| | | | | | | | |
|_______|________|_______| |_______|_______|_______|_______|
| UP | | KP4 | KP5 | KP6 | KP, |
| | | | | | |
_______|________|_______ |_______|_______|_______|_______|
| LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
| | | | | | | | |
|_______|________|_______| |_______|_______|_______| KPE |
| KP0 | KPP | |
| | | |
|_______________|_______|_______|
1995-02-08 01:25:15 +00:00
REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY.
1995-02-08 01:25:15 +00:00
")
(progn
(insert "
GENERATING A CUSTOM CONFIGURATION FILE FOR TERMINAL TYPE: ")
(insert (format "%s." edt-term))
(insert "
PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
2014-01-15 22:24:06 -08:00
________________________ _______________________________
| HELP | DO | | F17 | F18 | F19 | F20 |
|_______|________________| |_______|_______|_______|_______|
________________________ _______________________________
| FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
|_______|________|_______| |_______|_______|_______|_______|
|SELECT |PREVIOUS| NEXT | | KP7 | KP8 | KP9 | KP- |
|_______|________|_______| |_______|_______|_______|_______|
| UP | | KP4 | KP5 | KP6 | KP, |
_______|________|_______ |_______|_______|_______|_______|
| LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
|_______|________|_______| |_______|_______|_______| KPE |
| KP0 | KPP | |
|_______________|_______|_______|
REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY.")))
1995-02-08 01:25:15 +00:00
(set-buffer "Keys")
(insert "
1995-02-08 01:25:15 +00:00
;;
;; Arrows
;;
")
(set-buffer "Directions")
1995-02-08 01:25:15 +00:00
(edt-map-key "UP" " - The Up Arrow Key")
(edt-map-key "DOWN" " - The Down Arrow Key")
(edt-map-key "LEFT" " - The Left Arrow Key")
(edt-map-key "RIGHT" " - The Right Arrow Key")
1995-02-08 01:25:15 +00:00
(set-buffer "Keys")
(insert "
1995-02-08 01:25:15 +00:00
;;
;; PF keys
;;
")
(set-buffer "Directions")
1995-02-08 01:25:15 +00:00
(edt-map-key "PF1" " - The PF1 (GOLD) Key")
(edt-map-key "PF2" " - The Keypad PF2 Key")
(edt-map-key "PF3" " - The Keypad PF3 Key")
(edt-map-key "PF4" " - The Keypad PF4 Key")
1995-02-08 01:25:15 +00:00
(set-buffer "Keys")
(insert "
1995-02-08 01:25:15 +00:00
;;
;; KP0-9 KP- KP, KPP and KPE
;;
")
(set-buffer "Directions")
(edt-map-key "KP0" " - The Keypad 0 Key")
(edt-map-key "KP1" " - The Keypad 1 Key")
(edt-map-key "KP2" " - The Keypad 2 Key")
(edt-map-key "KP3" " - The Keypad 3 Key")
(edt-map-key "KP4" " - The Keypad 4 Key")
(edt-map-key "KP5" " - The Keypad 5 Key")
(edt-map-key "KP6" " - The Keypad 6 Key")
(edt-map-key "KP7" " - The Keypad 7 Key")
(edt-map-key "KP8" " - The Keypad 8 Key")
(edt-map-key "KP9" " - The Keypad 9 Key")
(edt-map-key "KP-" " - The Keypad - Key")
(edt-map-key "KP," " - The Keypad , Key")
(edt-map-key "KPP" " - The Keypad . Key")
(edt-map-key "KPE" " - The Keypad Enter Key")
;; Save the enter key
(setq edt-enter edt-key)
(setq edt-enter-seq edt-key-seq)
(set-buffer "Keys")
(insert "
1995-02-08 01:25:15 +00:00
;;
;; Editing keypad (FIND, INSERT, REMOVE)
;; (SELECT, PREVIOUS, NEXT)
;;
")
(set-buffer "Directions")
1995-02-08 01:25:15 +00:00
(edt-map-key "FIND" " - The Find key on the editing keypad")
(edt-map-key "INSERT" " - The Insert key on the editing keypad")
(edt-map-key "REMOVE" " - The Remove key on the editing keypad")
(edt-map-key "SELECT" " - The Select key on the editing keypad")
(edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad")
(edt-map-key "NEXT" " - The Next Scr key on the editing keypad")
1995-02-08 01:25:15 +00:00
(set-buffer "Keys")
(insert "
1995-02-08 01:25:15 +00:00
;;
;; F1-14 Help Do F17-F20
;;
")
(set-buffer "Directions")
(edt-map-key "F1" " - F1 Function Key")
(edt-map-key "F2" " - F2 Function Key")
(edt-map-key "F3" " - F3 Function Key")
(edt-map-key "F4" " - F4 Function Key")
(edt-map-key "F5" " - F5 Function Key")
(edt-map-key "F6" " - F6 Function Key")
(edt-map-key "F7" " - F7 Function Key")
(edt-map-key "F8" " - F8 Function Key")
(edt-map-key "F9" " - F9 Function Key")
(edt-map-key "F10" " - F10 Function Key")
(edt-map-key "F11" " - F11 Function Key")
(edt-map-key "F12" " - F12 Function Key")
(edt-map-key "F13" " - F13 Function Key")
(edt-map-key "F14" " - F14 Function Key")
(edt-map-key "HELP" " - HELP Function Key")
(edt-map-key "DO" " - DO Function Key")
(edt-map-key "F17" " - F17 Function Key")
(edt-map-key "F18" " - F18 Function Key")
(edt-map-key "F19" " - F19 Function Key")
(edt-map-key "F20" " - F20 Function Key")
(set-buffer "Directions")
(delete-region (point-min) (point-max))
(insert "
ADDITIONAL FUNCTION KEYS
1995-02-08 01:25:15 +00:00
Your keyboard may have additional function keys which do not correspond
to any LK-201 keys. The EDT Emulation can be configured to recognize
those keys, since you may wish to add your own key bindings to those keys.
2002-10-18 08:59:10 +00:00
For example, suppose your keyboard has a keycap marked \"Line Del\" and
you wish to add it to the list of keys which can be customized by the EDT
Emulation. First, assign a unique single-word name to the key for use by
the EDT Emulation, for example, \"linedel\". Then, at the \"EDT Key
Name:\" prompt, enter \"linedel\", followed by a press of the RETURN key.
Finally, when prompted, press the \"Line Del\" key. You now will be able
to bind functions to \"linedel\" and \"Gold-linedel\" in edt-user.el in
just the same way you can customize bindings of the LK-201 function and
keypad keys.
When you are done, just press RETURN at the \"EDT Key Name:\" prompt.
1995-02-08 01:25:15 +00:00
")
(switch-to-buffer "Directions")
;;
;; Add support for extras keys
;;
(set-buffer "Keys")
(insert "\
1995-02-08 01:25:15 +00:00
;;
;; Extra Keys
1995-02-08 01:25:15 +00:00
;;
")
;;
;; Restore function-key-map.
;;
(if window-system
(setq function-key-map edt-save-function-key-map))
(setq EDT-key-name "")
(while (not
(string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) ""))
(edt-map-key EDT-key-name ""))
;;
;; No more keys to add, so wrap up.
;;
(set-buffer "Keys")
(insert "\
1995-02-08 01:25:15 +00:00
)
)
")
;;
;; Save the key mapping program
;;
;;
;; Save the key mapping file
;;
(let ((file (concat
"~/.edt-gnu"
(if edt-term (concat "-" edt-term))
(if edt-xserver (concat "-" edt-xserver))
(if window-system (concat "-" (upcase (symbol-name window-system))))
"-keys")))
(set-visited-file-name
Use `format-prompt' when prompting with default values * lisp/woman.el (woman-file-name): * lisp/wid-edit.el (widget-file-prompt-value) (widget-coding-system-prompt-value): * lisp/w32-fns.el (w32-set-system-coding-system): * lisp/vc/vc.el (vc-print-root-log): * lisp/vc/vc-annotate.el (vc-annotate): * lisp/vc/emerge.el (emerge-read-file-name): * lisp/vc/ediff.el (ediff-directories) (ediff-directory-revisions, ediff-directories3) (ediff-merge-directories, ) (ediff-merge-directories-with-ancestor) (ediff-merge-directory-revisions) (ediff-merge-directory-revisions-with-ancestor) (ediff-merge-revisions, ediff-merge-revisions-with-ancestor) (ediff-revision): * lisp/vc/ediff-util.el (ediff-toggle-regexp-match): * lisp/vc/ediff-mult.el (ediff-filegroup-action): * lisp/vc/add-log.el (prompt-for-change-log-name): * lisp/textmodes/table.el (table-insert-row-column) (table-span-cell, table-split-cell-horizontally) (table-split-cell, table-justify, table-generate-source) (table-insert-sequence, table-capture) (table--read-from-minibuffer, table--query-justification): * lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/refer.el (refer-get-bib-files): * lisp/textmodes/css-mode.el (css-lookup-symbol): * lisp/term.el (serial-read-name, serial-read-speed): * lisp/speedbar.el (speedbar-change-initial-expansion-list): * lisp/simple.el (previous-matching-history-element) (set-variable): * lisp/ses.el (ses-read-cell, ses-set-column-width): * lisp/replace.el (query-replace-read-from) (occur-read-primary-args): * lisp/rect.el (string-rectangle, string-insert-rectangle): * lisp/progmodes/tcl.el (tcl-help-on-word): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/python.el (python-eldoc-at-point): * lisp/progmodes/octave.el (octave-completing-read) (octave-update-function-file-comment, octave-insert-defun): * lisp/progmodes/inf-lisp.el (lisp-symprompt): * lisp/progmodes/cperl-mode.el (cperl-info-on-command) (cperl-perldoc): * lisp/progmodes/compile.el (compilation-find-file): * lisp/net/rcirc.el (rcirc-prompt-for-encryption): * lisp/net/eww.el (eww): * lisp/net/browse-url.el (browse-url-with-browser-kind): * lisp/man.el (man): * lisp/mail/sendmail.el (sendmail-query-user-about-smtp): * lisp/mail/mailalias.el (build-mail-aliases): * lisp/mail/mailabbrev.el (merge-mail-abbrevs) (rebuild-mail-abbrevs): * lisp/locate.el (locate-prompt-for-search-string): * lisp/isearch.el (isearch-occur): * lisp/international/ogonek.el (ogonek-read-encoding) (ogonek-read-prefix): * lisp/international/mule.el (read-buffer-file-coding-system) (set-terminal-coding-system, set-keyboard-coding-system) (set-next-selection-coding-system, recode-region): * lisp/international/mule-cmds.el () (universal-coding-system-argument, search-unencodable-char) (select-safe-coding-system-interactively): * lisp/info.el (Info-search, Info-search-backward, Info-menu): * lisp/info-look.el (info-lookup-interactive-arguments): * lisp/imenu.el (imenu--completion-buffer): * lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode): * lisp/hi-lock.el (hi-lock-unface-buffer) (hi-lock-read-face-name): * lisp/help.el (view-emacs-news, where-is): * lisp/help-fns.el (describe-variable, describe-symbol) (describe-keymap): * lisp/gnus/mm-decode.el (mm-save-part): * lisp/gnus/gnus-sum.el (gnus-summary-browse-url): * lisp/gnus/gnus-group.el (gnus-group--read-bug-ids) (gnus-group-set-current-level): * lisp/frame.el (make-frame-on-monitor) (close-display-connection, select-frame-by-name): * lisp/format.el (format-encode-buffer, format-encode-region): * lisp/files.el (recode-file-name): * lisp/files-x.el (read-file-local-variable) (read-file-local-variable-value, ) (read-file-local-variable-mode): * lisp/ffap.el (ffap-menu-ask): * lisp/faces.el (face-read-string): * lisp/facemenu.el (facemenu-set-charset): * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): * lisp/emulation/edt-mapper.el (edt-mapper): * lisp/emacs-lisp/trace.el (trace--read-args) (trace-function-foreground, trace-function-background): * lisp/emacs-lisp/smie.el (smie-config-set-indent): * lisp/emacs-lisp/re-builder.el (reb-change-syntax): * lisp/emacs-lisp/package.el (describe-package): * lisp/emacs-lisp/find-func.el (read-library-name) (find-function-read): * lisp/emacs-lisp/ert.el (ert-read-test-name) (ert-run-tests-interactively): * lisp/emacs-lisp/disass.el (disassemble): * lisp/emacs-lisp/debug.el (debug-on-entry) (debug-on-variable-change): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-read-regexp): * lisp/dired-x.el (dired--mark-suffix-interactive-spec): * lisp/dired-aux.el (dired-diff): * lisp/cus-edit.el (custom-variable-prompt, customize-mode) (customize-changed-options): * lisp/completion.el (interactive-completion-string-reader): * lisp/calendar/timeclock.el (timeclock-ask-for-project): * lisp/calc/calcalg3.el (calc-get-fit-variables): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-bin.el (calc-word-size): * lisp/bookmark.el (bookmark-set-internal): * lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for prompting (bug#12443).
2020-09-06 16:56:44 +02:00
(read-file-name (format-prompt "Save key mapping to file" file)
nil file)))
(save-buffer)
(message "That's it! Press any key to exit")
(sit-for 600)
(kill-emacs t))
1995-02-08 01:25:15 +00:00
;;; edt-mapper.el ends here