Mercurial > emacs
annotate lisp/emulation/tpu-mapper.el @ 13503:726e91517ff6
(sh-mode): as above. Use page-delimiter rather than literal "^L".
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 11 Nov 1995 05:31:11 +0000 |
parents | 2005991db844 |
children | 83f275dcd93a |
rev | line source |
---|---|
12685 | 1 ;;; tpu-mapper.el --- Create a TPU-edt X-windows keymap file |
4421 | 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 | |
12685 | 34 ;; Simply load this file into the X-windows version of emacs using the |
35 ;; following command. | |
4421 | 36 |
12685 | 37 ;; emacs -q -l tpu-mapper |
4421 | 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 | |
12685 | 52 ;; set the variable "tpu-xkeys-file" before starting TPU-edt. Here's how |
4421 | 53 ;; you might go about doing that in your .emacs file. |
54 | |
55 ;; (setq tpu-xkeys-file (expand-file-name "~/.my-emacs-x-keys")) | |
12685 | 56 ;; (tpu-edt) |
4421 | 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 | |
12685 | 69 |
4421 | 70 ;;; |
71 ;;; Make sure we're running X-windows and Emacs version 19 | |
72 ;;; | |
73 (cond | |
74 ((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
|
75 (error "tpu-mapper requires running in Emacs 19, with an X display"))) |
4421 | 76 |
77 | |
78 ;;; | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
79 ;;; Decide whether we're running Lucid Emacs or Emacs itself. |
4421 | 80 ;;; |
81 (defconst tpu-lucid-emacs19-p (string-match "Lucid" emacs-version) | |
82 "Non-NIL if we are running Lucid Emacs version 19.") | |
83 | |
84 | |
85 ;;; | |
86 ;;; Key variables | |
87 ;;; | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
88 (defvar tpu-kp4 nil) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
89 (defvar tpu-kp5 nil) |
4421 | 90 (defvar tpu-key nil) |
91 (defvar tpu-enter nil) | |
92 (defvar tpu-return nil) | |
93 (defvar tpu-key-seq nil) | |
94 (defvar tpu-enter-seq nil) | |
95 (defvar tpu-return-seq nil) | |
96 | |
97 | |
98 ;;; | |
99 ;;; Make sure the window is big enough to display the instructions | |
100 ;;; | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
101 (if tpu-lucid-emacs19-p (set-screen-size (selected-screen) 80 36) |
4421 | 102 (set-frame-size (selected-frame) 80 36)) |
103 | |
104 | |
105 ;;; | |
106 ;;; Create buffers - Directions, Keys, Gold-Keys | |
107 ;;; | |
108 (if (not (get-buffer "Directions")) (generate-new-buffer "Directions")) | |
109 (if (not (get-buffer "Keys")) (generate-new-buffer "Keys")) | |
110 (if (not (get-buffer "Gold-Keys")) (generate-new-buffer "Gold-Keys")) | |
111 | |
112 | |
113 ;;; | |
114 ;;; Put headers in the Keys buffer | |
115 ;;; | |
116 (set-buffer "Keys") | |
117 (insert "\ | |
118 ;; Key definitions for TPU-edt | |
119 ;; | |
120 ") | |
121 | |
122 | |
123 ;;; | |
124 ;;; Display directions | |
125 ;;; | |
126 (switch-to-buffer "Directions") | |
127 (insert " | |
128 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
|
129 for use with the x-windows version of Emacs and TPU-edt. |
4421 | 130 |
131 Start by pressing the RETURN key, and continue by pressing the keys | |
132 specified in the mini-buffer. You can re-arrange the TPU-edt keypad | |
133 by pressing any key you want at any prompt. If you want to entirely | |
134 omit a key, just press RETURN at the prompt. | |
135 | |
136 Here's a picture of the standard TPU/edt keypad for reference: | |
137 | |
138 _______________________ _______________________________ | |
139 | HELP | Do | | | | | | | |
140 |KeyDefs| | | | | | | | |
141 |_______|_______________| |_______|_______|_______|_______| | |
142 _______________________ _______________________________ | |
143 | Find |Insert |Remove | | Gold | HELP |FndNxt | Del L | | |
144 | | |Sto Tex| | key |E-Help | Find |Undel L| | |
145 |_______|_______|_______| |_______|_______|_______|_______| | |
146 |Select |Pre Scr|Nex Scr| | Page | Sect |Append | Del W | | |
147 | Reset |Pre Win|Nex Win| | Do | Fill |Replace|Undel W| | |
148 |_______|_______|_______| |_______|_______|_______|_______| | |
149 |Move up| |Forward|Reverse|Remove | Del C | | |
150 | Top | |Bottom | Top |Insert |Undel C| | |
151 _______|_______|_______ |_______|_______|_______|_______| | |
152 |Mov Lef|Mov Dow|Mov Rig| | Word | EOL | Char | | | |
153 |StaOfLi|Bottom |EndOfLi| |ChngCas|Del EOL|SpecIns| Enter | | |
154 |_______|_______|_______| |_______|_______|_______| | | |
155 | Line |Select | Subs | | |
156 | Open Line | Reset | | | |
157 |_______________|_______|_______| | |
158 | |
159 | |
160 ") | |
161 (delete-other-windows) | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
162 (goto-char (point-min)) |
4421 | 163 |
164 ;;; | |
165 ;;; Save <CR> for future reference | |
166 ;;; | |
167 (cond | |
168 (tpu-lucid-emacs19-p | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
169 (setq tpu-return-seq (read-key-sequence "Hit carriage-return <CR> to continue ")) |
4421 | 170 (setq tpu-return (concat "[" (format "%s" (event-key (aref tpu-return-seq 0))) "]"))) |
171 (t | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
172 (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
|
173 (setq tpu-return-seq (read-event)) |
12685 | 174 (setq tpu-return (concat "[" (format "%s" tpu-return-seq) "]")))) |
4421 | 175 |
176 | |
177 ;;; | |
178 ;;; Key mapping functions | |
179 ;;; | |
180 (defun tpu-lucid-map-key (ident descrip func gold-func) | |
181 (interactive) | |
182 (setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) | |
183 (setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]")) | |
184 (cond ((not (equal tpu-key tpu-return)) | |
185 (set-buffer "Keys") | |
186 (insert (format"(global-set-key %s %s)\n" tpu-key func)) | |
187 (set-buffer "Gold-Keys") | |
188 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) | |
189 (set-buffer "Directions")) | |
190 ;; bogosity to get next prompt to come up, if the user hits <CR>! | |
191 ;; check periodically to see if this is still needed... | |
192 (t | |
193 (format "%s" tpu-key))) | |
194 tpu-key) | |
195 | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
196 (defun tpu-emacs-map-key (ident descrip func gold-func) |
4421 | 197 (interactive) |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
198 (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
|
199 (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
|
200 (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]")) |
4421 | 201 (cond ((not (equal tpu-key tpu-return)) |
202 (set-buffer "Keys") | |
203 (insert (format"(global-set-key %s %s)\n" tpu-key func)) | |
204 (set-buffer "Gold-Keys") | |
205 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) | |
206 (set-buffer "Directions")) | |
207 ;; bogosity to get next prompt to come up, if the user hits <CR>! | |
208 ;; check periodically to see if this is still needed... | |
209 (t | |
210 (format "%s" tpu-key))) | |
211 tpu-key) | |
212 | |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
213 (fset 'tpu-map-key (if tpu-lucid-emacs19-p 'tpu-lucid-map-key 'tpu-emacs-map-key)) |
4421 | 214 |
215 | |
216 (set-buffer "Keys") | |
217 (insert " | |
218 ;; Arrows | |
219 ;; | |
220 ") | |
221 (set-buffer "Gold-Keys") | |
222 (insert " | |
223 ;; GOLD Arrows | |
224 ;; | |
225 ") | |
226 (set-buffer "Directions") | |
227 | |
228 (tpu-map-key "Up-Arrow" "" "'tpu-previous-line" "'tpu-move-to-beginning") | |
229 (tpu-map-key "Down-arrow" "" "'tpu-next-line" "'tpu-move-to-end") | |
230 (tpu-map-key "Right-arrow" "" "'tpu-forward-char" "'end-of-line") | |
231 (tpu-map-key "Left-arrow" "" "'tpu-backward-char" "'beginning-of-line") | |
232 | |
233 | |
234 (set-buffer "Keys") | |
235 (insert " | |
236 ;; PF keys | |
237 ;; | |
238 ") | |
239 (set-buffer "Gold-Keys") | |
240 (insert " | |
241 ;; GOLD PF keys | |
242 ;; | |
243 ") | |
244 (set-buffer "Directions") | |
245 | |
246 (tpu-map-key "PF1" " - The GOLD key" "GOLD-map" "'keyboard-quit") | |
247 (tpu-map-key "PF2" " - The Keypad Help key" "'tpu-help" "'help-for-help") | |
248 (tpu-map-key "PF3" " - The Find/Find-Next key" "'tpu-search-again" "'tpu-search") | |
249 (tpu-map-key "PF4" " - The Del/Undelete Line key" "'tpu-delete-current-line" "'tpu-undelete-lines") | |
250 | |
251 (set-buffer "Keys") | |
252 (insert " | |
253 ;; KP0-9 KP- KP, KP. and KPenter | |
254 ;; | |
255 ") | |
256 (set-buffer "Gold-Keys") | |
257 (insert " | |
258 ;; GOLD KP0-9 KP- KP, and KPenter | |
259 ;; | |
260 ") | |
261 (set-buffer "Directions") | |
262 | |
263 (tpu-map-key "KP-0" " - The Line/Open-Line key" "'tpu-line" "'open-line") | |
264 (tpu-map-key "KP-1" " - The Word/Change-Case key" "'tpu-word" "'tpu-change-case") | |
265 (tpu-map-key "KP-2" " - The EOL/Delete-EOL key" "'tpu-end-of-line" "'tpu-delete-to-eol") | |
266 (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
|
267 (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
|
268 (setq tpu-kp5 (tpu-map-key "KP-5" " - The Reverse/Top key" "'tpu-backup-direction" "'tpu-move-to-beginning")) |
4421 | 269 (tpu-map-key "KP-6" " - The Remove/Insert key" "'tpu-cut" "'tpu-paste") |
270 (tpu-map-key "KP-7" " - The Page/Do key" "'tpu-page" "'execute-extended-command") | |
271 (tpu-map-key "KP-8" " - The Section/Fill key" "'tpu-scroll-window" "'tpu-fill") | |
272 (tpu-map-key "KP-9" " - The Append/Replace key" "'tpu-append-region" "'tpu-replace") | |
273 (tpu-map-key "KP--" " - The Delete/Undelete Word key" "'tpu-delete-current-word" "'tpu-undelete-words") | |
274 (tpu-map-key "KP-," " - The Delete/Undelete Character key" "'tpu-delete-current-char" "'tpu-undelete-char") | |
275 (tpu-map-key "KP-." " - The Select/Reset key" "'tpu-select" "'tpu-unselect") | |
276 (tpu-map-key "KP-Enter" " - The Enter key on the numeric keypad" "'newline" "'tpu-substitute") | |
277 ;; Save the enter key | |
278 (setq tpu-enter tpu-key) | |
279 (setq tpu-enter-seq tpu-key-seq) | |
280 | |
281 (set-buffer "Keys") | |
282 (insert " | |
283 ;; Editing keypad (find, insert, remove) | |
284 ;; (select, prev, next) | |
285 ;; | |
286 ") | |
287 (set-buffer "Gold-Keys") | |
288 (insert " | |
289 ;; GOLD Editing keypad (find, insert, remove) | |
290 ;; (select, prev, next) | |
291 ;; | |
292 ") | |
293 (set-buffer "Directions") | |
294 | |
295 (tpu-map-key "Find" " - The Find key on the editing keypad" "'tpu-search" "'nil") | |
296 (tpu-map-key "Insert" " - The Insert key on the editing keypad" "'tpu-paste" "'nil") | |
297 (tpu-map-key "Remove" " - The Remove key on the editing keypad" "'tpu-cut" "'tpu-store-text") | |
298 (tpu-map-key "Select" " - The Select key on the editing keypad" "'tpu-select" "'tpu-unselect") | |
299 (tpu-map-key "Prev Scr" " - The Prev Scr key on the editing keypad" "'tpu-scroll-window-down" "'tpu-previous-window") | |
300 (tpu-map-key "Next Scr" " - The Next Scr key on the editing keypad" "'tpu-scroll-window-up" "'tpu-next-window") | |
301 | |
302 (set-buffer "Keys") | |
303 (insert " | |
304 ;; F10-14 Help Do F17 | |
305 ;; | |
306 ") | |
307 (set-buffer "Gold-Keys") | |
308 (insert " | |
309 ;; GOLD F10-14 Help Do F17 | |
310 ;; | |
311 ") | |
312 (set-buffer "Directions") | |
313 | |
314 (tpu-map-key "F10" " - Invokes the Exit function on VT200+ terminals" "'tpu-exit" "'nil") | |
315 (tpu-map-key "F11" " - Inserts an Escape character into the text" "'tpu-insert-escape" "'nil") | |
316 (tpu-map-key "Backspace" " - Not Delete nor ^H! Sometimes on the F12 key" "'tpu-next-beginning-of-line" "'nil") | |
317 (tpu-map-key "F13" " - Invokes the delete previous word function" "'tpu-delete-previous-word" "'nil") | |
318 (tpu-map-key "F14" " - Toggles insert/overstrike modes" "'tpu-toggle-overwrite-mode" "'nil") | |
319 (tpu-map-key "Help" " - Brings up the help screen, same as PF2" "'tpu-help" "'describe-bindings") | |
320 (tpu-map-key "Do" " - Invokes the COMMAND function" "'execute-extended-command" "'nil") | |
321 (tpu-map-key "F17" "" "'tpu-goto-breadcrumb" "'tpu-drop-breadcrumb") | |
322 | |
323 (set-buffer "Gold-Keys") | |
324 (cond | |
325 ((not (equal tpu-enter tpu-return)) | |
326 (insert " | |
327 ;; Minibuffer map additions to make KP_enter = RET | |
328 ;; | |
329 ") | |
330 | |
331 (insert (format "(define-key minibuffer-local-map %s 'exit-minibuffer)\n" tpu-enter)) | |
332 (insert (format "(define-key minibuffer-local-ns-map %s 'exit-minibuffer)\n" tpu-enter)) | |
333 (insert (format "(define-key minibuffer-local-completion-map %s 'exit-minibuffer)\n" tpu-enter)) | |
334 (insert (format "(define-key minibuffer-local-must-match-map %s 'minibuffer-complete-and-exit)\n" tpu-enter)))) | |
335 | |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
336 (cond |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
337 ((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
|
338 (insert " |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
339 ;; 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
|
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 |
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-forward-exit)\n" tpu-kp4)) |
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
344 (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
|
345 |
4421 | 346 (insert " |
347 ;; Define the tpu-help-enter/return symbols | |
348 ;; | |
349 ") | |
350 | |
4525
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
351 (cond (tpu-lucid-emacs19-p |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
352 (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
|
353 (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
|
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-n \"[#<keypress-event n>]\")\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") |
fb0f96c4154b
Insert setqs for tpu-help-... variables.
Richard M. Stallman <rms@gnu.org>
parents:
4525
diff
changeset
|
357 (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
|
358 (t |
03d1a39e66c9
(tpu-gnu-map-key): Repaired the key name
Richard M. Stallman <rms@gnu.org>
parents:
4450
diff
changeset
|
359 (insert (format "(setq tpu-help-enter \"%s\")\n" tpu-enter)))) |
4421 | 360 |
361 (append-to-buffer "Keys" 1 (point)) | |
362 (set-buffer "Keys") | |
363 | |
364 ;;; | |
11595
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
365 ;;; Save the key mapping program |
4421 | 366 ;;; |
11547
a39d8ae4ed2e
At end, use default file name .tpu-keys.
Richard M. Stallman <rms@gnu.org>
parents:
7980
diff
changeset
|
367 (let ((file (if tpu-lucid-emacs19-p "~/.tpu-lucid-keys" "~/.tpu-keys"))) |
4421 | 368 (set-visited-file-name |
7980
0e9eddc5d598
Change size of selected screen. Reposition after
Richard M. Stallman <rms@gnu.org>
parents:
5140
diff
changeset
|
369 (read-file-name (format "Save key mapping to file (default %s): " file) "" file))) |
4421 | 370 (save-buffer) |
371 | |
11595
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
372 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
373 ;;; 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
|
374 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
375 (eval-current-buffer) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
376 (kill-buffer (current-buffer)) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
377 (kill-buffer "*scratch*") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
378 (kill-buffer "Gold-Keys") |
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 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
381 ;;; Let them know it worked. |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
382 ;;; |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
383 (switch-to-buffer "Directions") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
384 (erase-buffer) |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
385 (insert " |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
386 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
|
387 |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
388 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
|
389 ") |
74168f918db7
Eval key definitions and clean up upon completion.
Richard M. Stallman <rms@gnu.org>
parents:
11547
diff
changeset
|
390 (goto-char (point-min)) |
4421 | 391 |
392 ;;; tpu-mapper.el ends here |