aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-26 21:06:46 +0000
committerKaroly Lorentey2005-06-26 21:06:46 +0000
commit4ea81208d4c43df774e540a603be8f68cb470466 (patch)
tree27b139cd84bc56386476cf9af68225b44de136b3 /src
parent1fb8c4adcbf2d3c833b3e6bbb86211109085fa86 (diff)
downloademacs-4ea81208d4c43df774e540a603be8f68cb470466.tar.gz
emacs-4ea81208d4c43df774e540a603be8f68cb470466.zip
Change key-translation-map to be terminal-local.
* src/keymap.c (Vkey_translation_map): Remove. (syms_of_keymap): Remove DEFVAR for key-translation-map. (Fdescribe_buffer_bindings): Update for terminal-local key-translation-map. * src/keyboard.h (kboard): Add Vkey_translation_map field. (Vglobal_key_translation_map): Declare. * src/keyboard.c (Vglobal_key_translation_map): New variable. (syms_of_keyboard): DEFVAR it and Vkey_translation_map. (mark_kboards): Mark key-translation-map. (read_key_sequence): Update for terminal-local key-translation-map. * src/emacs.c (main): Call syms_of_keymap before syms_of_keyboard. * lisp/term/mac-win.el (mac-handle-language-change): Use global-key-translation-map instead of key-translation-map. * lisp/obsolete/iso-acc.el (iso-accents-customize): Ditto. * lisp/international/iso-transl.el (iso-transl-ctl-x-8-map): Ditto. * lisp/double.el (double-setup): Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-359
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c5
-rw-r--r--src/keyboard.c27
-rw-r--r--src/keyboard.h6
-rw-r--r--src/keymap.c13
4 files changed, 34 insertions, 17 deletions
diff --git a/src/emacs.c b/src/emacs.c
index a8c64115098..c26dc9de9e3 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1303,6 +1303,9 @@ main (argc, argv
1303 faces, and the face implementation uses some symbols as 1303 faces, and the face implementation uses some symbols as
1304 face names. */ 1304 face names. */
1305 syms_of_xfaces (); 1305 syms_of_xfaces ();
1306 /* XXX syms_of_keyboard uses some symbols in keymap.c. It would
1307 be better to arrange things not to have this dependency. */
1308 syms_of_keymap ();
1306 /* Call syms_of_keyboard before init_window_once because 1309 /* Call syms_of_keyboard before init_window_once because
1307 keyboard sets up symbols that include some face names that 1310 keyboard sets up symbols that include some face names that
1308 the X support will want to use. This can happen when 1311 the X support will want to use. This can happen when
@@ -1574,7 +1577,7 @@ main (argc, argv
1574#endif /* CLASH_DETECTION */ 1577#endif /* CLASH_DETECTION */
1575 syms_of_indent (); 1578 syms_of_indent ();
1576 syms_of_insdel (); 1579 syms_of_insdel ();
1577 syms_of_keymap (); 1580 /* syms_of_keymap (); */
1578 syms_of_macros (); 1581 syms_of_macros ();
1579 syms_of_marker (); 1582 syms_of_marker ();
1580 syms_of_minibuf (); 1583 syms_of_minibuf ();
diff --git a/src/keyboard.c b/src/keyboard.c
index 016582d8d20..6fb95f5d815 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -417,10 +417,6 @@ Lisp_Object Vtop_level;
417/* User-supplied table to translate input characters. */ 417/* User-supplied table to translate input characters. */
418Lisp_Object Vkeyboard_translate_table; 418Lisp_Object Vkeyboard_translate_table;
419 419
420/* Another keymap that maps key sequences into key sequences.
421 This one takes precedence over ordinary definitions. */
422extern Lisp_Object Vkey_translation_map;
423
424/* If non-nil, this implements the current input method. */ 420/* If non-nil, this implements the current input method. */
425Lisp_Object Vinput_method_function; 421Lisp_Object Vinput_method_function;
426Lisp_Object Qinput_method_function; 422Lisp_Object Qinput_method_function;
@@ -444,6 +440,9 @@ Lisp_Object Qpre_command_hook, Vpre_command_hook;
444Lisp_Object Qpost_command_hook, Vpost_command_hook; 440Lisp_Object Qpost_command_hook, Vpost_command_hook;
445Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; 441Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal;
446 442
443/* Parent keymap of terminal-local key-translation-map instances. */
444Lisp_Object Vglobal_key_translation_map;
445
447/* List of deferred actions to be performed at a later time. 446/* List of deferred actions to be performed at a later time.
448 The precise format isn't relevant here; we just check whether it is nil. */ 447 The precise format isn't relevant here; we just check whether it is nil. */
449Lisp_Object Vdeferred_action_list; 448Lisp_Object Vdeferred_action_list;
@@ -8652,7 +8651,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8652 8651
8653 delayed_switch_frame = Qnil; 8652 delayed_switch_frame = Qnil;
8654 fkey.map = fkey.parent = current_kboard->Vfunction_key_map; 8653 fkey.map = fkey.parent = current_kboard->Vfunction_key_map;
8655 keytran.map = keytran.parent = Vkey_translation_map; 8654 keytran.map = keytran.parent = current_kboard->Vkey_translation_map;
8656 /* If there is no translation-map, turn off scanning. */ 8655 /* If there is no translation-map, turn off scanning. */
8657 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; 8656 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1;
8658 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; 8657 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
@@ -10766,6 +10765,8 @@ init_kboard (kb)
10766 kb->Vsystem_key_alist = Qnil; 10765 kb->Vsystem_key_alist = Qnil;
10767 kb->system_key_syms = Qnil; 10766 kb->system_key_syms = Qnil;
10768 kb->Vfunction_key_map = Fmake_sparse_keymap (Qnil); 10767 kb->Vfunction_key_map = Fmake_sparse_keymap (Qnil);
10768 kb->Vkey_translation_map = Fmake_sparse_keymap (Qnil);
10769 Fset_keymap_parent (kb->Vkey_translation_map, Vglobal_key_translation_map);
10769 kb->Vdefault_minibuffer_frame = Qnil; 10770 kb->Vdefault_minibuffer_frame = Qnil;
10770} 10771}
10771 10772
@@ -11488,6 +11489,21 @@ key, typing `ESC O P x' would return [f1 x].
11488`function-key-map' has a separate binding for each display device. 11489`function-key-map' has a separate binding for each display device.
11489See Info node `(elisp)Multiple displays'. */); 11490See Info node `(elisp)Multiple displays'. */);
11490 11491
11492 DEFVAR_KBOARD ("key-translation-map", Vkey_translation_map,
11493 doc: /* Keymap of key translations that can override keymaps.
11494This keymap works like `function-key-map', but comes after that,
11495and its non-prefix bindings override ordinary bindings.
11496
11497`key-translation-map' has a separate binding for each display device.
11498(See Info node `(elisp)Multiple displays'.) If you need to set a key
11499translation on all devices, change `global-key-translation-map' instead. */);
11500
11501 DEFVAR_LISP ("global-key-translation-map", &Vglobal_key_translation_map,
11502 doc: /* The parent keymap of all terminal-local `key-translation-map' instances.
11503Key translations that are not specific to a display device flavour
11504should go here. */);
11505 Vglobal_key_translation_map = Fmake_sparse_keymap (Qnil);
11506
11491 DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list, 11507 DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list,
11492 doc: /* List of deferred actions to be performed at a later time. 11508 doc: /* List of deferred actions to be performed at a later time.
11493The precise format isn't relevant here; we just check whether it is nil. */); 11509The precise format isn't relevant here; we just check whether it is nil. */);
@@ -11652,6 +11668,7 @@ mark_kboards ()
11652 mark_object (kb->Vsystem_key_alist); 11668 mark_object (kb->Vsystem_key_alist);
11653 mark_object (kb->system_key_syms); 11669 mark_object (kb->system_key_syms);
11654 mark_object (kb->Vfunction_key_map); 11670 mark_object (kb->Vfunction_key_map);
11671 mark_object (kb->Vkey_translation_map);
11655 mark_object (kb->Vdefault_minibuffer_frame); 11672 mark_object (kb->Vdefault_minibuffer_frame);
11656 mark_object (kb->echo_string); 11673 mark_object (kb->echo_string);
11657 } 11674 }
diff --git a/src/keyboard.h b/src/keyboard.h
index d0d93603379..de2254952b4 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -125,6 +125,9 @@ struct kboard
125 files. See the DEFVAR for more documentation. */ 125 files. See the DEFVAR for more documentation. */
126 Lisp_Object Vfunction_key_map; 126 Lisp_Object Vfunction_key_map;
127 127
128 /* Keymap of key translations that can override keymaps. */
129 Lisp_Object Vkey_translation_map;
130
128 /* Minibufferless frames on this display use this frame's minibuffer. */ 131 /* Minibufferless frames on this display use this frame's minibuffer. */
129 Lisp_Object Vdefault_minibuffer_frame; 132 Lisp_Object Vdefault_minibuffer_frame;
130 133
@@ -301,6 +304,9 @@ extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *));
301/* User-supplied string to translate input characters through. */ 304/* User-supplied string to translate input characters through. */
302extern Lisp_Object Vkeyboard_translate_table; 305extern Lisp_Object Vkeyboard_translate_table;
303 306
307/* Parent keymap of terminal-local key-translation-map instances. */
308extern Lisp_Object Vglobal_key_translation_map;
309
304 310
305extern int parse_menu_item P_ ((Lisp_Object, int, int)); 311extern int parse_menu_item P_ ((Lisp_Object, int, int));
306 312
diff --git a/src/keymap.c b/src/keymap.c
index 1734ac1baa9..a8d197208b7 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -79,9 +79,6 @@ Lisp_Object Vminor_mode_overriding_map_alist;
79/* List of emulation mode keymap alists. */ 79/* List of emulation mode keymap alists. */
80Lisp_Object Vemulation_mode_map_alists; 80Lisp_Object Vemulation_mode_map_alists;
81 81
82/* Keymap mapping ASCII function key sequences onto their preferred forms. */
83Lisp_Object Vkey_translation_map;
84
85/* A list of all commands given new bindings since a certain time 82/* A list of all commands given new bindings since a certain time
86 when nil was stored here. 83 when nil was stored here.
87 This is used to speed up recomputation of menu key equivalents 84 This is used to speed up recomputation of menu key equivalents
@@ -2844,8 +2841,8 @@ You type Translation\n\
2844 insert ("\n", 1); 2841 insert ("\n", 1);
2845 } 2842 }
2846 2843
2847 if (!NILP (Vkey_translation_map)) 2844 if (!NILP (current_kboard->Vkey_translation_map))
2848 describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, 2845 describe_map_tree (current_kboard->Vkey_translation_map, 0, Qnil, prefix,
2849 "Key translations", nomenu, 1, 0, 0); 2846 "Key translations", nomenu, 1, 0, 0);
2850 2847
2851 2848
@@ -3797,12 +3794,6 @@ the same way. The "active" keymaps in each alist are used before
3797`minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */); 3794`minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */);
3798 Vemulation_mode_map_alists = Qnil; 3795 Vemulation_mode_map_alists = Qnil;
3799 3796
3800 DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
3801 doc: /* Keymap of key translations that can override keymaps.
3802This keymap works like `function-key-map', but comes after that,
3803and its non-prefix bindings override ordinary bindings. */);
3804 Vkey_translation_map = Qnil;
3805
3806 staticpro (&Vmouse_events); 3797 staticpro (&Vmouse_events);
3807 Vmouse_events = Fcons (intern ("menu-bar"), 3798 Vmouse_events = Fcons (intern ("menu-bar"),
3808 Fcons (intern ("tool-bar"), 3799 Fcons (intern ("tool-bar"),