aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-27 02:08:34 +0000
committerKaroly Lorentey2005-06-27 02:08:34 +0000
commit2a42d44084e05d60f28a51609aa7c12fb547fffe (patch)
treecdaa000810271e1898e8adfeb9b7760710c9547d /src/data.c
parente589efa546443ad7a61ec3867b46cda884d22de5 (diff)
downloademacs-2a42d44084e05d60f28a51609aa7c12fb547fffe.tar.gz
emacs-2a42d44084e05d60f28a51609aa7c12fb547fffe.zip
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
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index 7bbb45ae043..c74d3c076c3 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1875,6 +1875,44 @@ If the current binding is global (the default), the value is nil. */)
1875 1875
1876 return Qnil; 1876 return Qnil;
1877} 1877}
1878
1879extern struct display *get_display P_ ((Lisp_Object display, int));
1880
1881DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
1882 doc: /* Return the terminal-local value of SYMBOL on DISPLAY.
1883If SYMBOL is not a terminal-local variable, then return its normal
1884value, like `symbol-value'.
1885
1886DISPLAY may be a display, a frame, or nil (meaning the selected
1887frame's display). */)
1888 (symbol, display)
1889 Lisp_Object symbol;
1890 Lisp_Object display;
1891{
1892 Lisp_Object result;
1893 struct display *d = get_display (display, 1);
1894 push_display_kboard (d);
1895 result = Fsymbol_value (symbol);
1896 pop_frame_kboard ();
1897 return result;
1898}
1899
1900DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
1901 doc: /* Set the terminal-local binding of SYMBOL on DISPLAY to VALUE.
1902If VARIABLE is not a terminal-local variable, then set its normal
1903binding, like `set'. */)
1904 (symbol, display, value)
1905 Lisp_Object symbol;
1906 Lisp_Object display;
1907 Lisp_Object value;
1908{
1909 Lisp_Object result;
1910 struct display *d = get_display (display, 1);
1911 push_display_kboard (d);
1912 result = Fset (symbol, value);
1913 pop_frame_kboard ();
1914 return result;
1915}
1878 1916
1879/* Find the function at the end of a chain of symbol function indirections. */ 1917/* Find the function at the end of a chain of symbol function indirections. */
1880 1918
@@ -3326,6 +3364,8 @@ syms_of_data ()
3326 defsubr (&Slocal_variable_p); 3364 defsubr (&Slocal_variable_p);
3327 defsubr (&Slocal_variable_if_set_p); 3365 defsubr (&Slocal_variable_if_set_p);
3328 defsubr (&Svariable_binding_locus); 3366 defsubr (&Svariable_binding_locus);
3367 defsubr (&Sterminal_local_value);
3368 defsubr (&Sset_terminal_local_value);
3329 defsubr (&Saref); 3369 defsubr (&Saref);
3330 defsubr (&Saset); 3370 defsubr (&Saset);
3331 defsubr (&Snumber_to_string); 3371 defsubr (&Snumber_to_string);