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