annotate lisp/emulators/tpu-mapper.el @ 164:4e0740e5aab2

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