annotate lisp/emulation/edt-mapper.el @ 112218:376148b31b5e

Add 2011 to FSF/AIST copyright years.
author Glenn Morris <rgm@gnu.org>
date Sun, 02 Jan 2011 15:50:46 -0800
parents 44c22a3327ec
children 417b1e4d63cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35123
diff changeset
1 ;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
95631
9a74acbaf005 Remove unnecessary eval-when-compile.
Glenn Morris <rgm@gnu.org>
parents: 94658
diff changeset
3 ;; Copyright (C) 1994, 1995, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 112050
diff changeset
4 ;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5
74641
11fae7eadf2d Replace `/' with a `-', to fix a problem on Cygwin.
Eli Zaretskii <eliz@gnu.org>
parents: 73744
diff changeset
6 ;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
11fae7eadf2d Replace `/' with a `-', to fix a problem on Cygwin.
Eli Zaretskii <eliz@gnu.org>
parents: 73744
diff changeset
7 ;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8 ;; Keywords: emulations
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
10691
37ced05a96d0 Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 10690
diff changeset
10 ;; This file is part of GNU Emacs.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; (at your option) any later version.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
26 ;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
27
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
28 ;; [Part of the GNU Emacs EDT Emulation.]
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 ;; This emacs lisp program can be used to create an emacs lisp file
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
31 ;; that defines the mapping of the user's keyboard to the LK-201
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
32 ;; keyboard function keys and keypad keys (around which EDT has been
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
33 ;; designed). Please read the "Usage" AND "Known Problems" sections
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
34 ;; below before attempting to run this program. (The design of this
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
35 ;; file, edt-mapper.el, was heavily influenced by tpu-mapper.el.)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
36
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
37 ;; Version 4.0 contains the following enhancements:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
39 ;; 1. If you access a workstation using an X Server, note that the
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
40 ;; initialization file generated by edt-mapper.el will now
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
41 ;; contain the name of the X Server vendor. This is a
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
42 ;; convenience for those who have access to their Unix account
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
43 ;; from more than one type of X Server. Since different X
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
44 ;; Servers typically require different EDT emulation
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
45 ;; initialization files, edt-mapper.el will now generate these
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
46 ;; different initialization files and save them with different
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
47 ;; names.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
48
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
49 ;; 2. Also, edt-mapper.el is now capable of binding an ASCII key
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
50 ;; sequence, providing the ASCII key sequence prefix is already
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
51 ;; known by Emacs to be a prefix. As a result, some
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
52 ;; terminal/keyboard/window system configurations, which don't
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
53 ;; have a complete set of sensible function key map bindings, can
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
54 ;; still be configured for EDT Emulation.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
55
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
56
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
57 ;; Usage:
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
58
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
59 ;; Simply load this file into emacs (version 19 or higher)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
60 ;; using the following command.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
61
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
62 ;; emacs -q -l edt-mapper.el
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
64 ;; The "-q" option prevents loading of your .emacs file (commands
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
65 ;; therein might confuse this program).
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
66
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
67 ;; An instruction screen showing the typical LK-201 terminal
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
68 ;; functions keys will be displayed, and you will be prompted to
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
69 ;; press the keys on your keyboard which you want to emulate the
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
70 ;; corresponding LK-201 keys.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
71
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
72 ;; Finally, you will be prompted for the name of the file to store
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
73 ;; the key definitions. If you chose the default, it will be found
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
74 ;; and loaded automatically when the EDT emulation is started. If
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 ;; you specify a different file name, you will need to set the
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
76 ;; variable "edt-keys-file" before starting the EDT emulation.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
77 ;; Here's how you might go about doing that in your .emacs file.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
79 ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys"))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
80
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
81
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
82 ;; Known Problems:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
83
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
84 ;; Sometimes, edt-mapper will ignore a key you press, and just
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
85 ;; continue to prompt for the same key. This can happen when your
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
86 ;; window manager sucks up the key and doesn't pass it on to emacs,
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
87 ;; or it could be an emacs bug. Either way, there's nothing that
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
88 ;; edt-mapper can do about it. You must press RETURN, to skip the
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
89 ;; current key and continue. Later, you and/or your local Emacs guru
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
90 ;; can try to figure out why the key is being ignored.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
91
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
92 ;;; History:
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
93 ;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
94
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
95 ;; Version 4.0 2000 Added 2 New Features
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
96
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
97 ;;; Code:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
98
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
99 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
100 ;;; Decide Emacs Variant, GNU Emacs or XEmacs (aka Lucid Emacs).
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
101 ;;; Determine Window System, and X Server Vendor (if appropriate).
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
102 ;;;
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
103 (defconst edt-window-system (if (featurep 'xemacs) (console-type) window-system)
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
104 "Indicates window system \(in GNU Emacs\) or console type \(in XEmacs\).")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
105
95837
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
106 (declare-function x-server-vendor "xfns.c" (&optional terminal))
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
107
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
108 (defconst edt-xserver (when (eq edt-window-system 'x)
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
109 ;; The Cygwin window manager has a `/' in its
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
110 ;; name, which breaks the generated file name of
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
111 ;; the custom key map file. Replace `/' with a
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
112 ;; `-' to work around that.
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
113 (if (featurep 'xemacs)
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
114 (replace-in-string (x-server-vendor) "[ /]" "-")
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
115 (replace-regexp-in-string "[ /]" "-"
7ea2a6d03884 Drop test for Emacs < 19.
Glenn Morris <rgm@gnu.org>
parents: 95631
diff changeset
116 (x-server-vendor))))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
117 "Indicates X server vendor name, if applicable.")
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
118
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
119
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
121 ;;; Key variables
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
123 (defvar edt-key nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
124 (defvar edt-enter nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125 (defvar edt-return nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
126 (defvar edt-key-seq nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
127 (defvar edt-enter-seq nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
128 (defvar edt-return-seq nil)
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
129 (defvar edt-term nil)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
130
63915
96d313e6f018 (edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
131 ;; To silence the byte-compiler
95631
9a74acbaf005 Remove unnecessary eval-when-compile.
Glenn Morris <rgm@gnu.org>
parents: 94658
diff changeset
132 (defvar EDT-key-name)
9a74acbaf005 Remove unnecessary eval-when-compile.
Glenn Morris <rgm@gnu.org>
parents: 94658
diff changeset
133 (defvar edt-save-function-key-map)
63915
96d313e6f018 (edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
134
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
135 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
136 ;;; Determine Terminal Type (if appropriate).
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
137 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
138
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
139 (if (and edt-window-system (not (eq edt-window-system 'tty)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
140 (setq edt-term nil)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
141 (setq edt-term (getenv "TERM")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
142
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
143 ;;;
112049
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
144 ;;; Implements a workaround for a feature that was added to simple.el.
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
145 ;;;
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
146 ;;; Many function keys have no Emacs functions assigned to them by
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
147 ;;; default. A subset of these are typically assigned functions in the
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
148 ;;; EDT emulation. This includes all the keypad keys and a some others
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
149 ;;; like Delete.
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
150 ;;;
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
151 ;;; Logic in simple.el maps some of these unassigned function keys to
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
152 ;;; ordinary typing keys. Where this is the case, a call to
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
153 ;;; read-key-sequence, below, does not return the name of the function
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
154 ;;; key pressd by the user but, instead, it returns the name of the
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
155 ;;; key to which it has been mapped. It needs to know the name of the
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
156 ;;; key pressed by the user. As a workaround, we assign a function to
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
157 ;;; each of the unassigned function keys of interest, here. These
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
158 ;;; assignments override the mapping to other keys and are only
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
159 ;;; temporary since, when edt-mapper is finished executing, it causes
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
160 ;;; Emacs to exit.
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
161 ;;;
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
162
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
163 (mapc
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
164 (lambda (function-key)
112050
44c22a3327ec Fix error in last commit.
Chong Yidong <cyd@stupidchicken.com>
parents: 112049
diff changeset
165 (if (not (lookup-key (current-global-map) function-key))
44c22a3327ec Fix error in last commit.
Chong Yidong <cyd@stupidchicken.com>
parents: 112049
diff changeset
166 (define-key (current-global-map) function-key 'forward-char)))
112049
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
167 '([kp-0] [kp-1] [kp-2] [kp-3] [kp-4]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
168 [kp-5] [kp-6] [kp-7] [kp-8] [kp-9]
112050
44c22a3327ec Fix error in last commit.
Chong Yidong <cyd@stupidchicken.com>
parents: 112049
diff changeset
169 [kp-space]
44c22a3327ec Fix error in last commit.
Chong Yidong <cyd@stupidchicken.com>
parents: 112049
diff changeset
170 [kp-tab]
112049
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
171 [kp-enter]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
172 [kp-multiply]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
173 [kp-add]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
174 [kp-separator]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
175 [kp-subtract]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
176 [kp-decimal]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
177 [kp-divide]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
178 [kp-equal]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
179 [backspace]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
180 [delete]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
181 [tab]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
182 [linefeed]
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
183 [clear]))
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
184
4a7382958ef1 * emulation/edt-mapper.el: Override mapping of function keys
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
185 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
186 ;;; Make sure the window is big enough to display the instructions,
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
187 ;;; except where window cannot be re-sized.
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
188 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
190 (if (and edt-window-system (not (eq edt-window-system 'tty)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
191 (set-frame-size (selected-frame) 80 36))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
192
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
193 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
194 ;;; Create buffers - Directions and Keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
195 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
196 (if (not (get-buffer "Directions")) (generate-new-buffer "Directions"))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197 (if (not (get-buffer "Keys")) (generate-new-buffer "Keys"))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
198
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
199 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
200 ;;; Put header in the Keys buffer
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
201 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
202 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
203 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
204 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
205 ;; Key definitions for the EDT emulation within GNU Emacs
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
206 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
207
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
208 (defconst *EDT-keys*
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
209 '(
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
210 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
211
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
212 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
213 ;;; Display directions
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
214 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
215 (switch-to-buffer "Directions")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
216 (if (and edt-window-system (not (eq edt-window-system 'tty)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
217 (insert "
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
218 EDT MAPPER
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
219
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
220 You will be asked to press keys to create a custom mapping (under a
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
221 Window Manager) of your keypad keys and function keys so that they can
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
222 emulate the LK-201 keypad and function keys or the subset of keys found
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
223 on a VT-100 series terminal keyboard. (The LK-201 keyboard is the
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
224 standard keyboard attached to VT-200 series terminals, and above.)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
225
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
226 Sometimes, edt-mapper will ignore a key you press, and just continue to
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
227 prompt for the same key. This can happen when your window manager sucks
73744
84aef5a30c72 Fix typo in interactive message.
Juanma Barranquero <lekktu@gmail.com>
parents: 68648
diff changeset
228 up the key and doesn't pass it on to Emacs, or it could be an Emacs bug.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
229 Either way, there's nothing that edt-mapper can do about it. You must
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
230 press RETURN, to skip the current key and continue. Later, you and/or
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
231 your local system guru can try to figure out why the key is being ignored.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
232
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
233 Start by pressing the RETURN key, and continue by pressing the keys
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
234 specified in the mini-buffer. If you want to entirely omit a key,
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
235 because your keyboard does not have a corresponding key, for example,
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
236 just press RETURN at the prompt.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
237
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
239 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
240 EDT MAPPER
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
241
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
242 You will be asked to press keys to create a custom mapping of your
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
243 keypad keys and function keys so that they can emulate the LK-201
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
244 keypad and function keys or the subset of keys found on a VT-100
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
245 series terminal keyboard. (The LK-201 keyboard is the standard
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
246 keyboard attached to VT-200 series terminals, and above.)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
247
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
248 If you are using a real LK-201 keyboard, you should map the keys
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
249 exactly as they are on the keyboard.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
250
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
251 Start by pressing the RETURN key, and continue by pressing the keys
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
252 specified in the mini-buffer. If you want to entirely omit a key,
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
253 because your keyboard does not have a corresponding key, for example,
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
254 just press RETURN at the prompt.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
255
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
256 "))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
257
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
258 (delete-other-windows)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
259
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
260 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
261 ;;; Save <CR> for future reference.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
262 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
263 ;;; For GNU Emacs, running in a Window System, first hide bindings in
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
264 ;;; function-key-map.
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
265 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
266 (cond
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
267 ((featurep 'xemacs)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
268 (setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
269 (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]")))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 (t
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
271 (if edt-window-system
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
272 (progn
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
273 (setq edt-save-function-key-map function-key-map)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
274 (setq function-key-map (make-sparse-keymap))))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
275 (setq edt-return (read-key-sequence "Hit carriage-return <CR> to continue "))))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
276
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
277 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
278 ;;; Remove prefix-key bindings to F1 and F2 in global-map so they can be
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
279 ;;; bound in the EDT Emulation mode.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
280 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
281 (global-unset-key [f1])
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
282 (global-unset-key [f2])
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
283
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
284 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
285 ;;; Display Keypad Diagram and Begin Prompting for Keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
287 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
288 (delete-region (point-min) (point-max))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
289 (if (and edt-window-system (not (eq edt-window-system 'tty)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
290 (insert "
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
291
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
292 PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
293
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
294 Here's a picture of the standard LK-201 keypad for reference:
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
295
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
296 _______________________ _______________________________
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
297 | HELP | DO | | F17 | F18 | F19 | F20 |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
298 | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
299 |_______|_______________| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
300 _______________________ _______________________________
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
301 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
302 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
303 |_______|_______|_______| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
304 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
305 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
306 |_______|_______|_______| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
307 | UP | | KP4 | KP5 | KP6 | KP, |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
308 | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
309 _______|_______|_______ |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
310 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
311 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
312 |_______|_______|_______| |_______|_______|_______| KPE |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
313 | KP0 | KPP | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
314 | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
315 |_______________|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
316
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
317 REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
318
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
319 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
320 (progn
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
321 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
322 GENERATING A CUSTOM CONFIGURATION FILE FOR TERMINAL TYPE: ")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
323 (insert (format "%s." edt-term))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
324 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
325
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
326 PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
327
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
328 _______________________ _______________________________
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
329 | HELP | DO | | F17 | F18 | F19 | F20 |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
330 |_______|_______________| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
331 _______________________ _______________________________
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
332 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
333 |_______|_______|_______| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
334 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
335 |_______|_______|_______| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
336 | UP | | KP4 | KP5 | KP6 | KP, |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
337 _______|_______|_______ |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
338 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
339 |_______|_______|_______| |_______|_______|_______| KPE |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
340 | KP0 | KPP | |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
341 |_______________|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
342
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
343 REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY.")))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
344
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
345
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
346 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
347 ;;; Key mapping functions
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
348 ;;;
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
349 (defun edt-map-key (ident descrip)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
350 (interactive)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
351 (if (featurep 'xemacs)
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
352 (progn
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
353 (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
354 (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]"))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
355 (cond ((not (equal edt-key edt-return))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
356 (set-buffer "Keys")
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
357 (insert (format " (\"%s\" . %s)\n" ident edt-key))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
358 (set-buffer "Directions"))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
359 ;; bogosity to get next prompt to come up, if the user hits <CR>!
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
360 ;; check periodically to see if this is still needed...
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
361 (t
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
362 (set-buffer "Keys")
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
363 (insert (format " (\"%s\" . \"\" )\n" ident))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
364 (set-buffer "Directions"))))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
365 (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip)))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
366 (cond ((not (equal edt-key edt-return))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
367 (set-buffer "Keys")
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
368 (insert (if (vectorp edt-key)
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
369 (format " (\"%s\" . %s)\n" ident edt-key)
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
370 (format " (\"%s\" . \"%s\")\n" ident edt-key)))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
371 (set-buffer "Directions"))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
372 ;; bogosity to get next prompt to come up, if the user hits <CR>!
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
373 ;; check periodically to see if this is still needed...
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
374 (t
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
375 (set-buffer "Keys")
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
376 (insert (format " (\"%s\" . \"\" )\n" ident))
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
377 (set-buffer "Directions"))))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
378 edt-key)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
379
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
380 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
381 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
382 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
383 ;; Arrows
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
384 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
385 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
386 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388 (edt-map-key "UP" " - The Up Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389 (edt-map-key "DOWN" " - The Down Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
390 (edt-map-key "LEFT" " - The Left Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 (edt-map-key "RIGHT" " - The Right Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
393
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
394 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
397 ;; PF keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
398 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
399 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
400 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
402 (edt-map-key "PF1" " - The PF1 (GOLD) Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
403 (edt-map-key "PF2" " - The Keypad PF2 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 (edt-map-key "PF3" " - The Keypad PF3 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
405 (edt-map-key "PF4" " - The Keypad PF4 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
406
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
408 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
409 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
410 ;; KP0-9 KP- KP, KPP and KPE
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
411 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
412 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
413 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
414
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
415 (edt-map-key "KP0" " - The Keypad 0 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
416 (edt-map-key "KP1" " - The Keypad 1 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417 (edt-map-key "KP2" " - The Keypad 2 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 (edt-map-key "KP3" " - The Keypad 3 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
419 (edt-map-key "KP4" " - The Keypad 4 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
420 (edt-map-key "KP5" " - The Keypad 5 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
421 (edt-map-key "KP6" " - The Keypad 6 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
422 (edt-map-key "KP7" " - The Keypad 7 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
423 (edt-map-key "KP8" " - The Keypad 8 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
424 (edt-map-key "KP9" " - The Keypad 9 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
425 (edt-map-key "KP-" " - The Keypad - Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
426 (edt-map-key "KP," " - The Keypad , Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
427 (edt-map-key "KPP" " - The Keypad . Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
428 (edt-map-key "KPE" " - The Keypad Enter Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
429 ;; Save the enter key
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
430 (setq edt-enter edt-key)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
431 (setq edt-enter-seq edt-key-seq)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
432
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
433
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
434 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
435 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
436 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
437 ;; Editing keypad (FIND, INSERT, REMOVE)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
438 ;; (SELECT, PREVIOUS, NEXT)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
439 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
440 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
441 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
442
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
443 (edt-map-key "FIND" " - The Find key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
444 (edt-map-key "INSERT" " - The Insert key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
445 (edt-map-key "REMOVE" " - The Remove key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
446 (edt-map-key "SELECT" " - The Select key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
447 (edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 (edt-map-key "NEXT" " - The Next Scr key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
449
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
450 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
451 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
452 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453 ;; F1-14 Help Do F17-F20
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
455 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
456 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
457
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
458 (edt-map-key "F1" " - F1 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
459 (edt-map-key "F2" " - F2 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
460 (edt-map-key "F3" " - F3 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
461 (edt-map-key "F4" " - F4 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
462 (edt-map-key "F5" " - F5 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
463 (edt-map-key "F6" " - F6 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
464 (edt-map-key "F7" " - F7 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
465 (edt-map-key "F8" " - F8 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
466 (edt-map-key "F9" " - F9 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
467 (edt-map-key "F10" " - F10 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
468 (edt-map-key "F11" " - F11 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
469 (edt-map-key "F12" " - F12 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
470 (edt-map-key "F13" " - F13 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
471 (edt-map-key "F14" " - F14 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
472 (edt-map-key "HELP" " - HELP Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
473 (edt-map-key "DO" " - DO Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
474 (edt-map-key "F17" " - F17 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
475 (edt-map-key "F18" " - F18 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
476 (edt-map-key "F19" " - F19 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
477 (edt-map-key "F20" " - F20 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
478
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
479 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
480 (delete-region (point-min) (point-max))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 (insert "
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
482 ADDITIONAL FUNCTION KEYS
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
483
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
484 Your keyboard may have additional function keys which do not correspond
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
485 to any LK-201 keys. The EDT Emulation can be configured to recognize
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
486 those keys, since you may wish to add your own key bindings to those keys.
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
487
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
488 For example, suppose your keyboard has a keycap marked \"Line Del\" and
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
489 you wish to add it to the list of keys which can be customized by the EDT
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
490 Emulation. First, assign a unique single-word name to the key for use by
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
491 the EDT Emulation, for example, \"linedel\". Then, at the \"EDT Key
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
492 Name:\" prompt, enter \"linedel\", followed by a press of the RETURN key.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
493 Finally, when prompted, press the \"Line Del\" key. You now will be able
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
494 to bind functions to \"linedel\" and \"Gold-linedel\" in edt-user.el in
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
495 just the same way you can customize bindings of the LK-201 function and
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
496 keypad keys.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
498 When you are done, just press RETURN at the \"EDT Key Name:\" prompt.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
499 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 (switch-to-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
502 ;;; Add support for extras keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
503 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506 ;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
507 ;; Extra Keys
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
509 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
510 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
511 ;;; Restore function-key-map.
47940
c6a3d10a0675 (top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42206
diff changeset
512 ;;;
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78218
diff changeset
513 (if (and edt-window-system (not (featurep 'xemacs)))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
514 (setq function-key-map edt-save-function-key-map))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
515 (setq EDT-key-name "")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
516 (while (not
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
517 (string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) ""))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
518 (edt-map-key EDT-key-name ""))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
519
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
520 ;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521 ; No more keys to add, so wrap up.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
522 ;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
524 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
525 )
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526 )
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
527 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
528
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
529 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
530 ;;; Save the key mapping program
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
531 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
532 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
533 ;;; Save the key mapping file
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
534 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
535 (let ((file (concat
85650
437a25964d35 * emulation/edt-mapper.el (edt-emacs-variant): Replace the only
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85511
diff changeset
536 "~/.edt-" (if (featurep 'xemacs) "xemacs" "gnu")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
537 (if edt-term (concat "-" edt-term))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
538 (if edt-xserver (concat "-" edt-xserver))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
539 (if edt-window-system (concat "-" (upcase (symbol-name edt-window-system))))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
540 "-keys")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
541 (set-visited-file-name
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
542 (read-file-name (format "Save key mapping to file (default %s): " file) nil file)))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
543 (save-buffer)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
544
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
545 (message "That's it! Press any key to exit")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
546 (sit-for 600)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
547 (kill-emacs t)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
548
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
549 ;; arch-tag: 9eea59c8-b8b7-4d66-b858-c8920624c518
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
550 ;;; edt-mapper.el ends here