annotate lisp/emulation/edt-mapper.el @ 41488:a93b6b418d0e

*** empty log message ***
author Jason Rumney <jasonr@gnu.org>
date Sun, 25 Nov 2001 11:35:13 +0000
parents b174db545cfd
children 0f4506820432
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
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
3 ;; Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4
18942
f97998412b4d Comment change
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
5 ;; Author: Kevin Gallagher <kevingal@onramp.net>
f97998412b4d Comment change
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
6 ;; Maintainer: Kevin Gallagher <kevingal@onramp.net>
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7 ;; Keywords: emulations
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8
10691
37ced05a96d0 Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 10690
diff changeset
9 ;; This file is part of GNU Emacs.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14 ;; any later version.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
24 ;; Boston, MA 02111-1307, USA.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
35123
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
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
29 ;; [Part of the GNU Emacs EDT Emulation.]
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31 ;; 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
32 ;; 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
33 ;; 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
34 ;; 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
35 ;; 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
36 ;; 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
37
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
38 ;; Version 4.0 contains the following enhancements:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
40 ;; 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
41 ;; 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
42 ;; 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
43 ;; 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
44 ;; 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
45 ;; Servers typically require different EDT emulation
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
46 ;; 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
47 ;; 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
48 ;; names.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
49
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
50 ;; 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
51 ;; 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
52 ;; 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
53 ;; 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
54 ;; 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
55 ;; still be configured for EDT Emulation.
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
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
58 ;; Usage:
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
59
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
60 ;; Simply load this file into emacs (version 19 or higher)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
61 ;; using the following command.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
62
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63 ;; emacs -q -l edt-mapper.el
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
64
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
65 ;; 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
66 ;; therein might confuse this program).
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
67
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
68 ;; 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
69 ;; 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
70 ;; 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
71 ;; corresponding LK-201 keys.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
72
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
73 ;; Finally, you will be prompted for the name of the file to store
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
74 ;; the key definitions. If you chose the default, it will be found
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 ;; and loaded automatically when the EDT emulation is started. If
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
76 ;; 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
77 ;; variable "edt-keys-file" before starting the EDT emulation.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78 ;; Here's how you might go about doing that in your .emacs file.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
79
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
80 ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys"))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
81
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
82
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
83 ;; Known Problems:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
85 ;; 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
86 ;; 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
87 ;; 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
88 ;; 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
89 ;; 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
90 ;; 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
91 ;; can try to figure out why the key is being ignored.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
92
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
93 ;;; History:
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
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
96 ;; 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
97
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
98 ;;; Code:
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
99
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
100 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
101 ;;; Make sure we're running Emacs version 19, or higher.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
102 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
103
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
104 (cond
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
105 ((string-lessp emacs-version "19")
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
106 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
107
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
108 Whoa! This isn't going to work...
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
109
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
110 You must run edt-mapper.el under Emacs version 19 or higher.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
112 Press any key to exit. ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
113 (sit-for 600)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
114 (kill-emacs t)))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
115
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
116
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
117 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
118 ;;; 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
119 ;;; Determine Window System, and X Server Vendor (if appropriate).
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
121 (defconst edt-x-emacs-p (string-match "XEmacs" emacs-version)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
122 "Non-NIL if we are running XEmacs version 19, or higher.")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
124 (defconst edt-emacs-variant (if edt-x-emacs-p "xemacs" "gnu")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
125 "Indicates 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
126
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
127 (defconst edt-window-system (if edt-x-emacs-p (console-type) window-system)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
128 "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
129
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
130 (defconst edt-xserver (if (eq edt-window-system 'x)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
131 (if edt-x-emacs-p
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
132 (replace-in-string (x-server-vendor) "[ _]" "-")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
133 (subst-char-in-string ? ?- (x-server-vendor)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
134 nil)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
135 "Indicates X server vendor name, if applicable.")
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
136
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
137
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
138 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
139 ;;; Key variables
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
140 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
141 (defvar edt-key nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
142 (defvar edt-enter nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
143 (defvar edt-return nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
144 (defvar edt-key-seq nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
145 (defvar edt-enter-seq nil)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
146 (defvar edt-return-seq nil)
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
147 (defvar edt-term nil)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
148
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
149 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
150 ;;; Determine Terminal Type (if appropriate).
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
151 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
152
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
153 (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
154 (setq edt-term nil)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
155 (setq edt-term (getenv "TERM")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
156
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
157 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
158 ;;; 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
159 ;;; except where window cannot be re-sized.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
160 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
161
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
162 (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
163 (set-frame-size (selected-frame) 80 36))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
164
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
165 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
166 ;;; Create buffers - Directions and Keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
167 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
168 (if (not (get-buffer "Directions")) (generate-new-buffer "Directions"))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
169 (if (not (get-buffer "Keys")) (generate-new-buffer "Keys"))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
170
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
171 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
172 ;;; Put header in the Keys buffer
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
173 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
174 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
175 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
176 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
177 ;; Key definitions for the EDT emulation within GNU Emacs
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
178 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
179
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
180 (defconst *EDT-keys*
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
181 '(
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
183
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
184 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
185 ;;; Display directions
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
187 (switch-to-buffer "Directions")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
188 (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
189 (insert "
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
190 EDT MAPPER
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
191
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
192 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
193 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
194 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
195 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
196 standard keyboard attached to VT-200 series terminals, and above.)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
198 Sometimes, edt-mapper will ignore a key you press, and just continue to
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
199 prompt for the same key. This can happen when your window manager sucks
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
200 up the key and doesn't pass it on to emacs, or it could be an emacs bug.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
201 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
202 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
203 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
204
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
205 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
206 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
207 because your keyboard does not have a corresponding key, for example,
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
208 just press RETURN at the prompt.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
209
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
210 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
211 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
212 EDT MAPPER
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
213
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
214 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
215 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
216 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
217 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
218 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
219
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
220 If you are using an real LK-201 keyboard, you should map the keys
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
221 exactly as they are on the keyboard.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
222
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
223 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
224 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
225 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
226 just press RETURN at the prompt.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
227
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
228 "))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
229
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
230 (delete-other-windows)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
231
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
232 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
233 ;;; Save <CR> for future reference.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
234 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
235 ;;; 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
236 ;;; function-key-map.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
237 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 (cond
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
239 (edt-x-emacs-p
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
240 (setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
241 (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]")))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
242 (t
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
243 (if edt-window-system
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
244 (progn
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
245 (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
246 (setq function-key-map (make-sparse-keymap))))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
247 (setq edt-return (read-key-sequence "Hit carriage-return <CR> to continue "))))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
248
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
249 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
250 ;;; 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
251 ;;; bound in the EDT Emulation mode.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
252 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
253 (global-unset-key [f1])
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
254 (global-unset-key [f2])
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 ;;;
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
257 ;;; Display Keypad Diagram and Begin Prompting for Keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
258 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
259 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
260 (delete-region (point-min) (point-max))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
261 (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
262 (insert "
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
263
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
264 PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
265
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
266 Here's a picture of the standard LK-201 keypad for reference:
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
267
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
268 _______________________ _______________________________
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
269 | HELP | DO | | F17 | F18 | F19 | F20 |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
271 |_______|_______________| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
272 _______________________ _______________________________
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
273 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
274 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
275 |_______|_______|_______| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
276 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
277 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
278 |_______|_______|_______| |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
279 | UP | | KP4 | KP5 | KP6 | KP, |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
280 | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
281 _______|_______|_______ |_______|_______|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
282 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
283 | | | | | | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
284 |_______|_______|_______| |_______|_______|_______| KPE |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
285 | KP0 | KPP | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286 | | | |
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
287 |_______________|_______|_______|
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
288
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
289 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
290
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
291 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
292 (progn
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
293 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
294 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
295 (insert (format "%s." edt-term))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
296 (insert "
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
297
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
298 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
299
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
300 _______________________ _______________________________
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
301 | HELP | DO | | F17 | F18 | F19 | F20 |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
302 |_______|_______________| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
303 _______________________ _______________________________
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
304 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
305 |_______|_______|_______| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
306 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
307 |_______|_______|_______| |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
308 | UP | | KP4 | KP5 | KP6 | KP, |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
309 _______|_______|_______ |_______|_______|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
310 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
311 |_______|_______|_______| |_______|_______|_______| KPE |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
312 | KP0 | KPP | |
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
313 |_______________|_______|_______|
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
314
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
315 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
316
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
317
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
318 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
319 ;;; Key mapping functions
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
320 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
321 (defun edt-lucid-map-key (ident descrip)
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
322 (interactive)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
323 (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
324 (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]"))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
325 (cond ((not (equal edt-key edt-return))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
326 (set-buffer "Keys")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
327 (insert (format " (\"%s\" . %s)\n" ident edt-key))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
328 (set-buffer "Directions"))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
329 ;; bogosity to get next prompt to come up, if the user hits <CR>!
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
330 ;; check periodically to see if this is still needed...
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
331 (t
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
332 (set-buffer "Keys")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
333 (insert (format " (\"%s\" . \"\" )\n" ident))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
334 (set-buffer "Directions")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
335 edt-key)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
336
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
337 (defun edt-gnu-map-key (ident descrip)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
338 (interactive)
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
339 (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip)))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
340 (cond ((not (equal edt-key edt-return))
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
341 (set-buffer "Keys")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
342 (insert (if (vectorp edt-key)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
343 (format " (\"%s\" . %s)\n" ident edt-key)
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
344 (format " (\"%s\" . \"%s\")\n" ident edt-key)))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
345 (set-buffer "Directions"))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
346 ;; bogosity to get next prompt to come up, if the user hits <CR>!
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
347 ;; check periodically to see if this is still needed...
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
348 (t
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
349 (set-buffer "Keys")
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
350 (insert (format " (\"%s\" . \"\" )\n" ident))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
351 (set-buffer "Directions")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
352 edt-key)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
353
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
354 (fset 'edt-map-key (if edt-x-emacs-p 'edt-lucid-map-key 'edt-gnu-map-key))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
355 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
356 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
357 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
358 ;; Arrows
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
359 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
360 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
361 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
362
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
363 (edt-map-key "UP" " - The Up Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
364 (edt-map-key "DOWN" " - The Down Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
365 (edt-map-key "LEFT" " - The Left Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
366 (edt-map-key "RIGHT" " - The Right Arrow Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
367
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
368
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
369 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
370 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
371 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
372 ;; PF keys
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
373 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
374 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
375 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
376
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
377 (edt-map-key "PF1" " - The PF1 (GOLD) Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
378 (edt-map-key "PF2" " - The Keypad PF2 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
379 (edt-map-key "PF3" " - The Keypad PF3 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
380 (edt-map-key "PF4" " - The Keypad PF4 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
381
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
382 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
383 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
384 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
385 ;; KP0-9 KP- KP, KPP and KPE
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
386 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
390 (edt-map-key "KP0" " - The Keypad 0 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 (edt-map-key "KP1" " - The Keypad 1 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392 (edt-map-key "KP2" " - The Keypad 2 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
393 (edt-map-key "KP3" " - The Keypad 3 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
394 (edt-map-key "KP4" " - The Keypad 4 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395 (edt-map-key "KP5" " - The Keypad 5 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 (edt-map-key "KP6" " - The Keypad 6 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
397 (edt-map-key "KP7" " - The Keypad 7 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
398 (edt-map-key "KP8" " - The Keypad 8 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
399 (edt-map-key "KP9" " - The Keypad 9 Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
400 (edt-map-key "KP-" " - The Keypad - Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401 (edt-map-key "KP," " - The Keypad , Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
402 (edt-map-key "KPP" " - The Keypad . Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
403 (edt-map-key "KPE" " - The Keypad Enter Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 ;; Save the enter key
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
405 (setq edt-enter edt-key)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
406 (setq edt-enter-seq edt-key-seq)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
408
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
409 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
410 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
411 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
412 ;; Editing keypad (FIND, INSERT, REMOVE)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
413 ;; (SELECT, PREVIOUS, NEXT)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
414 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
415 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
416 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 (edt-map-key "FIND" " - The Find key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
419 (edt-map-key "INSERT" " - The Insert key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
420 (edt-map-key "REMOVE" " - The Remove key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
421 (edt-map-key "SELECT" " - The Select key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
422 (edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
423 (edt-map-key "NEXT" " - The Next Scr key on the editing keypad")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
424
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
425 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
426 (insert "
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
427 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
428 ;; F1-14 Help Do F17-F20
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
429 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
430 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
431 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
432
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
433 (edt-map-key "F1" " - F1 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
434 (edt-map-key "F2" " - F2 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
435 (edt-map-key "F3" " - F3 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
436 (edt-map-key "F4" " - F4 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
437 (edt-map-key "F5" " - F5 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
438 (edt-map-key "F6" " - F6 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
439 (edt-map-key "F7" " - F7 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
440 (edt-map-key "F8" " - F8 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
441 (edt-map-key "F9" " - F9 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
442 (edt-map-key "F10" " - F10 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
443 (edt-map-key "F11" " - F11 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
444 (edt-map-key "F12" " - F12 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
445 (edt-map-key "F13" " - F13 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
446 (edt-map-key "F14" " - F14 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
447 (edt-map-key "HELP" " - HELP Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 (edt-map-key "DO" " - DO Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
449 (edt-map-key "F17" " - F17 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
450 (edt-map-key "F18" " - F18 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
451 (edt-map-key "F19" " - F19 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
452 (edt-map-key "F20" " - F20 Function Key")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 (set-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
455 (delete-region (point-min) (point-max))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
456 (insert "
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
457 ADDITIONAL FUNCTION KEYS
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
458
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
459 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
460 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
461 those keys, since you may wish to add your own key bindings to those keys.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
462
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
463 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
464 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
465 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
466 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
467 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
468 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
469 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
470 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
471 keypad keys.
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
472
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
473 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
474 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
475 (switch-to-buffer "Directions")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
476 ;;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
477 ;;; Add support for extras keys
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 "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
480 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 ;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
482 ;; Extra Keys
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
483 ;;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
484 ")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
485 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
486 ;;; Restore function-key-map.
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
487 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
488 (if (and edt-window-system (not edt-x-emacs-p))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
489 (setq function-key-map edt-save-function-key-map))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
490 (setq EDT-key-name "")
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
491 (while (not
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
492 (string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) ""))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
493 (edt-map-key EDT-key-name ""))
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
494
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
495 ;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
496 ; No more keys to add, so wrap up.
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497 ;
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
498 (set-buffer "Keys")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
499 (insert "\
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 )
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 )
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
502 ")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
503
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504 ;;;
35123
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
505 ;;; Save the key mapping program
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
506 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
507 ;;;
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
508 ;;; Save the key mapping file
10690
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 (let ((file (concat
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
511 "~/.edt-" edt-emacs-variant
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
512 (if edt-term (concat "-" edt-term))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
513 (if edt-xserver (concat "-" edt-xserver))
767b546e1676 Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents: 18942
diff changeset
514 (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
515 "-keys")))
10690
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
516 (set-visited-file-name
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
517 (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
518 (save-buffer)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
519
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
520 (message "That's it! Press any key to exit")
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521 (sit-for 600)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
522 (kill-emacs t)
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523
d41e77a56fd9 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
524 ;;; edt-mapper.el ends here