Commit 1344aad4 authored by Tom Tromey's avatar Tom Tromey

Hide implementation of `struct kboard'

	* callint.c (Fcall_interactively): Update.
	* doc.c (Fsubstitute_command_keys): Update.
	* cmds.c (Fself_insert_command): Update.
	* keymap.c (Fcurrent_active_maps, Fkey_binding)
	(Fdescribe_buffer_bindings): Update.
	* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
	(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
	Update.
	* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
	(echo_length, echo_truncate, cmd_error, command_loop_1)
	(read_char, kbd_buffer_store_event_hold, make_lispy_event)
	(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
	(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
	(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
	Update.
	* xfns.c (Fx_create_frame): Update.
	* xterm.c (x_connection_closed, x_term_init): Update.
	* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
	Update.
	* window.c (window_scroll_pixel_based, window_scroll_line_based):
	Update.
	* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
	(delete_frame): Update.
	* lisp.h (DEFVAR_KBOARD): Update for change to field names.
	* keyboard.h (struct kboard): Rename all Lisp_Object fields.
	(KBOARD_INTERNAL_FIELD, KVAR): New macros.
parent eb4916d7
2011-02-16 Tom Tromey <tromey@parfait>
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 Tom Tromey <tromey@redhat.com>
* lisp.h (DEFVAR_BUFFER_DEFAULTS): Use BVAR.
......@@ -280,7 +280,7 @@ invoke it. If KEYS is omitted or nil, the return value of
save_this_command = Vthis_command;
save_this_original_command = Vthis_original_command;
save_real_this_command = real_this_command;
save_last_command = current_kboard->Vlast_command;
save_last_command = KVAR (current_kboard, Vlast_command);
if (NILP (keys))
keys = this_command_keys, key_count = this_command_key_count;
......@@ -363,7 +363,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Vthis_command = save_this_command;
Vthis_original_command = save_this_original_command;
real_this_command= save_real_this_command;
current_kboard->Vlast_command = save_last_command;
KVAR (current_kboard, Vlast_command) = save_last_command;
temporarily_switch_to_single_kboard (NULL);
return unbind_to (speccount, apply1 (function, specs));
......@@ -832,7 +832,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Vthis_command = save_this_command;
Vthis_original_command = save_this_original_command;
real_this_command= save_real_this_command;
current_kboard->Vlast_command = save_last_command;
KVAR (current_kboard, Vlast_command) = save_last_command;
{
Lisp_Object val;
......
......@@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the
int remove_boundary = 1;
CHECK_NATNUM (n);
if (!EQ (Vthis_command, current_kboard->Vlast_command))
if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
nonundocount = 0;
if (NILP (Vexecuting_kbd_macro)
......
......@@ -719,7 +719,7 @@ a new string, without any text properties, is returned. */)
or a specified local map (which means search just that and the
global map). If non-nil, it might come from Voverriding_local_map,
or from a \\<mapname> construct in STRING itself.. */
keymap = current_kboard->Voverriding_terminal_local_map;
keymap = KVAR (current_kboard, Voverriding_terminal_local_map);
if (NILP (keymap))
keymap = Voverriding_local_map;
......
......@@ -428,20 +428,20 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
if (NILP (mini_window))
{
/* Use default-minibuffer-frame if possible. */
if (!FRAMEP (kb->Vdefault_minibuffer_frame)
|| ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))
if (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
|| ! FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))
{
Lisp_Object frame_dummy;
XSETFRAME (frame_dummy, f);
GCPRO1 (frame_dummy);
/* If there's no minibuffer frame to use, create one. */
kb->Vdefault_minibuffer_frame =
KVAR (kb, Vdefault_minibuffer_frame) =
call1 (intern ("make-initial-minibuffer-frame"), display);
UNGCPRO;
}
mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window;
mini_window = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window;
}
f->minibuffer_window = mini_window;
......@@ -889,7 +889,7 @@ to that frame. */)
(Lisp_Object event)
{
/* Preserve prefix arg that the command loop just cleared. */
current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg;
call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
return do_switch_frame (event, 0, 0, Qnil);
}
......@@ -1526,7 +1526,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* If we've deleted this keyboard's default_minibuffer_frame, try to
find another one. Prefer minibuffer-only frames, but also notice
frames with other windows. */
if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame))
if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)))
{
Lisp_Object frames;
......@@ -1575,11 +1575,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
if (NILP (frame_with_minibuf))
abort ();
kb->Vdefault_minibuffer_frame = frame_with_minibuf;
KVAR (kb, Vdefault_minibuffer_frame) = frame_with_minibuf;
}
else
/* No frames left on this kboard--say no minibuffer either. */
kb->Vdefault_minibuffer_frame = Qnil;
KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
}
/* Cause frame titles to update--necessary if we now have just one frame. */
......
......@@ -461,7 +461,7 @@ echo_char (Lisp_Object c)
char *ptr = buffer;
Lisp_Object echo_string;
echo_string = current_kboard->echo_string;
echo_string = KVAR (current_kboard, echo_string);
/* If someone has passed us a composite event, use its head symbol. */
c = EVENT_HEAD (c);
......@@ -528,7 +528,7 @@ echo_char (Lisp_Object c)
else if (STRINGP (echo_string))
echo_string = concat2 (echo_string, build_string (" "));
current_kboard->echo_string
KVAR (current_kboard, echo_string)
= concat2 (echo_string, make_string (buffer, ptr - buffer));
echo_now ();
......@@ -542,31 +542,31 @@ void
echo_dash (void)
{
/* Do nothing if not echoing at all. */
if (NILP (current_kboard->echo_string))
if (NILP (KVAR (current_kboard, echo_string)))
return;
if (this_command_key_count == 0)
return;
if (!current_kboard->immediate_echo
&& SCHARS (current_kboard->echo_string) == 0)
&& SCHARS (KVAR (current_kboard, echo_string)) == 0)
return;
/* Do nothing if we just printed a prompt. */
if (current_kboard->echo_after_prompt
== SCHARS (current_kboard->echo_string))
== SCHARS (KVAR (current_kboard, echo_string)))
return;
/* Do nothing if we have already put a dash at the end. */
if (SCHARS (current_kboard->echo_string) > 1)
if (SCHARS (KVAR (current_kboard, echo_string)) > 1)
{
Lisp_Object last_char, prev_char, idx;
idx = make_number (SCHARS (current_kboard->echo_string) - 2);
prev_char = Faref (current_kboard->echo_string, idx);
idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 2);
prev_char = Faref (KVAR (current_kboard, echo_string), idx);
idx = make_number (SCHARS (current_kboard->echo_string) - 1);
last_char = Faref (current_kboard->echo_string, idx);
idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 1);
last_char = Faref (KVAR (current_kboard, echo_string), idx);
if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
return;
......@@ -574,7 +574,7 @@ echo_dash (void)
/* Put a dash at the end of the buffer temporarily,
but make it go away when the next character is added. */
current_kboard->echo_string = concat2 (current_kboard->echo_string,
KVAR (current_kboard, echo_string) = concat2 (KVAR (current_kboard, echo_string),
build_string ("-"));
echo_now ();
}
......@@ -617,9 +617,9 @@ echo_now (void)
}
echoing = 1;
message3_nolog (current_kboard->echo_string,
SBYTES (current_kboard->echo_string),
STRING_MULTIBYTE (current_kboard->echo_string));
message3_nolog (KVAR (current_kboard, echo_string),
SBYTES (KVAR (current_kboard, echo_string)),
STRING_MULTIBYTE (KVAR (current_kboard, echo_string)));
echoing = 0;
/* Record in what buffer we echoed, and from which kboard. */
......@@ -637,7 +637,7 @@ cancel_echoing (void)
{
current_kboard->immediate_echo = 0;
current_kboard->echo_after_prompt = -1;
current_kboard->echo_string = Qnil;
KVAR (current_kboard, echo_string) = Qnil;
ok_to_echo_at_next_pause = NULL;
echo_kboard = NULL;
echo_message_buffer = Qnil;
......@@ -648,8 +648,8 @@ cancel_echoing (void)
static int
echo_length (void)
{
return (STRINGP (current_kboard->echo_string)
? SCHARS (current_kboard->echo_string)
return (STRINGP (KVAR (current_kboard, echo_string))
? SCHARS (KVAR (current_kboard, echo_string))
: 0);
}
......@@ -660,9 +660,9 @@ echo_length (void)
static void
echo_truncate (EMACS_INT nchars)
{
if (STRINGP (current_kboard->echo_string))
current_kboard->echo_string
= Fsubstring (current_kboard->echo_string,
if (STRINGP (KVAR (current_kboard, echo_string)))
KVAR (current_kboard, echo_string)
= Fsubstring (KVAR (current_kboard, echo_string),
make_number (0), make_number (nchars));
truncate_echo_area (nchars);
}
......@@ -993,8 +993,8 @@ cmd_error (Lisp_Object data)
Vstandard_input = Qt;
Vexecuting_kbd_macro = Qnil;
executing_kbd_macro = Qnil;
current_kboard->Vprefix_arg = Qnil;
current_kboard->Vlast_prefix_arg = Qnil;
KVAR (current_kboard, Vprefix_arg) = Qnil;
KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
cancel_echoing ();
/* Avoid unquittable loop if data contains a circular list. */
......@@ -1302,8 +1302,8 @@ command_loop_1 (void)
#endif
int already_adjusted = 0;
current_kboard->Vprefix_arg = Qnil;
current_kboard->Vlast_prefix_arg = Qnil;
KVAR (current_kboard, Vprefix_arg) = Qnil;
KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
Vdeactivate_mark = Qnil;
waiting_for_input = 0;
cancel_echoing ();
......@@ -1331,10 +1331,10 @@ command_loop_1 (void)
}
/* Do this after running Vpost_command_hook, for consistency. */
current_kboard->Vlast_command = Vthis_command;
current_kboard->Vreal_last_command = real_this_command;
KVAR (current_kboard, Vlast_command) = Vthis_command;
KVAR (current_kboard, Vreal_last_command) = real_this_command;
if (!CONSP (last_command_event))
current_kboard->Vlast_repeatable_command = real_this_command;
KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
while (1)
{
......@@ -1504,9 +1504,9 @@ command_loop_1 (void)
keys = Fkey_description (keys, Qnil);
bitch_at_user ();
message_with_string ("%s is undefined", keys, 0);
current_kboard->defining_kbd_macro = Qnil;
KVAR (current_kboard, defining_kbd_macro) = Qnil;
update_mode_lines = 1;
current_kboard->Vprefix_arg = Qnil;
KVAR (current_kboard, Vprefix_arg) = Qnil;
}
else
{
......@@ -1523,7 +1523,7 @@ command_loop_1 (void)
}
#endif
if (NILP (current_kboard->Vprefix_arg)) /* FIXME: Why? --Stef */
if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */
Fundo_boundary ();
Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
......@@ -1537,7 +1537,7 @@ command_loop_1 (void)
unbind_to (scount, Qnil);
#endif
}
current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
KVAR (current_kboard, Vlast_prefix_arg) = Vcurrent_prefix_arg;
/* Note that the value cell will never directly contain nil
if the symbol is a local variable. */
......@@ -1565,12 +1565,12 @@ command_loop_1 (void)
If the command didn't actually create a prefix arg,
but is merely a frame event that is transparent to prefix args,
then the above doesn't apply. */
if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_event))
if (NILP (KVAR (current_kboard, Vprefix_arg)) || CONSP (last_command_event))
{
current_kboard->Vlast_command = Vthis_command;
current_kboard->Vreal_last_command = real_this_command;
KVAR (current_kboard, Vlast_command) = Vthis_command;
KVAR (current_kboard, Vreal_last_command) = real_this_command;
if (!CONSP (last_command_event))
current_kboard->Vlast_repeatable_command = real_this_command;
KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
cancel_echoing ();
this_command_key_count = 0;
this_command_key_count_reset = 0;
......@@ -1649,8 +1649,8 @@ command_loop_1 (void)
/* Install chars successfully executed in kbd macro. */
if (!NILP (current_kboard->defining_kbd_macro)
&& NILP (current_kboard->Vprefix_arg))
if (!NILP (KVAR (current_kboard, defining_kbd_macro))
&& NILP (KVAR (current_kboard, Vprefix_arg)))
finalize_kbd_macro_chars ();
#if 0 /* This shouldn't be necessary anymore. --lorentey */
if (!was_locked)
......@@ -2461,7 +2461,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
if (kb != current_kboard)
{
Lisp_Object link = kb->kbd_queue;
Lisp_Object link = KVAR (kb, kbd_queue);
/* We shouldn't get here if we were in single-kboard mode! */
if (single_kboard)
abort ();
......@@ -2473,7 +2473,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
abort ();
}
if (!CONSP (link))
kb->kbd_queue = Fcons (c, Qnil);
KVAR (kb, kbd_queue) = Fcons (c, Qnil);
else
XSETCDR (link, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
......@@ -2645,12 +2645,12 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
{
if (current_kboard->kbd_queue_has_data)
{
if (!CONSP (current_kboard->kbd_queue))
if (!CONSP (KVAR (current_kboard, kbd_queue)))
abort ();
c = XCAR (current_kboard->kbd_queue);
current_kboard->kbd_queue
= XCDR (current_kboard->kbd_queue);
if (NILP (current_kboard->kbd_queue))
c = XCAR (KVAR (current_kboard, kbd_queue));
KVAR (current_kboard, kbd_queue)
= XCDR (KVAR (current_kboard, kbd_queue));
if (NILP (KVAR (current_kboard, kbd_queue)))
current_kboard->kbd_queue_has_data = 0;
input_pending = readable_events (0);
if (EVENT_HAS_PARAMETERS (c)
......@@ -2712,7 +2712,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (! NILP (c) && (kb != current_kboard))
{
Lisp_Object link = kb->kbd_queue;
Lisp_Object link = KVAR (kb, kbd_queue);
if (CONSP (link))
{
while (CONSP (XCDR (link)))
......@@ -2721,7 +2721,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
abort ();
}
if (!CONSP (link))
kb->kbd_queue = Fcons (c, Qnil);
KVAR (kb, kbd_queue) = Fcons (c, Qnil);
else
XSETCDR (link, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
......@@ -2829,15 +2829,15 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (XINT (c) == -1)
goto exit;
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)
if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
&& SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
|| (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
&& XVECTOR (KVAR (current_kboard, Vkeyboard_translate_table))->size > (unsigned) XFASTINT (c))
|| (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
&& CHARACTERP (c)))
{
Lisp_Object d;
d = Faref (current_kboard->Vkeyboard_translate_table, c);
d = Faref (KVAR (current_kboard, Vkeyboard_translate_table), c);
/* nil in keyboard-translate-table means no translation. */
if (!NILP (d))
c = d;
......@@ -2918,7 +2918,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
/* Save the echo status. */
int saved_immediate_echo = current_kboard->immediate_echo;
struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
Lisp_Object saved_echo_string = current_kboard->echo_string;
Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
int saved_echo_after_prompt = current_kboard->echo_after_prompt;
#if 0
......@@ -2973,7 +2973,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
cancel_echoing ();
ok_to_echo_at_next_pause = saved_ok_to_echo;
current_kboard->echo_string = saved_echo_string;
KVAR (current_kboard, echo_string) = saved_echo_string;
current_kboard->echo_after_prompt = saved_echo_after_prompt;
if (saved_immediate_echo)
echo_now ();
......@@ -3459,7 +3459,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
if (single_kboard && kb != current_kboard)
{
kb->kbd_queue
KVAR (kb, kbd_queue)
= Fcons (make_lispy_switch_frame (event->frame_or_window),
Fcons (make_number (c), Qnil));
kb->kbd_queue_has_data = 1;
......@@ -5322,13 +5322,13 @@ make_lispy_event (struct input_event *event)
{
/* We need to use an alist rather than a vector as the cache
since we can't make a vector long enuf. */
if (NILP (current_kboard->system_key_syms))
current_kboard->system_key_syms = Fcons (Qnil, Qnil);
if (NILP (KVAR (current_kboard, system_key_syms)))
KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil);
return modify_event_symbol (event->code,
event->modifiers,
Qfunction_key,
current_kboard->Vsystem_key_alist,
0, &current_kboard->system_key_syms,
KVAR (current_kboard, Vsystem_key_alist),
0, &KVAR (current_kboard, system_key_syms),
(unsigned) -1);
}
......@@ -7360,8 +7360,8 @@ menu_bar_items (Lisp_Object old)
/* Yes, use them (if non-nil) as well as the global map. */
maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
nmaps = 0;
if (!NILP (current_kboard->Voverriding_terminal_local_map))
maps[nmaps++] = current_kboard->Voverriding_terminal_local_map;
if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
if (!NILP (Voverriding_local_map))
maps[nmaps++] = Voverriding_local_map;
}
......@@ -7897,8 +7897,8 @@ tool_bar_items (Lisp_Object reuse, int *nitems)
/* Yes, use them (if non-nil) as well as the global map. */
maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
nmaps = 0;
if (!NILP (current_kboard->Voverriding_terminal_local_map))
maps[nmaps++] = current_kboard->Voverriding_terminal_local_map;
if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
if (!NILP (Voverriding_local_map))
maps[nmaps++] = Voverriding_local_map;
}
......@@ -8614,12 +8614,12 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
is pressed. Help characters are not recorded because menu prompting
is not used on replay.
*/
orig_defn_macro = current_kboard->defining_kbd_macro;
current_kboard->defining_kbd_macro = Qnil;
orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
KVAR (current_kboard, defining_kbd_macro) = Qnil;
do
obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
while (BUFFERP (obj));
current_kboard->defining_kbd_macro = orig_defn_macro;
KVAR (current_kboard, defining_kbd_macro) = orig_defn_macro;
if (!INTEGERP (obj))
return obj;
......@@ -8632,7 +8632,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
&& (!INTEGERP (menu_prompt_more_char)
|| ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
{
if (!NILP (current_kboard->defining_kbd_macro))
if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
store_kbd_macro_char (obj);
return obj;
}
......@@ -8974,7 +8974,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* Install the string STR as the beginning of the string of
echoing, so that it serves as a prompt for the next
character. */
current_kboard->echo_string = prompt;
KVAR (current_kboard, echo_string) = prompt;
current_kboard->echo_after_prompt = SCHARS (prompt);
echo_now ();
}
......@@ -9012,8 +9012,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
happens if we switch keyboards between rescans. */
replay_entire_sequence:
indec.map = indec.parent = current_kboard->Vinput_decode_map;
fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
indec.map = indec.parent = KVAR (current_kboard, Vinput_decode_map);
fkey.map = fkey.parent = KVAR (current_kboard, Vlocal_function_key_map);
keytran.map = keytran.parent = Vkey_translation_map;
indec.start = indec.end = 0;
fkey.start = fkey.end = 0;
......@@ -9034,7 +9034,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
the initial keymaps from the current buffer. */
nmaps = 0;
if (!NILP (current_kboard->Voverriding_terminal_local_map))
if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
{
if (2 > nmaps_allocated)
{
......@@ -9042,7 +9042,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
defs = (Lisp_Object *) alloca (2 * sizeof (defs[0]));
nmaps_allocated = 2;
}
submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map;
submaps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
}
else if (!NILP (Voverriding_local_map))
{
......@@ -9218,29 +9218,29 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (!NILP (delayed_switch_frame))
{
interrupted_kboard->kbd_queue
KVAR (interrupted_kboard, kbd_queue)
= Fcons (delayed_switch_frame,
interrupted_kboard->kbd_queue);
KVAR (interrupted_kboard, kbd_queue));
delayed_switch_frame = Qnil;
}
while (t > 0)
interrupted_kboard->kbd_queue
= Fcons (keybuf[--t], interrupted_kboard->kbd_queue);
KVAR (interrupted_kboard, kbd_queue)
= Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue));
/* If the side queue is non-empty, ensure it begins with a
switch-frame, so we'll replay it in the right context. */
if (CONSP (interrupted_kboard->kbd_queue)
&& (key = XCAR (interrupted_kboard->kbd_queue),
if (CONSP (KVAR (interrupted_kboard, kbd_queue))
&& (key = XCAR (KVAR (interrupted_kboard, kbd_queue)),
!(EVENT_HAS_PARAMETERS (key)
&& EQ (EVENT_HEAD_KIND (EVENT_HEAD (key)),
Qswitch_frame))))
{
Lisp_Object frame;
XSETFRAME (frame, interrupted_frame);
interrupted_kboard->kbd_queue
KVAR (interrupted_kboard, kbd_queue)
= Fcons (make_lispy_switch_frame (frame),
interrupted_kboard->kbd_queue);
KVAR (interrupted_kboard, kbd_queue));
}
mock_input = 0;
orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
......@@ -10115,9 +10115,9 @@ a special event, so ignore the prefix argument and don't clear it. */)
if (NILP (special))
{
prefixarg = current_kboard->Vprefix_arg;
prefixarg = KVAR (current_kboard, Vprefix_arg);
Vcurrent_prefix_arg = prefixarg;
current_kboard->Vprefix_arg = Qnil;
KVAR (current_kboard, Vprefix_arg) = Qnil;
}
else
prefixarg = Qnil;
......@@ -10251,7 +10251,7 @@ give to the command you invoke, if it asks for an argument. */)
UNGCPRO;
function = Fintern (function, Qnil);
current_kboard->Vprefix_arg = prefixarg;
KVAR (current_kboard, Vprefix_arg) = prefixarg;
Vthis_command = function;
real_this_command = function;
......@@ -10574,7 +10574,7 @@ DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
Also end any kbd macro being defined. */)
(void)
{
if (!NILP (current_kboard->defining_kbd_macro))
if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
{
/* Discard the last command from the macro. */
Fcancel_kbd_macro_events ();
......@@ -11224,30 +11224,30 @@ The `posn-' functions access elements of such lists. */)
void
init_kboard (KBOARD *kb)
{
kb->Voverriding_terminal_local_map = Qnil;
kb->Vlast_command = Qnil;
kb->Vreal_last_command = Qnil;
kb->Vkeyboard_translate_table = Qnil;
kb->Vlast_repeatable_command = Qnil;
kb->Vprefix_arg = Qnil;
kb->Vlast_prefix_arg = Qnil;
kb->kbd_queue = Qnil;
KVAR (kb, Voverriding_terminal_local_map) = Qnil;
KVAR (kb, Vlast_command) = Qnil;
KVAR (kb, Vreal_last_command) = Qnil;
KVAR (kb, Vkeyboard_translate_table) = Qnil;
KVAR (kb, Vlast_repeatable_command) = Qnil;
KVAR (kb, Vprefix_arg) = Qnil;
KVAR (kb, Vlast_prefix_arg) = Qnil;
KVAR (kb, kbd_queue) = Qnil;
kb->kbd_queue_has_data = 0;
kb->immediate_echo = 0;
kb->echo_string = Qnil;
KVAR (kb, echo_string) = Qnil;
kb->echo_after_prompt = -1;
kb->kbd_macro_buffer = 0;
kb->kbd_macro_bufsize = 0;
kb->defining_kbd_macro = Qnil;
kb->Vlast_kbd_macro = Qnil;
KVAR (kb, defining_kbd_macro) = Qnil;
KVAR (kb, Vlast_kbd_macro) = Qnil;
kb->reference_count = 0;
kb->Vsystem_key_alist = Qnil;
kb->system_key_syms = Qnil;
kb->Vwindow_system = Qt; /* Unset. */
kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
kb->Vdefault_minibuffer_frame = Qnil;
KVAR (kb, Vsystem_key_alist) = Qnil;
KVAR (kb, system_key_syms) = Qnil;
KVAR (kb, Vwindow_system) = Qt; /* Unset. */
KVAR (kb, Vinput_decode_map) = Fmake_sparse_keymap (Qnil);
KVAR (kb, Vlocal_function_key_map) = Fmake_sparse_keymap (Qnil);
Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
}
/*
......@@ -11323,7 +11323,7 @@ init_keyboard (void)
init_kboard (current_kboard);
/* A value of nil for Vwindow_system normally means a tty, but we also use
it for the initial terminal since there is no window system there. */
current_kboard->Vwindow_system = Qnil;
KVAR (current_kboard, Vwindow_system) = Qnil;
if (!noninteractive)
{
......@@ -12266,23 +12266,23 @@ mark_kboards (void)
if (kb->kbd_macro_buffer)
for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++)
mark_object (*p);
mark_object (kb->Voverriding_terminal_local_map);
mark_object (kb->Vlast_command);
mark_object (kb->Vreal_last_command);
mark_object (kb->Vkeyboard_translate_table);
mark_object (kb->Vlast_repeatable_command);
mark_object (kb->Vprefix_arg);
mark_object (kb->Vlast_prefix_arg);
mark_object (kb->kbd_queue);
mark_object (kb->defining_kbd_macro);
mark_object (kb->Vlast_kbd_macro);
mark_object (kb->Vsystem_key_alist);
mark_object (kb->system_key_syms);
mark_object (kb->Vwindow_system);
mark_object (kb->Vinput_decode_map);
mark_object (kb->Vlocal_function_key_map);
mark_object (kb->Vdefault_minibuffer_frame);
mark_object (kb->echo_string);
mark_object (KVAR (kb, Voverriding_terminal_local_map));
mark_object (KVAR (kb, Vlast_command));
mark_object (KVAR (kb, Vreal_last_command));
mark_object (KVAR (kb, Vkeyboard_translate_table));
mark_object (KVAR (kb, Vlast_repeatable_command));
mark_object (KVAR (kb, Vprefix_arg));
mark_object (KVAR (kb, Vlast_prefix_arg));
mark_object (KVAR (kb, kbd_queue));
mark_object (KVAR (kb, defining_kbd_macro));
mark_object (KVAR (kb, Vlast_kbd_macro));
mark_object (KVAR (kb, Vsystem_key_alist));