* lisp/subr.el (keyboard-translate): Use `terminal-local-value' to access `keyboard-translate-table'.
* lisp/obsolete/keyswap.el: Ditto.
* src/keyboard.c (Vkeyboard_translate_table): Moved to struct kboard.
* src/keyboard.h (Vkeyboard_translate_table): Moved to struct kboard.
* src/keyboard.c (read_char): Use current_kboard to access Vkeyboard_translate_table.
* src/keymap.c (Fdescribe_buffer_bindings): Ditto.
* src/keyboard.c (init_kboard): Initialize Vkeyboard_translate_table.
* src/keyboard.c (syms_of_keyboard): Use DEFVAR_KBOARD to define
Vkeyboard_translate_table. Update doc strings.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-431
`last-command', but SELECTED_FRAME()->display->kboard to get the
value of `function-key-map'.
-** I think keyboard-translate-table should be made terminal-local.
-
** The single-keyboard mode of MULTI_KBOARD is extremely confusing
sometimes; Emacs does not respond to stimuli from other keyboards.
At least a beep or a message would be important, if the single-mode
that's why raw terminal support is broken again. I really do need
to understand input.)
+** flow-ctrl.el must be updated.
+
** Fix stuff_char for multi-tty. Doesn't seem to be of high priority.
DIARY OF CHANGES
(Fixed in patch-427.)
+-- I think keyboard-translate-table should be made terminal-local.
+
+ (Done in patch-431.)
+
;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
;; Swap ^H and DEL
(aset the-table ?\177 ?\^h)
(aset the-table ?\^h ?\177)
- (setq keyboard-translate-table the-table))
+ (setq (terminal-local-value 'keyboard-translate-table) the-table))
;;; arch-tag: 67cf7009-e23e-421c-9648-078e7277297c
;;; keyswap.el ends here
(t
(if (terminal-parameter nil 'normal-erase-is-backspace)
(progn
- ;; XXX This should be terminal-local -- lorentey
(keyboard-translate ?\C-h ?\C-?)
(keyboard-translate ?\C-? ?\C-d))
(keyboard-translate ?\C-h ?\C-h)
"Translate character FROM to TO at a low level.
This function creates a `keyboard-translate-table' if necessary
and then modifies one entry in it."
- (or (char-table-p keyboard-translate-table)
- (setq keyboard-translate-table
- (make-char-table 'keyboard-translate-table nil)))
- (aset keyboard-translate-table from to))
+ (let (t (terminal-local-value 'keyboard-translate-table))
+ (or (char-table-p t)
+ (setq t (make-char-table 'keyboard-translate-table nil)))
+ (aset t from to)))
\f
;;;; The global keymap tree.
/* Form to evaluate (if non-nil) when Emacs is started. */
Lisp_Object Vtop_level;
-/* User-supplied table to translate input characters. */
-Lisp_Object Vkeyboard_translate_table;
-
/* If non-nil, this implements the current input method. */
Lisp_Object Vinput_method_function;
Lisp_Object Qinput_method_function;
if (XINT (c) == -1)
goto exit;
- if ((STRINGP (Vkeyboard_translate_table)
- && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
- || (VECTORP (Vkeyboard_translate_table)
- && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
- || (CHAR_TABLE_P (Vkeyboard_translate_table)
+ if ((STRINGP (current_kboard->Vkeyboard_translate_table)
+ && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
+ || (VECTORP (current_kboard->Vkeyboard_translate_table)
+ && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
+ || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table)
&& CHAR_VALID_P (XINT (c), 0)))
{
Lisp_Object d;
- d = Faref (Vkeyboard_translate_table, c);
+ d = Faref (current_kboard->Vkeyboard_translate_table, c);
/* nil in keyboard-translate-table means no translation. */
if (!NILP (d))
c = d;
kb->Voverriding_terminal_local_map = Qnil;
kb->Vlast_command = Qnil;
kb->Vreal_last_command = Qnil;
+ kb->Vkeyboard_translate_table = Qnil;
kb->Vprefix_arg = Qnil;
kb->Vlast_prefix_arg = Qnil;
kb->kbd_queue = Qnil;
Useful to set before you dump a modified Emacs. */);
Vtop_level = Qnil;
- DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table,
- doc: /* Translate table for keyboard input, or nil.
+ DEFVAR_KBOARD ("keyboard-translate-table", Vkeyboard_translate_table,
+ doc: /* Translate table for local keyboard input, or nil.
If non-nil, the value should be a char-table. Each character read
from the keyboard is looked up in this char-table. If the value found
there is non-nil, then it is used instead of the actual input character.
untranslated. In a vector, an element which is nil means "no translation".
This is applied to the characters supplied to input methods, not their
-output. See also `translation-table-for-input'. */);
- Vkeyboard_translate_table = Qnil;
+output. See also `translation-table-for-input'.
+
+`local-keyboard-translate-table' has a separate binding for each
+terminal. See Info node `(elisp)Multiple displays'. */);
DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
doc: /* Non-nil means to always spawn a subshell instead of suspending.
other commands. */
Lisp_Object Vreal_last_command;
+ /* User-supplied table to translate input characters through. */
+ Lisp_Object Vkeyboard_translate_table;
+
/* The prefix argument for the next command, in raw form. */
Lisp_Object Vprefix_arg;
extern Lisp_Object parse_modifiers P_ ((Lisp_Object));
extern Lisp_Object reorder_modifiers P_ ((Lisp_Object));
extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *));
-/* User-supplied string to translate input characters through. */
-extern Lisp_Object Vkeyboard_translate_table;
/* Parent keymap of terminal-local function-key-map instances. */
extern Lisp_Object Vfunction_key_map;
outbuf = Fcurrent_buffer ();
/* Report on alternates for keys. */
- if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix))
+ if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix))
{
int c;
- const unsigned char *translate = SDATA (Vkeyboard_translate_table);
- int translate_len = SCHARS (Vkeyboard_translate_table);
+ const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table);
+ int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table);
for (c = 0; c < translate_len; c++)
if (translate[c] != c)
insert ("\n", 1);
/* Insert calls signal_after_change which may GC. */
- translate = SDATA (Vkeyboard_translate_table);
+ translate = SDATA (current_kboard->Vkeyboard_translate_table);
}
insert ("\n", 1);