Mercurial > emacs
annotate lisp/emulation/tpu-mapper.el @ 12340:dd57075ef7b0
(gud-make-debug-menu): Cope if no local map yet.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 20 Jun 1995 16:34:14 +0000 |
parents | 74168f918db7 |
children | 2005991db844 |
rev | line source |
---|---|
4421 | 1 ;;; tpu-mapper.el --- Create a TPU-edt keymap file for x-windows emacs. |
2 | |
11595
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
3 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. |
4421 | 4 |
5 ;; Author: Rob Riepel <riepel@networking.stanford.edu> | |
6 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu> | |
5140 | 7 ;; Keywords: emulations |
4421 | 8 |
4450 | 9 ;; This file is part of GNU Emacs. |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
4421 | 15 |
4450 | 16 ;; GNU Emacs is distributed in the hope that it will be useful, |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
4421 | 24 |
25 ;;; Commentary: | |
26 | |
27 ;; This emacs lisp program can be used to create an emacs lisp file that | |
28 ;; defines the TPU-edt keypad for emacs running on x-windows. Please read | |
29 ;; the "Usage" AND "Known Problems" sections before attempting to run this | |
30 ;; program. | |
31 | |
32 ;;; Usage: | |
33 | |
34 ;; Simply load this file into the X-windows version of emacs (version 19) | |
35 ;; using the following command. | |
36 | |
37 ;; emacs -q -l tpu-mapper.el | |
38 | |
39 ;; The "-q" option prevents loading of your .emacs file (commands therein | |
40 ;; might confuse this program). | |
41 | |
42 ;; An instruction screen showing the TPU-edt keypad will be displayed, and | |
43 ;; you will be prompted to press the TPU-edt editing keys. Tpu-mapper uses | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
44 ;; the keys you press to create an Emacs Lisp file that will define a |
4421 | 45 ;; TPU-edt keypad for your X server. You can even re-arrange the standard |
46 ;; EDT keypad to suit your tastes (or to cope with those silly Sun and PC | |
47 ;; keypads). | |
48 | |
49 ;; Finally, you will be prompted for the name of the file to store the key | |
50 ;; definitions. If you chose the default, TPU-edt will find it and load it | |
51 ;; automatically. If you specify a different file name, you will need to | |
52 ;; set the variable "tpu-xkeys-file" before loading TPU-edt. Here's how | |
53 ;; you might go about doing that in your .emacs file. | |
54 | |
55 ;; (setq tpu-xkeys-file (expand-file-name "~/.my-emacs-x-keys")) | |
56 ;; (load "tpu-edt") | |
57 | |
58 ;;; Known Problems: | |
59 | |
60 ;; Sometimes, tpu-mapper will ignore a key you press, and just continue to | |
61 ;; prompt for the same key. This can happen when your window manager sucks | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
62 ;; up the key and doesn't pass it on to Emacs, or it could be an Emacs bug. |
4421 | 63 ;; Either way, there's nothing that tpu-mapper can do about it. You must |
64 ;; press RETURN, to skip the current key and continue. Later, you and/or | |
65 ;; your local X guru can try to figure out why the key is being ignored. | |
66 | |
67 ;;; Code: | |
68 | |
69 ;;; | |
70 ;;; Make sure we're running X-windows and Emacs version 19 | |
71 ;;; | |
72 (cond | |
73 ((not (and window-system (not (string-lessp emacs-version "19")))) | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
74 (error "tpu-mapper requires running in Emacs 19, with an X display"))) |
4421 | 75 |
76 | |
77 ;;; | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
78 ;;; Decide whether we're running Lucid Emacs or Emacs itself. |
4421 | 79 ;;; |
80 (defconst tpu-lucid-emacs19-p (string-match "Lucid" emacs-version) | |
81 "Non-NIL if we are running Lucid Emacs version 19.") | |
82 | |
83 | |
84 ;;; | |
85 ;;; Key variables | |
86 ;;; | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
87 (defvar tpu-kp4 nil) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
88 (defvar tpu-kp5 nil) |
4421 | 89 (defvar tpu-key nil) |
90 (defvar tpu-enter nil) | |
91 (defvar tpu-return nil) | |
92 (defvar tpu-key-seq nil) | |
93 (defvar tpu-enter-seq nil) | |
94 (defvar tpu-return-seq nil) | |
95 | |
96 | |
97 ;;; | |
98 ;;; Make sure the window is big enough to display the instructions | |
99 ;;; | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
100 (if tpu-lucid-emacs19-p (set-screen-size (selected-screen) 80 36) |
4421 | 101 (set-frame-size (selected-frame) 80 36)) |
102 | |
103 | |
104 ;;; | |
105 ;;; Create buffers - Directions, Keys, Gold-Keys | |
106 ;;; | |
107 (if (not (get-buffer "Directions")) (generate-new-buffer "Directions")) | |
108 (if (not (get-buffer "Keys")) (generate-new-buffer "Keys")) | |
109 (if (not (get-buffer "Gold-Keys")) (generate-new-buffer "Gold-Keys")) | |
110 | |
111 | |
112 ;;; | |
113 ;;; Put headers in the Keys buffer | |
114 ;;; | |
115 (set-buffer "Keys") | |
116 (insert "\ | |
117 ;; Key definitions for TPU-edt | |
118 ;; | |
119 ") | |
120 | |
121 | |
122 ;;; | |
123 ;;; Display directions | |
124 ;;; | |
125 (switch-to-buffer "Directions") | |
126 (insert " | |
127 This program prompts you to press keys to create a custom keymap file | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
128 for use with the x-windows version of Emacs and TPU-edt. |
4421 | 129 |
130 Start by pressing the RETURN key, and continue by pressing the keys | |
131 specified in the mini-buffer. You can re-arrange the TPU-edt keypad | |
132 by pressing any key you want at any prompt. If you want to entirely | |
133 omit a key, just press RETURN at the prompt. | |
134 | |
135 Here's a picture of the standard TPU/edt keypad for reference: | |
136 | |
137 _______________________ _______________________________ | |
138 | HELP | Do | | | | | | | |
139 |KeyDefs| | | | | | | | |
140 |_______|_______________| |_______|_______|_______|_______| | |
141 _______________________ _______________________________ | |
142 | Find |Insert |Remove | | Gold | HELP |FndNxt | Del L | | |
143 | | |Sto Tex| | key |E-Help | Find |Undel L| | |
144 |_______|_______|_______| |_______|_______|_______|_______| | |
145 |Select |Pre Scr|Nex Scr| | Page | Sect |Append | Del W | | |
146 | Reset |Pre Win|Nex Win| | Do | Fill |Replace|Undel W| | |
147 |_______|_______|_______| |_______|_______|_______|_______| | |
148 |Move up| |Forward|Reverse|Remove | Del C | | |
149 | Top | |Bottom | Top |Insert |Undel C| | |
150 _______|_______|_______ |_______|_______|_______|_______| | |
151 |Mov Lef|Mov Dow|Mov Rig| | Word | EOL | Char | | | |
152 |StaOfLi|Bottom |EndOfLi| |ChngCas|Del EOL|SpecIns| Enter | | |
153 |_______|_______|_______| |_______|_______|_______| | | |
154 | Line |Select | Subs | | |
155 | Open Line | Reset | | | |
156 |_______________|_______|_______| | |
157 | |
158 | |
159 ") | |
160 (delete-other-windows) | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
161 (goto-char (point-min)) |
4421 | 162 |
163 ;;; | |
164 ;;; Save <CR> for future reference | |
165 ;;; | |
166 (cond | |
167 (tpu-lucid-emacs19-p | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
168 (setq tpu-return-seq (read-key-sequence "Hit carriage-return <CR> to continue ")) |
4421 | 169 (setq tpu-return (concat "[" (format "%s" (event-key (aref tpu-return-seq 0))) "]"))) |
170 (t | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
171 (message "Hit carriage-return <CR> to continue ") |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
172 (setq tpu-return-seq (read-event)) |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
173 (setq tpu-return (concat "[" (format "%s" tpu-return-seq) "]")))) |
4421 | 174 |
175 | |
176 ;;; | |
177 ;;; Key mapping functions | |
178 ;;; | |
179 (defun tpu-lucid-map-key (ident descrip func gold-func) | |
180 (interactive) | |
181 (setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) | |
182 (setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]")) | |
183 (cond ((not (equal tpu-key tpu-return)) | |
184 (set-buffer "Keys") | |
185 (insert (format"(global-set-key %s %s)\n" tpu-key func)) | |
186 (set-buffer "Gold-Keys") | |
187 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) | |
188 (set-buffer "Directions")) | |
189 ;; bogosity to get next prompt to come up, if the user hits <CR>! | |
190 ;; check periodically to see if this is still needed... | |
191 (t | |
192 (format "%s" tpu-key))) | |
193 tpu-key) | |
194 | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
195 (defun tpu-emacs-map-key (ident descrip func gold-func) |
4421 | 196 (interactive) |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
197 (message "Press %s%s: " ident descrip) |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
198 (setq tpu-key-seq (read-event)) |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
199 (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]")) |
4421 | 200 (cond ((not (equal tpu-key tpu-return)) |
201 (set-buffer "Keys") | |
202 (insert (format"(global-set-key %s %s)\n" tpu-key func)) | |
203 (set-buffer "Gold-Keys") | |
204 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) | |
205 (set-buffer "Directions")) | |
206 ;; bogosity to get next prompt to come up, if the user hits <CR>! | |
207 ;; check periodically to see if this is still needed... | |
208 (t | |
209 (format "%s" tpu-key))) | |
210 tpu-key) | |
211 | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
212 (fset 'tpu-map-key (if tpu-lucid-emacs19-p 'tpu-lucid-map-key 'tpu-emacs-map-key)) |
4421 | 213 |
214 | |
215 (set-buffer "Keys") | |
216 (insert " | |
217 ;; Arrows | |
218 ;; | |
219 ") | |
220 (set-buffer "Gold-Keys") | |
221 (insert " | |
222 ;; GOLD Arrows | |
223 ;; | |
224 ") | |
225 (set-buffer "Directions") | |
226 | |
227 (tpu-map-key "Up-Arrow" "" "'tpu-previous-line" "'tpu-move-to-beginning") | |
228 (tpu-map-key "Down-arrow" "" "'tpu-next-line" "'tpu-move-to-end") | |
229 (tpu-map-key "Right-arrow" "" "'tpu-forward-char" "'end-of-line") | |
230 (tpu-map-key "Left-arrow" "" "'tpu-backward-char" "'beginning-of-line") | |
231 | |
232 | |
233 (set-buffer "Keys") | |
234 (insert " | |
235 ;; PF keys | |
236 ;; | |
237 ") | |
238 (set-buffer "Gold-Keys") | |
239 (insert " | |
240 ;; GOLD PF keys | |
241 ;; | |
242 ") | |
243 (set-buffer "Directions") | |
244 | |
245 (tpu-map-key "PF1" " - The GOLD key" "GOLD-map" "'keyboard-quit") | |
246 (tpu-map-key "PF2" " - The Keypad Help key" "'tpu-help" "'help-for-help") | |
247 (tpu-map-key "PF3" " - The Find/Find-Next key" "'tpu-search-again" "'tpu-search") | |
248 (tpu-map-key "PF4" " - The Del/Undelete Line key" "'tpu-delete-current-line" "'tpu-undelete-lines") | |
249 | |
250 (set-buffer "Keys") | |
251 (insert " | |
252 ;; KP0-9 KP- KP, KP. and KPenter | |
253 ;; | |
254 ") | |
255 (set-buffer "Gold-Keys") | |
256 (insert " | |
257 ;; GOLD KP0-9 KP- KP, and KPenter | |
258 ;; | |
259 ") | |
260 (set-buffer "Directions") | |
261 | |
262 (tpu-map-key "KP-0" " - The Line/Open-Line key" "'tpu-line" "'open-line") | |
263 (tpu-map-key "KP-1" " - The Word/Change-Case key" "'tpu-word" "'tpu-change-case") | |
264 (tpu-map-key "KP-2" " - The EOL/Delete-EOL key" "'tpu-end-of-line" "'tpu-delete-to-eol") | |
265 (tpu-map-key "KP-3" " - The Character/Special-Insert key" "'tpu-char" "'tpu-special-insert") | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
266 (setq tpu-kp4 (tpu-map-key "KP-4" " - The Forward/Bottom key" "'tpu-advance-direction" "'tpu-move-to-end")) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
267 (setq tpu-kp5 (tpu-map-key "KP-5" " - The Reverse/Top key" "'tpu-backup-direction" "'tpu-move-to-beginning")) |
4421 | 268 (tpu-map-key "KP-6" " - The Remove/Insert key" "'tpu-cut" "'tpu-paste") |
269 (tpu-map-key "KP-7" " - The Page/Do key" "'tpu-page" "'execute-extended-command") | |
270 (tpu-map-key "KP-8" " - The Section/Fill key" "'tpu-scroll-window" "'tpu-fill") | |
271 (tpu-map-key "KP-9" " - The Append/Replace key" "'tpu-append-region" "'tpu-replace") | |
272 (tpu-map-key "KP--" " - The Delete/Undelete Word key" "'tpu-delete-current-word" "'tpu-undelete-words") | |
273 (tpu-map-key "KP-," " - The Delete/Undelete Character key" "'tpu-delete-current-char" "'tpu-undelete-char") | |
274 (tpu-map-key "KP-." " - The Select/Reset key" "'tpu-select" "'tpu-unselect") | |
275 (tpu-map-key "KP-Enter" " - The Enter key on the numeric keypad" "'newline" "'tpu-substitute") | |
276 ;; Save the enter key | |
277 (setq tpu-enter tpu-key) | |
278 (setq tpu-enter-seq tpu-key-seq) | |
279 | |
280 (set-buffer "Keys") | |
281 (insert " | |
282 ;; Editing keypad (find, insert, remove) | |
283 ;; (select, prev, next) | |
284 ;; | |
285 ") | |
286 (set-buffer "Gold-Keys") | |
287 (insert " | |
288 ;; GOLD Editing keypad (find, insert, remove) | |
289 ;; (select, prev, next) | |
290 ;; | |
291 ") | |
292 (set-buffer "Directions") | |
293 | |
294 (tpu-map-key "Find" " - The Find key on the editing keypad" "'tpu-search" "'nil") | |
295 (tpu-map-key "Insert" " - The Insert key on the editing keypad" "'tpu-paste" "'nil") | |
296 (tpu-map-key "Remove" " - The Remove key on the editing keypad" "'tpu-cut" "'tpu-store-text") | |
297 (tpu-map-key "Select" " - The Select key on the editing keypad" "'tpu-select" "'tpu-unselect") | |
298 (tpu-map-key "Prev Scr" " - The Prev Scr key on the editing keypad" "'tpu-scroll-window-down" "'tpu-previous-window") | |
299 (tpu-map-key "Next Scr" " - The Next Scr key on the editing keypad" "'tpu-scroll-window-up" "'tpu-next-window") | |
300 | |
301 (set-buffer "Keys") | |
302 (insert " | |
303 ;; F10-14 Help Do F17 | |
304 ;; | |
305 ") | |
306 (set-buffer "Gold-Keys") | |
307 (insert " | |
308 ;; GOLD F10-14 Help Do F17 | |
309 ;; | |
310 ") | |
311 (set-buffer "Directions") | |
312 | |
313 (tpu-map-key "F10" " - Invokes the Exit function on VT200+ terminals" "'tpu-exit" "'nil") | |
314 (tpu-map-key "F11" " - Inserts an Escape character into the text" "'tpu-insert-escape" "'nil") | |
315 (tpu-map-key "Backspace" " - Not Delete nor ^H! Sometimes on the F12 key" "'tpu-next-beginning-of-line" "'nil") | |
316 (tpu-map-key "F13" " - Invokes the delete previous word function" "'tpu-delete-previous-word" "'nil") | |
317 (tpu-map-key "F14" " - Toggles insert/overstrike modes" "'tpu-toggle-overwrite-mode" "'nil") | |
318 (tpu-map-key "Help" " - Brings up the help screen, same as PF2" "'tpu-help" "'describe-bindings") | |
319 (tpu-map-key "Do" " - Invokes the COMMAND function" "'execute-extended-command" "'nil") | |
320 (tpu-map-key "F17" "" "'tpu-goto-breadcrumb" "'tpu-drop-breadcrumb") | |
321 | |
322 (set-buffer "Gold-Keys") | |
323 (cond | |
324 ((not (equal tpu-enter tpu-return)) | |
325 (insert " | |
326 ;; Minibuffer map additions to make KP_enter = RET | |
327 ;; | |
328 ") | |
329 | |
330 (insert (format "(define-key minibuffer-local-map %s 'exit-minibuffer)\n" tpu-enter)) | |
331 (insert (format "(define-key minibuffer-local-ns-map %s 'exit-minibuffer)\n" tpu-enter)) | |
332 (insert (format "(define-key minibuffer-local-completion-map %s 'exit-minibuffer)\n" tpu-enter)) | |
333 (insert (format "(define-key minibuffer-local-must-match-map %s 'minibuffer-complete-and-exit)\n" tpu-enter)))) | |
334 | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
335 (cond |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
336 ((not (or (equal tpu-kp4 tpu-return) (equal tpu-kp5 tpu-return))) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
337 (insert " |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
338 ;; Minibuffer map additions to allow KP-4/5 termination of search strings. |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
339 ;; |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
340 ") |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
341 |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
342 (insert (format "(define-key minibuffer-local-map %s 'tpu-search-forward-exit)\n" tpu-kp4)) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
343 (insert (format "(define-key minibuffer-local-map %s 'tpu-search-backward-exit)\n" tpu-kp5)))) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
344 |
4421 | 345 (insert " |
346 ;; Define the tpu-help-enter/return symbols | |
347 ;; | |
348 ") | |
349 | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
350 (cond (tpu-lucid-emacs19-p |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
351 (insert (format "(setq tpu-help-enter \"%s\")\n" tpu-enter-seq)) |
4548
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
352 (insert (format "(setq tpu-help-return \"%s\")\n" tpu-return-seq)) |
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
353 (insert "(setq tpu-help-N \"[#<keypress-event N>]\")\n") |
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
354 (insert "(setq tpu-help-n \"[#<keypress-event n>]\")\n") |
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
355 (insert "(setq tpu-help-P \"[#<keypress-event P>]\")\n") |
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
356 (insert "(setq tpu-help-p \"[#<keypress-event p>]\")\n")) |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
357 (t |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
358 (insert (format "(setq tpu-help-enter \"%s\")\n" tpu-enter)))) |
4421 | 359 |
360 (append-to-buffer "Keys" 1 (point)) | |
361 (set-buffer "Keys") | |
362 | |
363 ;;; | |
11595
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
364 ;;; Save the key mapping program |
4421 | 365 ;;; |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
366 (let ((file (if tpu-lucid-emacs19-p "~/.tpu-lucid-keys" "~/.tpu-keys"))) |
4421 | 367 (set-visited-file-name |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
368 (read-file-name (format "Save key mapping to file (default %s): " file) "" file))) |
4421 | 369 (save-buffer) |
370 | |
11595
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
371 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
372 ;;; Load the newly defined keys and clean up |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
373 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
374 (eval-current-buffer) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
375 (kill-buffer (current-buffer)) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
376 (kill-buffer "*scratch*") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
377 (kill-buffer "Gold-Keys") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
378 |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
379 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
380 ;;; Let them know it worked. |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
381 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
382 (switch-to-buffer "Directions") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
383 (erase-buffer) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
384 (insert " |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
385 A custom TPU-edt keymap file has been created. |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
386 |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
387 Press GOLD-k to remove this buffer and continue editing. |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
388 ") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
389 (goto-char (point-min)) |
4421 | 390 |
391 ;;; tpu-mapper.el ends here |