From c40bb1ba81a5df164f0b9b61e3480c55808717b7 Mon Sep 17 00:00:00 2001 From: Karoly Lorentey Date: Sat, 29 Oct 2005 11:50:12 +0000 Subject: Fix semantics of terminal-local variables. Remove `terminal-local-value' hack. * src/data.c (do_symval_forwarding, store_symval_forwarding) (find_symbol_value): Use the selected frame's keyboard, not current_kboard. * src/data.c (Fterminal_local_value, Fset_terminal_local_value): Disable these functions. * src/data.c (syms_of_data): Don't defsubr them. * lisp/edmacro.el (edmacro-format-keys): Remove terminal-local-value calls. * lisp/emulation/cua-base.el (cua--pre-command-handler-1): Ditto. * lisp/international/encoded-kb.el (encoded-kbd-setup-display): Ditto. * lisp/isearch.el (isearch-other-meta-char): Ditto. * lisp/obsolete/keyswap.el (the-table): Ditto. * lisp/simple.el (normal-erase-is-backspace-mode): Ditto. * lisp/subr.el (keyboard-translate, read-quoted-char): Ditto. * lisp/term/AT386.el (terminal-init-AT386): Ditto. * lisp/term/internal.el: Ditto. * lisp/term/iris-ansi.el (terminal-init-iris-ansi): Ditto. * lisp/term/lk201.el (terminal-init-lk201): Ditto. * lisp/term/mac-win.el: Ditto. * lisp/term/news.el (terminal-init-news): Ditto. * lisp/term/rxvt.el (terminal-init-rxvt): Ditto. * lisp/term/sun.el (terminal-init-sun): Ditto. * lisp/term/tvi970.el (terminal-init-tvi970): Ditto. * lisp/term/vt200.el (terminal-init-vt200): Ditto. * lisp/term/vt201.el (terminal-init-vt201): Ditto. * lisp/term/vt220.el (terminal-init-vt220): Ditto. * lisp/term/vt240.el (terminal-init-vt240): Ditto. * lisp/term/vt300.el (terminal-init-vt300): Ditto. * lisp/term/vt320.el (terminal-init-vt320): Ditto. * lisp/term/vt400.el (terminal-init-vt400): Ditto. * lisp/term/vt420.el (terminal-init-vt420): Ditto. * lisp/term/wyse50.el (terminal-init-wyse50): Ditto. * lisp/term/x-win.el (x-setup-function-keys): Ditto. * lisp/term/xterm.el (terminal-init-xterm): Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-434 --- src/data.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index e5e77885da4..cb6c7d2c85c 100644 --- a/src/data.c +++ b/src/data.c @@ -891,7 +891,18 @@ do_symval_forwarding (valcontents) case Lisp_Misc_Kboard_Objfwd: offset = XKBOARD_OBJFWD (valcontents)->offset; - return *(Lisp_Object *)(offset + (char *)current_kboard); + /* We used to simply use current_kboard here, but from Lisp + code, it's value is often unexpected. It seems nicer to + allow constructions like this to work as intuitively expected: + + (with-selected-frame frame + (define-key local-function-map "\eOP" [f1])) + + On the other hand, this affects the semantics of + last-command and real-last-command, and people may rely on + that. I took a quick look at the Lisp codebase, and I + don't think anything will break. --lorentey */ + return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ())); } return valcontents; } @@ -979,7 +990,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) case Lisp_Misc_Kboard_Objfwd: { - char *base = (char *) current_kboard; + char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ()); char *p = base + XKBOARD_OBJFWD (valcontents)->offset; *(Lisp_Object *) p = newval; } @@ -1125,7 +1136,7 @@ find_symbol_value (symbol) case Lisp_Misc_Kboard_Objfwd: return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset - + (char *)current_kboard); + + (char *)FRAME_KBOARD (SELECTED_FRAME ())); } } @@ -1878,6 +1889,9 @@ If the current binding is global (the default), the value is nil. */) return Qnil; } +/* This code is disabled now that we use the selected frame to return + keyboard-local-values. */ +#if 0 extern struct device *get_device P_ ((Lisp_Object display, int)); DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0, @@ -1918,6 +1932,7 @@ selected frame's display device). */) pop_kboard (); return result; } +#endif /* Find the function at the end of a chain of symbol function indirections. */ @@ -3369,8 +3384,10 @@ syms_of_data () defsubr (&Slocal_variable_p); defsubr (&Slocal_variable_if_set_p); defsubr (&Svariable_binding_locus); +#if 0 /* XXX Remove this. --lorentey */ defsubr (&Sterminal_local_value); defsubr (&Sset_terminal_local_value); +#endif defsubr (&Saref); defsubr (&Saset); defsubr (&Snumber_to_string); -- cgit v1.2.1