Mercurial > emacs
comparison src/keyboard.c @ 83325:9e41c80c6389
Work around nondeterministic binding of terminal-local variables. (Fixes national character input on ttys.)
* src/data.c (Fterminal_local_value, Fset_terminal_local_value): New functions.
(syms_of_data): Defsubr them.
* lisp/international/encoded-kb.el (encoded-kbd-setup-keymap): Add keymap
parameter. Use it instead of changing key-translation-map directly.
(encoded-kbd-setup-display): Use terminal-local-value and
set-terminal-local-value to access key-translation-map. Remove
debugging messages.
* lisp/international/mule.el (keyboard-coding-system): Test for
encoded-kbd-setup-display, not encoded-kbd-mode.
* src/keyboard.c (syms_of_keyboard): Expand docs of terminal-local
variables to warn about their random bindings.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-365
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 27 Jun 2005 02:08:34 +0000 |
parents | eed3bdcacf4d |
children | 6c13700d1c13 |
comparison
equal
deleted
inserted
replaced
83324:eed3bdcacf4d | 83325:9e41c80c6389 |
---|---|
11245 read an event that told it to exit, and it did so and unread that event. | 11245 read an event that told it to exit, and it did so and unread that event. |
11246 In other words, the present command is the event that made the previous | 11246 In other words, the present command is the event that made the previous |
11247 command exit. | 11247 command exit. |
11248 | 11248 |
11249 The value `kill-region' is special; it means that the previous command | 11249 The value `kill-region' is special; it means that the previous command |
11250 was a kill command. */); | 11250 was a kill command. |
11251 | |
11252 `last-command' has a separate binding for each display device. | |
11253 See Info node `(elisp)Multiple displays'. */); | |
11251 | 11254 |
11252 DEFVAR_KBOARD ("real-last-command", Vreal_last_command, | 11255 DEFVAR_KBOARD ("real-last-command", Vreal_last_command, |
11253 doc: /* Same as `last-command', but never altered by Lisp code. */); | 11256 doc: /* Same as `last-command', but never altered by Lisp code. */); |
11254 | 11257 |
11255 DEFVAR_LISP ("this-command", &Vthis_command, | 11258 DEFVAR_LISP ("this-command", &Vthis_command, |
11453 If this variable is non-nil, it is used as a keymap instead of the | 11456 If this variable is non-nil, it is used as a keymap instead of the |
11454 buffer's local map, and the minor mode keymaps and text property keymaps. | 11457 buffer's local map, and the minor mode keymaps and text property keymaps. |
11455 It also replaces `overriding-local-map'. | 11458 It also replaces `overriding-local-map'. |
11456 | 11459 |
11457 This variable is intended to let commands such as `universal-argument' | 11460 This variable is intended to let commands such as `universal-argument' |
11458 set up a different keymap for reading the next command. */); | 11461 set up a different keymap for reading the next command. |
11462 | |
11463 `overriding-terminal-local-map' has a separate binding for each display device. | |
11464 See Info node `(elisp)Multiple displays'. */); | |
11459 | 11465 |
11460 DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map, | 11466 DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map, |
11461 doc: /* Keymap that overrides all other local keymaps. | 11467 doc: /* Keymap that overrides all other local keymaps. |
11462 If this variable is non-nil, it is used as a keymap--replacing the | 11468 If this variable is non-nil, it is used as a keymap--replacing the |
11463 buffer's local map, the minor mode keymaps, and char property keymaps. */); | 11469 buffer's local map, the minor mode keymaps, and char property keymaps. */); |
11478 | 11484 |
11479 DEFVAR_KBOARD ("system-key-alist", Vsystem_key_alist, | 11485 DEFVAR_KBOARD ("system-key-alist", Vsystem_key_alist, |
11480 doc: /* Alist of system-specific X windows key symbols. | 11486 doc: /* Alist of system-specific X windows key symbols. |
11481 Each element should have the form (N . SYMBOL) where N is the | 11487 Each element should have the form (N . SYMBOL) where N is the |
11482 numeric keysym code (sans the \"system-specific\" bit 1<<28) | 11488 numeric keysym code (sans the \"system-specific\" bit 1<<28) |
11483 and SYMBOL is its name. */); | 11489 and SYMBOL is its name. |
11490 | |
11491 `system-key-alist' has a separate binding for each display device. | |
11492 See Info node `(elisp)Multiple displays'. | |
11493 | |
11494 Note that the currently selected frame has very little to do with | |
11495 which binding of this variable is active at any given moment. If you | |
11496 need set or get the binding on a specific display, use | |
11497 `terminal-local-value' and `set-terminal-local-value'. */); | |
11484 | 11498 |
11485 DEFVAR_KBOARD ("function-key-map", Vfunction_key_map, | 11499 DEFVAR_KBOARD ("function-key-map", Vfunction_key_map, |
11486 doc: /* Keymap mapping ASCII function key sequences onto their preferred forms. | 11500 doc: /* Keymap mapping ASCII function key sequences onto their preferred forms. |
11487 This allows Emacs to recognize function keys sent from ASCII | 11501 This allows Emacs to recognize function keys sent from ASCII |
11488 terminals at any point in a key sequence. | 11502 terminals at any point in a key sequence. |
11501 Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing | 11515 Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing |
11502 `C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix | 11516 `C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix |
11503 key, typing `ESC O P x' would return [f1 x]. | 11517 key, typing `ESC O P x' would return [f1 x]. |
11504 | 11518 |
11505 `function-key-map' has a separate binding for each display device. | 11519 `function-key-map' has a separate binding for each display device. |
11506 See Info node `(elisp)Multiple displays'. */); | 11520 See Info node `(elisp)Multiple displays'. |
11521 | |
11522 Note that the currently selected frame has very little to do with | |
11523 which binding of this variable is active at any given moment. If you | |
11524 need set or get the binding on a specific display, use | |
11525 `terminal-local-value' and `set-terminal-local-value'. */); | |
11507 | 11526 |
11508 DEFVAR_KBOARD ("key-translation-map", Vkey_translation_map, | 11527 DEFVAR_KBOARD ("key-translation-map", Vkey_translation_map, |
11509 doc: /* Keymap of key translations that can override keymaps. | 11528 doc: /* Keymap of key translations that can override keymaps. |
11510 This keymap works like `function-key-map', but comes after that, | 11529 This keymap works like `function-key-map', but comes after that, |
11511 and its non-prefix bindings override ordinary bindings. | 11530 and its non-prefix bindings override ordinary bindings. |
11512 | 11531 |
11513 `key-translation-map' has a separate binding for each display device. | 11532 `key-translation-map' has a separate binding for each display device. |
11514 (See Info node `(elisp)Multiple displays'.) If you need to set a key | 11533 (See Info node `(elisp)Multiple displays'.) If you need to set a key |
11515 translation on all devices, change `global-key-translation-map' instead. */); | 11534 translation on all devices, change `global-key-translation-map' instead. |
11535 | |
11536 Note that the currently selected frame has very little to do with | |
11537 which binding of this variable is active at any given moment. If you | |
11538 need set or get the binding on a specific display, use | |
11539 `terminal-local-value' and `set-terminal-local-value'. */); | |
11516 | 11540 |
11517 DEFVAR_LISP ("global-key-translation-map", &Vglobal_key_translation_map, | 11541 DEFVAR_LISP ("global-key-translation-map", &Vglobal_key_translation_map, |
11518 doc: /* The parent keymap of all terminal-local `key-translation-map' instances. | 11542 doc: /* The parent keymap of all terminal-local `key-translation-map' instances. |
11519 Key translations that are not specific to a display device flavour | 11543 Key translations that are not specific to a display device flavour |
11520 should go here. */); | 11544 should go here. */); |