Mercurial > hg > xemacs-beta
annotate lisp/keymap.el @ 5582:873d7425c1ad
Change integer to fixnum in a few places where it wasn't possible mechanically.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
Do a couple of non-mechanical things that would otherwise have
been included in the last change.
* data.c:
* data.c (Ftype_of):
Return Qfixnum for fixnums, not Qinteger.
* lisp.h (MOST_POSITIVE_FIXNUM):
Delete an obsolete comment here.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
* internals/internals.texi (Top):
* internals/internals.texi (Authorship of XEmacs):
* internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System):
* internals/internals.texi (Introduction to Writing C Code):
* internals/internals.texi (Working with Lisp Objects):
* internals/internals.texi (Adding Global Lisp Variables):
* internals/internals.texi (The XEmacs Object System (Abstractly Speaking)):
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Allocation of Objects in XEmacs Lisp):
* internals/internals.texi (Introduction to Allocation):
* internals/internals.texi (GCPROing):
* internals/internals.texi (mark_object):
* internals/internals.texi (sweep_bit_vectors_1):
* internals/internals.texi (Fixnums and Characters):
* internals/internals.texi (Future Work -- Unicode):
Say fixnum rather than integer when specifically talking about
fixed-width Lisp integers.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 09 Oct 2011 10:39:09 +0100 |
parents | 071b810ceb18 |
children | f9e4d44504a4 |
rev | line source |
---|---|
428 | 1 ;; keymap.el --- Keymap functions for XEmacs. |
2 | |
3 ;; Copyright (C) 1993-4, 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. | |
1333 | 5 ;; Copyright (C) 2003 Ben Wing. |
428 | 6 |
7 ;; Maintainer: XEmacs Development Team | |
8 ;; Keywords: internals, dumped | |
9 | |
10 ;; This file is part of XEmacs. | |
11 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
12 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
13 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
14 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
15 ;; option) any later version. |
428 | 16 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
17 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
19 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
20 ;; for more details. |
428 | 21 |
22 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2828
diff
changeset
|
23 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 24 |
25 ;;; Synched up with: FSF 19.28. | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;; This file is dumped with XEmacs. | |
30 | |
31 ;;; Note: FSF does not have a file keymap.el. This stuff is | |
32 ;;; in keymap.c. | |
33 | |
34 ;Prevent the \{...} documentation construct | |
35 ;from mentioning keys that run this command. | |
36 | |
37 ;;; Code: | |
38 | |
1333 | 39 ;; BEGIN SYNCHED WITH FSF 21.2. |
428 | 40 |
41 (defun undefined () | |
42 (interactive) | |
43 (ding)) | |
44 | |
1333 | 45 ;Prevent the \{...} documentation construct |
46 ;from mentioning keys that run this command. | |
47 (put 'undefined 'suppress-keymap t) | |
428 | 48 |
49 (defun suppress-keymap (map &optional nodigits) | |
50 "Make MAP override all normally self-inserting keys to be undefined. | |
51 Normally, as an exception, digits and minus-sign are set to make prefix args, | |
52 but optional second arg NODIGITS non-nil treats them like other chars." | |
53 (substitute-key-definition 'self-insert-command 'undefined map global-map) | |
54 (or nodigits | |
55 (let ((string (make-string 1 ?0))) | |
56 (define-key map "-" 'negative-argument) | |
57 ;; Make plain numbers do numeric args. | |
58 (while (<= (aref string 0) ?9) | |
59 (define-key map string 'digit-argument) | |
60 (incf (aref string 0)))))) | |
61 | |
1333 | 62 ;Unneeded in XEmacs (defvar key-substitution-in-progress nil |
63 | |
428 | 64 (defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix) |
65 "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF. | |
66 In other words, OLDDEF is replaced with NEWDEF wherever it appears. | |
67 Prefix keymaps are checked recursively. If optional fourth argument OLDMAP | |
68 is specified, we redefine in KEYMAP as NEWDEF those chars which are defined | |
444 | 69 as OLDDEF in OLDMAP, unless that keybinding is already present in KEYMAP. |
70 If optional fifth argument PREFIX is non-nil, then only those occurrences of | |
428 | 71 OLDDEF found in keymaps accessible through the keymap bound to PREFIX in |
72 KEYMAP are redefined. See also `accessible-keymaps'." | |
73 (let ((maps (accessible-keymaps (or oldmap keymap) prefix)) | |
74 (shadowing (not (null oldmap))) | |
75 prefix map) | |
76 (while maps | |
77 (setq prefix (car (car maps)) | |
78 map (cdr (car maps)) | |
79 maps (cdr maps)) | |
80 ;; Substitute in this keymap | |
81 (map-keymap #'(lambda (key binding) | |
1333 | 82 (if (or (eq binding olddef) |
83 ;; Compare with equal if definition is a key | |
84 ;; sequence. That is useful for operating on | |
85 ;; function-key-map. | |
86 (and (or (stringp binding) (vectorp binding)) | |
87 (equal binding olddef))) | |
428 | 88 ;; The new bindings always go in KEYMAP even if we |
89 ;; found them in OLDMAP or one of its children. | |
90 ;; If KEYMAP will be shadowing OLDMAP, then do not | |
91 ;; redefine the key if there is another binding | |
92 ;; in KEYMAP that will shadow OLDDEF. | |
93 (or (and shadowing | |
94 (lookup-key keymap key)) | |
95 ;; define-key will give an error if a prefix | |
96 ;; of the key is already defined. Otherwise | |
97 ;; it will define the key in the map. | |
98 ;; #### - Perhaps this should be protected? | |
99 (define-key | |
100 keymap | |
101 (vconcat prefix (list key)) | |
102 newdef)))) | |
103 map) | |
104 ))) | |
105 | |
1333 | 106 ;; FSF garbage. They misguidedly tried to put menu entries into keymaps, |
107 ;; and needed stuff like the following. Eventually they admitted defeat | |
108 ;; and switched to our method. | |
109 | |
110 ; (defun define-key-after (keymap key definition &optional after) | |
111 ; "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. | |
112 ; This is like `define-key' except that the binding for KEY is placed | |
113 ; just after the binding for the event AFTER, instead of at the beginning | |
114 ; of the map. Note that AFTER must be an event type (like KEY), NOT a command | |
115 ; \(like DEFINITION). | |
116 ; | |
117 ; If AFTER is t or omitted, the new binding goes at the end of the keymap. | |
118 ; | |
119 ; KEY must contain just one event type--that is to say, it must be a | |
120 ; string or vector of length 1, but AFTER should be a single event | |
121 ; type--a symbol or a character, not a sequence. | |
122 ; | |
123 ; Bindings are always added before any inherited map. | |
124 ; | |
125 ; The order of bindings in a keymap matters when it is used as a menu." | |
126 | |
127 (defmacro kbd (keys) | |
128 "Convert KEYS to the internal Emacs key representation. | |
129 KEYS should be a string constant in the format used for | |
130 saving keyboard macros (see `insert-kbd-macro')." | |
131 (if (or (stringp keys) | |
132 (vectorp keys)) | |
133 ;; #### need to move xemacs-base into the core!!!!!! | |
134 (declare-fboundp (read-kbd-macro keys)) | |
135 `(declare-fboundp (read-kbd-macro ,keys)))) | |
136 | |
137 ;; END SYNCHED WITH FSF 21.2. | |
428 | 138 |
139 ;; This used to wrap forms into an interactive lambda. It is unclear | |
140 ;; to me why this is needed in this function. Anyway, | |
141 ;; `key-or-menu-binding' doesn't do it, so this function no longer | |
142 ;; does it, either. | |
143 (defun insert-key-binding (key) ; modeled after describe-key | |
144 "Insert the command bound to KEY." | |
145 (interactive "kInsert command bound to key: ") | |
146 (let ((defn (key-or-menu-binding key))) | |
147 (if (or (null defn) (integerp defn)) | |
148 (error "%s is undefined" (key-description key)) | |
149 (if (or (stringp defn) (vectorp defn)) | |
150 (setq defn (key-binding defn))) ;; a keyboard macro | |
151 (insert (format "%s" defn))))) | |
152 | |
153 (defun read-command-or-command-sexp (prompt) | |
154 "Read a command symbol or command sexp. | |
155 A command sexp is wrapped in an interactive lambda if needed. | |
156 Prompts with PROMPT." | |
157 ;; Todo: it would be better if we could reject symbols that are not | |
158 ;; commandp (as does 'read-command') but that is not easy to do | |
159 ;; because we must supply arg4 = require-match = nil for sexp case. | |
160 (let ((result (car (read-from-string | |
161 (completing-read prompt obarray 'commandp))))) | |
162 (if (and (consp result) | |
163 (not (eq (car result) 'lambda))) | |
164 `(lambda () | |
165 (interactive) | |
166 ,result) | |
167 result))) | |
168 | |
444 | 169 (defun local-key-binding (keys &optional accept-defaults) |
428 | 170 "Return the binding for command KEYS in current local keymap only. |
171 KEYS is a string, a vector of events, or a vector of key-description lists | |
172 as described in the documentation for the `define-key' function. | |
173 The binding is probably a symbol with a function definition; see | |
174 the documentation for `lookup-key' for more information." | |
175 (let ((map (current-local-map))) | |
176 (if map | |
444 | 177 (lookup-key map keys accept-defaults) |
428 | 178 nil))) |
179 | |
444 | 180 (defun global-key-binding (keys &optional accept-defaults) |
428 | 181 "Return the binding for command KEYS in current global keymap only. |
182 KEYS is a string or vector of events, a sequence of keystrokes. | |
183 The binding is probably a symbol with a function definition; see | |
184 the documentation for `lookup-key' for more information." | |
444 | 185 (lookup-key (current-global-map) keys accept-defaults)) |
428 | 186 |
187 (defun global-set-key (key command) | |
188 "Give KEY a global binding as COMMAND. | |
189 COMMAND is a symbol naming an interactively-callable function. | |
190 KEY is a string, a vector of events, or a vector of key-description lists | |
191 as described in the documentation for the `define-key' function. | |
192 Note that if KEY has a local binding in the current buffer | |
193 that local binding will continue to shadow any global binding." | |
194 ;;(interactive "KSet key globally: \nCSet key %s to command: ") | |
195 (interactive (list (setq key (read-key-sequence "Set key globally: ")) | |
196 ;; Command sexps are allowed here so that this arg | |
197 ;; may be supplied interactively via insert-key-binding. | |
198 (read-command-or-command-sexp | |
199 (format "Set key %s to command: " | |
200 (key-description key))))) | |
201 (define-key (current-global-map) key command) | |
202 nil) | |
203 | |
204 (defun local-set-key (key command) | |
205 "Give KEY a local binding as COMMAND. | |
206 COMMAND is a symbol naming an interactively-callable function. | |
207 KEY is a string, a vector of events, or a vector of key-description lists | |
208 as described in the documentation for the `define-key' function. | |
209 The binding goes in the current buffer's local map, | |
210 which is shared with other buffers in the same major mode." | |
211 ;;(interactive "KSet key locally: \nCSet key %s locally to command: ") | |
212 (interactive (list (setq key (read-key-sequence "Set key locally: ")) | |
213 ;; Command sexps are allowed here so that this arg | |
214 ;; may be supplied interactively via insert-key-binding. | |
215 (read-command-or-command-sexp | |
216 (format "Set key %s locally to command: " | |
217 (key-description key))))) | |
218 (if (null (current-local-map)) | |
219 (use-local-map (make-sparse-keymap))) | |
220 (define-key (current-local-map) key command) | |
221 nil) | |
222 | |
223 (defun global-unset-key (key) | |
224 "Remove global binding of KEY. | |
225 KEY is a string, a vector of events, or a vector of key-description lists | |
226 as described in the documentation for the `define-key' function." | |
227 (interactive "kUnset key globally: ") | |
228 (global-set-key key nil)) | |
229 | |
230 (defun local-unset-key (key) | |
231 "Remove local binding of KEY. | |
232 KEY is a string, a vector of events, or a vector of key-description lists | |
233 as described in the documentation for the `define-key' function." | |
234 (interactive "kUnset key locally: ") | |
235 (if (current-local-map) | |
236 (define-key (current-local-map) key nil))) | |
237 | |
238 | |
239 ;; FSF-inherited brain-death. | |
240 (defun minor-mode-key-binding (key &optional accept-default) | |
241 "Find the visible minor mode bindings of KEY. | |
242 Return an alist of pairs (MODENAME . BINDING), where MODENAME is | |
243 the symbol which names the minor mode binding KEY, and BINDING is | |
244 KEY's definition in that mode. In particular, if KEY has no | |
245 minor-mode bindings, return nil. If the first binding is a | |
246 non-prefix, all subsequent bindings will be omitted, since they would | |
247 be ignored. Similarly, the list doesn't include non-prefix bindings | |
248 that come after prefix bindings. | |
249 | |
250 If optional argument ACCEPT-DEFAULT is non-nil, recognize default | |
251 bindings; see the description of `lookup-key' for more details about this." | |
252 (let ((tail minor-mode-map-alist) | |
253 a s v) | |
254 (while tail | |
255 (setq a (car tail) | |
256 tail (cdr tail)) | |
257 (and (consp a) | |
258 (symbolp (setq s (car a))) | |
259 (boundp s) | |
260 (symbol-value s) | |
261 ;; indirect-function deals with autoloadable keymaps | |
262 (setq v (indirect-function (cdr a))) | |
263 (setq v (lookup-key v key accept-default)) | |
264 ;; Terminate loop, with v set to non-nil value | |
265 (setq tail nil))) | |
266 v)) | |
267 | |
268 | |
269 (defun current-minor-mode-maps () | |
270 "Return a list of keymaps for the minor modes of the current buffer." | |
271 (let ((l '()) | |
272 (tail minor-mode-map-alist) | |
273 a s v) | |
274 (while tail | |
275 (setq a (car tail) | |
276 tail (cdr tail)) | |
277 (and (consp a) | |
278 (symbolp (setq s (car a))) | |
279 (boundp s) | |
280 (symbol-value s) | |
281 ;; indirect-function deals with autoloadable keymaps | |
282 (setq v (indirect-function (cdr a))) | |
283 (setq l (cons v l)))) | |
284 (nreverse l))) | |
285 | |
286 | |
287 ;;#### What a crock | |
288 (defun define-prefix-command (name &optional mapvar) | |
289 "Define COMMAND as a prefix command. | |
290 A new sparse keymap is stored as COMMAND's function definition. | |
291 If second optional argument MAPVAR is not specified, | |
292 COMMAND's value (as well as its function definition) is set to the keymap. | |
293 If a second optional argument MAPVAR is given and is not `t', | |
294 the map is stored as its value. | |
295 Regardless of MAPVAR, COMMAND's function-value is always set to the keymap." | |
296 (let ((map (make-sparse-keymap name))) | |
297 (fset name map) | |
298 (cond ((not mapvar) | |
299 (set name map)) | |
300 ((eq mapvar 't) | |
301 ) | |
302 (t | |
303 (set mapvar map))) | |
304 name)) | |
305 | |
306 | |
307 ;;; Converting vectors of events to a read-equivalent form. | |
308 ;;; This is used both by call-interactively (for the command history) | |
309 ;;; and by macros.el (for saving keyboard macros to a file). | |
310 | |
311 ;; #### why does (events-to-keys [backspace]) return "\C-h"? | |
312 ;; BTW, this function is a mess, and macros.el does *not* use it, in | |
313 ;; spite of the above comment. `format-kbd-macro' is used to save | |
314 ;; keyboard macros to a file. | |
315 (defun events-to-keys (events &optional no-mice) | |
316 "Given a vector of event objects, returns a vector of key descriptors, | |
317 or a string (if they all fit in the ASCII range). | |
318 Optional arg NO-MICE means that button events are not allowed." | |
319 (if (and events (symbolp events)) (setq events (vector events))) | |
320 (cond ((stringp events) | |
321 events) | |
322 ((not (vectorp events)) | |
323 (signal 'wrong-type-argument (list 'vectorp events))) | |
324 ((let* ((length (length events)) | |
325 (string (make-string length 0)) | |
326 c ce | |
327 (i 0)) | |
328 (while (< i length) | |
329 (setq ce (aref events i)) | |
330 (or (eventp ce) (setq ce (character-to-event ce))) | |
331 ;; Normalize `c' to `?c' and `(control k)' to `?\C-k' | |
332 ;; By passing t for the `allow-meta' arg we could get kbd macros | |
333 ;; with meta in them to translate to the string form instead of | |
334 ;; the list/symbol form; but I expect that would cause confusion, | |
335 ;; so let's use the list/symbol form whenever there's | |
336 ;; any ambiguity. | |
337 (setq c (event-to-character ce)) | |
338 (if (and c | |
339 (key-press-event-p ce)) | |
340 (cond ((symbolp (event-key ce)) | |
2828 | 341 (if (get (event-key ce) 'character-of-keysym) |
428 | 342 ;; Don't use a string for `backspace' and `tab' to |
343 ;; avoid that unpleasant little ambiguity. | |
344 (setq c nil))) | |
345 ((and (= (event-modifier-bits ce) 1) ;control | |
346 (integerp (event-key ce))) | |
347 (let* ((te (character-to-event c))) | |
348 (if (and (symbolp (event-key te)) | |
2828 | 349 (get (event-key te) 'character-of-keysym)) |
428 | 350 ;; Don't "normalize" (control i) to tab |
351 ;; to avoid the ambiguity in the other direction | |
352 (setq c nil)) | |
353 (deallocate-event te))))) | |
354 (if c | |
355 (aset string i c) | |
356 (setq i length string nil)) | |
357 (setq i (1+ i))) | |
358 string)) | |
359 (t | |
360 (let* ((length (length events)) | |
361 (new (copy-sequence events)) | |
362 event mods key | |
363 (i 0)) | |
364 (while (< i length) | |
365 (setq event (aref events i)) | |
366 (cond ((key-press-event-p event) | |
367 (setq mods (event-modifiers event) | |
368 key (event-key event)) | |
369 (if (numberp key) | |
370 (setq key (intern (make-string 1 key)))) | |
371 (aset new i (if mods | |
372 (nconc mods (cons key nil)) | |
373 key))) | |
374 ((misc-user-event-p event) | |
375 (aset new i (list 'menu-selection | |
376 (event-function event) | |
377 (event-object event)))) | |
378 ((or (button-press-event-p event) | |
379 (button-release-event-p event)) | |
380 (if no-mice | |
381 (error | |
382 "Mouse events can't be saved in keyboard macros.")) | |
383 (setq mods (event-modifiers event) | |
384 key (intern (format "button%d%s" | |
385 (event-button event) | |
386 (if (button-release-event-p event) | |
387 "up" "")))) | |
388 (aset new i (if mods | |
389 (nconc mods (cons key nil)) | |
390 key))) | |
391 ((or (and event (symbolp event)) | |
392 (and (consp event) (symbolp (car event)))) | |
393 (aset new i event)) | |
394 (t | |
395 (signal 'wrong-type-argument (list 'eventp event)))) | |
396 (setq i (1+ i))) | |
397 new)))) | |
398 | |
399 | |
400 (defun next-key-event () | |
401 "Return the next available keyboard event." | |
402 (let (event) | |
403 (while (not (key-press-event-p (setq event (next-command-event)))) | |
404 (dispatch-event event)) | |
405 event)) | |
406 | |
407 (defun key-sequence-list-description (keys) | |
408 "Convert a key sequence KEYS to the full [(modifiers... key)...] form. | |
502 | 409 Argument KEYS can be in any form accepted by `define-key' function. |
410 The output is always in a canonical form, meaning you can use this | |
411 function to determine if two key sequence specifications are equivalent | |
412 by comparing the respective outputs of this function using `equal'." | |
428 | 413 (let ((vec |
502 | 414 (cond ((vectorp keys) |
415 keys) | |
416 ((stringp keys) | |
417 (vconcat keys)) | |
418 (t | |
419 (vector keys))))) | |
5567
3bc58dc9d688
Replace #'flet by #'labels where appropriate, core code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5549
diff
changeset
|
420 (labels ((event-to-list (ev) |
3bc58dc9d688
Replace #'flet by #'labels where appropriate, core code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5549
diff
changeset
|
421 (append (event-modifiers ev) (list (event-key ev))))) |
5576
071b810ceb18
Declare labels as line where appropriate; use #'labels, not #'flet, tests.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5567
diff
changeset
|
422 (declare (inline event-to-list)) |
502 | 423 (mapvector |
424 #'(lambda (key) | |
425 (let* ((full-key | |
426 (cond ((key-press-event-p key) | |
427 (event-to-list key)) | |
428 ((characterp key) | |
429 (event-to-list (character-to-event key))) | |
430 ((listp key) | |
431 (copy-sequence key)) | |
432 (t | |
433 (list key)))) | |
434 (keysym (car (last full-key)))) | |
435 (if (characterp keysym) | |
436 (setcar (last full-key) (intern (char-to-string keysym)))) | |
437 full-key)) | |
438 vec)))) | |
428 | 439 |
440 | |
441 ;;; Support keyboard commands to turn on various modifiers. | |
442 | |
443 ;;; These functions -- which are not commands -- each add one modifier | |
444 ;;; to the following event. | |
445 | |
446 (defun event-apply-alt-modifier (ignore-prompt) | |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
447 (event-apply-modifiers '(alt))) |
428 | 448 (defun event-apply-super-modifier (ignore-prompt) |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
449 (event-apply-modifiers '(super))) |
428 | 450 (defun event-apply-hyper-modifier (ignore-prompt) |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
451 (event-apply-modifiers '(hyper))) |
428 | 452 (defun event-apply-shift-modifier (ignore-prompt) |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
453 (event-apply-modifiers '(shift))) |
428 | 454 (defun event-apply-control-modifier (ignore-prompt) |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
455 (event-apply-modifiers '(control))) |
428 | 456 (defun event-apply-meta-modifier (ignore-prompt) |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
457 (event-apply-modifiers '(meta))) |
428 | 458 |
459 ;;; #### `key-translate-map' is ignored for now. | |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
460 (defun event-apply-modifiers (list) |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
461 "Return the next key event, with a list of modifiers applied. |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
462 LIST describes the names of these modifier, a list of symbols. |
428 | 463 `function-key-map' is scanned for prefix bindings." |
464 (let (events binding) | |
465 ;; read keystrokes scanning `function-key-map' | |
466 (while (keymapp | |
467 (setq binding | |
468 (lookup-key | |
469 function-key-map | |
470 (vconcat | |
471 (setq events | |
472 (append events (list (next-key-event))))))))) | |
473 (if binding ; found a binding | |
474 (progn | |
475 ;; allow for several modifiers | |
476 (if (and (symbolp binding) (fboundp binding)) | |
477 (setq binding (funcall binding nil))) | |
478 (setq events (append binding nil)) | |
479 ;; put remaining keystrokes back into input queue | |
480 (setq unread-command-events | |
481 (mapcar 'character-to-event (cdr events)))) | |
482 (setq unread-command-events (cdr events))) | |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
483 ;; add modifiers LIST to the first keystroke or event |
428 | 484 (vector |
5549
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
485 (append list |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
486 (set-difference (aref (key-sequence-list-description (car events)) |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
487 0) |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
488 list :stable t))))) |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
489 |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
490 (defun event-apply-modifier (symbol) |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
491 "Return the next key event, with a single modifier applied. |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
492 See `event-apply-modifiers'." |
493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5529
diff
changeset
|
493 (event-apply-modifiers (list symbol))) |
428 | 494 |
495 (defun synthesize-keysym (ignore-prompt) | |
496 "Read a sequence of keys, and returned the corresponding key symbol. | |
497 The characters must be from the [-_a-zA-Z0-9]. Reading is terminated | |
498 by RET (which is discarded)." | |
499 (let ((continuep t) | |
500 event char list) | |
501 (while continuep | |
502 (setq event (next-key-event)) | |
503 (cond ((and (setq char (event-to-character event)) | |
504 (or (memq char '(?- ?_)) | |
505 (eq ?w (char-syntax char (standard-syntax-table))))) | |
506 ;; Advance a character. | |
507 (push char list)) | |
508 ((or (memq char '(?\r ?\n)) | |
509 (memq (event-key event) '(return newline))) | |
510 ;; Legal termination. | |
511 (setq continuep nil)) | |
512 (char | |
513 ;; Illegal character. | |
514 (error "Illegal character in keysym: %c" char)) | |
515 (t | |
516 ;; Illegal event. | |
517 (error "Event has no character equivalent: %s" event)))) | |
518 (vector (intern (concat "" (nreverse list)))))) | |
519 | |
5529
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
520 (define-key function-key-map-parent [?\C-x ?@ ?h] 'event-apply-hyper-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
521 (define-key function-key-map-parent [?\C-x ?@ ?s] 'event-apply-super-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
522 (define-key function-key-map-parent [?\C-x ?@ ?m] 'event-apply-meta-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
523 (define-key function-key-map-parent [?\C-x ?@ ?S] 'event-apply-shift-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
524 (define-key function-key-map-parent [?\C-x ?@ ?c] 'event-apply-control-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
525 (define-key function-key-map-parent [?\C-x ?@ ?a] 'event-apply-alt-modifier) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
526 (define-key function-key-map-parent [?\C-x ?@ ?k] 'synthesize-keysym) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
527 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
528 ;; The autoloads for the compose map, and their bindings in |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
529 ;; function-key-map-parent are used by GTK as well as X11. And Julian |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
530 ;; Bradfield, at least, uses x-compose on the TTY, it's reasonable to make |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
531 ;; them generally available. |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
532 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
533 (loop for map in '(compose-acute-map compose-breve-map compose-caron-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
534 compose-cedilla-map compose-circumflex-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
535 compose-diaeresis-map compose-dot-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
536 compose-doubleacute-map compose-grave-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
537 compose-hook-map compose-horn-map compose-macron-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
538 compose-map compose-ogonek-map compose-ring-map |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
539 compose-stroke-map compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
540 do (autoload map "x-compose" nil t 'keymap)) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
541 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
542 (loop |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
543 for (key map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
544 ;; The dead keys might really be called just about anything, depending |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
545 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
546 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
547 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_". |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
548 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_". Go |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
549 ;; figure. |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
550 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
551 ;; Presumably if someone is running OpenWindows, they won't be using the |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
552 ;; DEC or HP keysyms, but if they are defined then that is possible, so |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
553 ;; in that case we accept them all. |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
554 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
555 ;; If things seem not to be working, you might want to check your |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
556 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
557 ;; mixed up view of what these keys should be called. |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
558 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
559 ;; Canonical names: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
560 in '((acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
561 (grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
562 (cedilla compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
563 (diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
564 (circumflex compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
565 (tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
566 (degree compose-ring-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
567 (multi-key compose-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
568 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
569 ;; Sun according to MIT: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
570 (SunFA_Acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
571 (SunFA_Grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
572 (SunFA_Cedilla compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
573 (SunFA_Diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
574 (SunFA_Circum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
575 (SunFA_Tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
576 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
577 ;; Sun according to OpenWindows 2: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
578 (Dead_Grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
579 (Dead_Circum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
580 (Dead_Tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
581 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
582 ;; Sun according to OpenWindows 3: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
583 (SunXK_FA_Acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
584 (SunXK_FA_Grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
585 (SunXK_FA_Cedilla compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
586 (SunXK_FA_Diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
587 (SunXK_FA_Circum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
588 (SunXK_FA_Tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
589 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
590 ;; DEC according to MIT: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
591 (Dacute_accent compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
592 (Dgrave_accent compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
593 (Dcedilla_accent compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
594 (Dcircumflex_accent compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
595 (Dtilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
596 (Dring_accent compose-ring-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
597 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
598 ;; DEC according to OpenWindows 3: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
599 (DXK_acute_accent compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
600 (DXK_grave_accent compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
601 (DXK_cedilla_accent compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
602 (DXK_circumflex_accent compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
603 (DXK_tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
604 (DXK_ring_accent compose-ring-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
605 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
606 ;; HP according to MIT: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
607 (hpmute_acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
608 (hpmute_grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
609 (hpmute_diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
610 (hpmute_asciicircum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
611 (hpmute_asciitilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
612 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
613 ;; Empirically discovered on Linux XFree86 MetroX: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
614 (usldead_acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
615 (usldead_grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
616 (usldead_diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
617 (usldead_asciicircum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
618 (usldead_asciitilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
619 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
620 ;; HP according to OpenWindows 3: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
621 (hpXK_mute_acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
622 (hpXK_mute_grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
623 (hpXK_mute_diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
624 (hpXK_mute_asciicircum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
625 (hpXK_mute_asciitilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
626 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
627 ;; HP according to HP-UX 8.0: |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
628 (XK_mute_acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
629 (XK_mute_grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
630 (XK_mute_diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
631 (XK_mute_asciicircum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
632 (XK_mute_asciitilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
633 |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
634 ;; XFree86 uses lower case and an underscore. XEmacs converts the |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
635 ;; underscore to a hyphen in x_keysym_to_emacs_keysym because the |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
636 ;; keysym is in the "Keyboard" character set, which seems a very |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
637 ;; arbitrary approach. |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
638 (dead-acute compose-acute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
639 (dead-grave compose-grave-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
640 (dead-cedilla compose-cedilla-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
641 (dead-diaeresis compose-diaeresis-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
642 (dead-circum compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
643 (dead-circumflex compose-circumflex-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
644 (dead-tilde compose-tilde-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
645 (dead-abovering compose-ring-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
646 (dead-caron compose-caron-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
647 (dead-macron compose-macron-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
648 (dead-breve compose-breve-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
649 (dead-abovedot compose-dot-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
650 (dead-doubleacute compose-doubleacute-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
651 (dead-ogonek compose-ogonek-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
652 (dead-hook compose-hook-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
653 (dead-horn compose-horn-map) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
654 (dead-stroke compose-stroke-map)) |
3d1f8f0e690f
Add `function-key-map-parent', for non-console-specific `function-key-map' bindings
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
655 do (define-key function-key-map-parent (vector key) map)) |
428 | 656 |
657 ;;; keymap.el ends here |