aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Tromey2011-02-16 09:35:16 -0700
committerTom Tromey2011-02-16 09:35:16 -0700
commit1344aad491d0951920efef6cae1c6934f92cd59b (patch)
treed251eb2e3842b09f1d269e0586668aa0e509f211 /src
parenteb4916d71a6a4293b1dd51deb19cf267bb62b7ae (diff)
downloademacs-1344aad491d0951920efef6cae1c6934f92cd59b.tar.gz
emacs-1344aad491d0951920efef6cae1c6934f92cd59b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog29
-rw-r--r--src/callint.c6
-rw-r--r--src/cmds.c2
-rw-r--r--src/doc.c2
-rw-r--r--src/frame.c16
-rw-r--r--src/keyboard.c240
-rw-r--r--src/keyboard.h43
-rw-r--r--src/keymap.c28
-rw-r--r--src/lisp.h2
-rw-r--r--src/macros.c42
-rw-r--r--src/term.c18
-rw-r--r--src/window.c8
-rw-r--r--src/xfns.c6
-rw-r--r--src/xterm.c6
14 files changed, 243 insertions, 205 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1f4e23b7504..13b19453562 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,32 @@
12011-02-16 Tom Tromey <tromey@parfait>
2
3 * callint.c (Fcall_interactively): Update.
4 * doc.c (Fsubstitute_command_keys): Update.
5 * cmds.c (Fself_insert_command): Update.
6 * keymap.c (Fcurrent_active_maps, Fkey_binding)
7 (Fdescribe_buffer_bindings): Update.
8 * macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
9 (store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
10 Update.
11 * keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
12 (echo_length, echo_truncate, cmd_error, command_loop_1)
13 (read_char, kbd_buffer_store_event_hold, make_lispy_event)
14 (menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
15 (read_key_sequence, Fcommand_execute, Fexecute_extended_command)
16 (Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
17 Update.
18 * xfns.c (Fx_create_frame): Update.
19 * xterm.c (x_connection_closed, x_term_init): Update.
20 * term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
21 Update.
22 * window.c (window_scroll_pixel_based, window_scroll_line_based):
23 Update.
24 * frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
25 (delete_frame): Update.
26 * lisp.h (DEFVAR_KBOARD): Update for change to field names.
27 * keyboard.h (struct kboard): Rename all Lisp_Object fields.
28 (KBOARD_INTERNAL_FIELD, KVAR): New macros.
29
12011-02-16 Tom Tromey <tromey@redhat.com> 302011-02-16 Tom Tromey <tromey@redhat.com>
2 31
3 * lisp.h (DEFVAR_BUFFER_DEFAULTS): Use BVAR. 32 * lisp.h (DEFVAR_BUFFER_DEFAULTS): Use BVAR.
diff --git a/src/callint.c b/src/callint.c
index b998c70187d..21dd3cd4d9d 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -280,7 +280,7 @@ invoke it. If KEYS is omitted or nil, the return value of
280 save_this_command = Vthis_command; 280 save_this_command = Vthis_command;
281 save_this_original_command = Vthis_original_command; 281 save_this_original_command = Vthis_original_command;
282 save_real_this_command = real_this_command; 282 save_real_this_command = real_this_command;
283 save_last_command = current_kboard->Vlast_command; 283 save_last_command = KVAR (current_kboard, Vlast_command);
284 284
285 if (NILP (keys)) 285 if (NILP (keys))
286 keys = this_command_keys, key_count = this_command_key_count; 286 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
363 Vthis_command = save_this_command; 363 Vthis_command = save_this_command;
364 Vthis_original_command = save_this_original_command; 364 Vthis_original_command = save_this_original_command;
365 real_this_command= save_real_this_command; 365 real_this_command= save_real_this_command;
366 current_kboard->Vlast_command = save_last_command; 366 KVAR (current_kboard, Vlast_command) = save_last_command;
367 367
368 temporarily_switch_to_single_kboard (NULL); 368 temporarily_switch_to_single_kboard (NULL);
369 return unbind_to (speccount, apply1 (function, specs)); 369 return unbind_to (speccount, apply1 (function, specs));
@@ -832,7 +832,7 @@ invoke it. If KEYS is omitted or nil, the return value of
832 Vthis_command = save_this_command; 832 Vthis_command = save_this_command;
833 Vthis_original_command = save_this_original_command; 833 Vthis_original_command = save_this_original_command;
834 real_this_command= save_real_this_command; 834 real_this_command= save_real_this_command;
835 current_kboard->Vlast_command = save_last_command; 835 KVAR (current_kboard, Vlast_command) = save_last_command;
836 836
837 { 837 {
838 Lisp_Object val; 838 Lisp_Object val;
diff --git a/src/cmds.c b/src/cmds.c
index 253b8d6a5ec..336bf1154f9 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the
277 int remove_boundary = 1; 277 int remove_boundary = 1;
278 CHECK_NATNUM (n); 278 CHECK_NATNUM (n);
279 279
280 if (!EQ (Vthis_command, current_kboard->Vlast_command)) 280 if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
281 nonundocount = 0; 281 nonundocount = 0;
282 282
283 if (NILP (Vexecuting_kbd_macro) 283 if (NILP (Vexecuting_kbd_macro)
diff --git a/src/doc.c b/src/doc.c
index 31f1e5a9175..e572d43dbf4 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -719,7 +719,7 @@ a new string, without any text properties, is returned. */)
719 or a specified local map (which means search just that and the 719 or a specified local map (which means search just that and the
720 global map). If non-nil, it might come from Voverriding_local_map, 720 global map). If non-nil, it might come from Voverriding_local_map,
721 or from a \\<mapname> construct in STRING itself.. */ 721 or from a \\<mapname> construct in STRING itself.. */
722 keymap = current_kboard->Voverriding_terminal_local_map; 722 keymap = KVAR (current_kboard, Voverriding_terminal_local_map);
723 if (NILP (keymap)) 723 if (NILP (keymap))
724 keymap = Voverriding_local_map; 724 keymap = Voverriding_local_map;
725 725
diff --git a/src/frame.c b/src/frame.c
index edbd45a2a34..56e0e7ec919 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -428,20 +428,20 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
428 if (NILP (mini_window)) 428 if (NILP (mini_window))
429 { 429 {
430 /* Use default-minibuffer-frame if possible. */ 430 /* Use default-minibuffer-frame if possible. */
431 if (!FRAMEP (kb->Vdefault_minibuffer_frame) 431 if (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
432 || ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))) 432 || ! FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))
433 { 433 {
434 Lisp_Object frame_dummy; 434 Lisp_Object frame_dummy;
435 435
436 XSETFRAME (frame_dummy, f); 436 XSETFRAME (frame_dummy, f);
437 GCPRO1 (frame_dummy); 437 GCPRO1 (frame_dummy);
438 /* If there's no minibuffer frame to use, create one. */ 438 /* If there's no minibuffer frame to use, create one. */
439 kb->Vdefault_minibuffer_frame = 439 KVAR (kb, Vdefault_minibuffer_frame) =
440 call1 (intern ("make-initial-minibuffer-frame"), display); 440 call1 (intern ("make-initial-minibuffer-frame"), display);
441 UNGCPRO; 441 UNGCPRO;
442 } 442 }
443 443
444 mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window; 444 mini_window = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window;
445 } 445 }
446 446
447 f->minibuffer_window = mini_window; 447 f->minibuffer_window = mini_window;
@@ -889,7 +889,7 @@ to that frame. */)
889 (Lisp_Object event) 889 (Lisp_Object event)
890{ 890{
891 /* Preserve prefix arg that the command loop just cleared. */ 891 /* Preserve prefix arg that the command loop just cleared. */
892 current_kboard->Vprefix_arg = Vcurrent_prefix_arg; 892 KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg;
893 call1 (Vrun_hooks, Qmouse_leave_buffer_hook); 893 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
894 return do_switch_frame (event, 0, 0, Qnil); 894 return do_switch_frame (event, 0, 0, Qnil);
895} 895}
@@ -1526,7 +1526,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1526 /* If we've deleted this keyboard's default_minibuffer_frame, try to 1526 /* If we've deleted this keyboard's default_minibuffer_frame, try to
1527 find another one. Prefer minibuffer-only frames, but also notice 1527 find another one. Prefer minibuffer-only frames, but also notice
1528 frames with other windows. */ 1528 frames with other windows. */
1529 if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame)) 1529 if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)))
1530 { 1530 {
1531 Lisp_Object frames; 1531 Lisp_Object frames;
1532 1532
@@ -1575,11 +1575,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1575 if (NILP (frame_with_minibuf)) 1575 if (NILP (frame_with_minibuf))
1576 abort (); 1576 abort ();
1577 1577
1578 kb->Vdefault_minibuffer_frame = frame_with_minibuf; 1578 KVAR (kb, Vdefault_minibuffer_frame) = frame_with_minibuf;
1579 } 1579 }
1580 else 1580 else
1581 /* No frames left on this kboard--say no minibuffer either. */ 1581 /* No frames left on this kboard--say no minibuffer either. */
1582 kb->Vdefault_minibuffer_frame = Qnil; 1582 KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
1583 } 1583 }
1584 1584
1585 /* Cause frame titles to update--necessary if we now have just one frame. */ 1585 /* Cause frame titles to update--necessary if we now have just one frame. */
diff --git a/src/keyboard.c b/src/keyboard.c
index a1d851408e3..e9c6d508fa2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -461,7 +461,7 @@ echo_char (Lisp_Object c)
461 char *ptr = buffer; 461 char *ptr = buffer;
462 Lisp_Object echo_string; 462 Lisp_Object echo_string;
463 463
464 echo_string = current_kboard->echo_string; 464 echo_string = KVAR (current_kboard, echo_string);
465 465
466 /* If someone has passed us a composite event, use its head symbol. */ 466 /* If someone has passed us a composite event, use its head symbol. */
467 c = EVENT_HEAD (c); 467 c = EVENT_HEAD (c);
@@ -528,7 +528,7 @@ echo_char (Lisp_Object c)
528 else if (STRINGP (echo_string)) 528 else if (STRINGP (echo_string))
529 echo_string = concat2 (echo_string, build_string (" ")); 529 echo_string = concat2 (echo_string, build_string (" "));
530 530
531 current_kboard->echo_string 531 KVAR (current_kboard, echo_string)
532 = concat2 (echo_string, make_string (buffer, ptr - buffer)); 532 = concat2 (echo_string, make_string (buffer, ptr - buffer));
533 533
534 echo_now (); 534 echo_now ();
@@ -542,31 +542,31 @@ void
542echo_dash (void) 542echo_dash (void)
543{ 543{
544 /* Do nothing if not echoing at all. */ 544 /* Do nothing if not echoing at all. */
545 if (NILP (current_kboard->echo_string)) 545 if (NILP (KVAR (current_kboard, echo_string)))
546 return; 546 return;
547 547
548 if (this_command_key_count == 0) 548 if (this_command_key_count == 0)
549 return; 549 return;
550 550
551 if (!current_kboard->immediate_echo 551 if (!current_kboard->immediate_echo
552 && SCHARS (current_kboard->echo_string) == 0) 552 && SCHARS (KVAR (current_kboard, echo_string)) == 0)
553 return; 553 return;
554 554
555 /* Do nothing if we just printed a prompt. */ 555 /* Do nothing if we just printed a prompt. */
556 if (current_kboard->echo_after_prompt 556 if (current_kboard->echo_after_prompt
557 == SCHARS (current_kboard->echo_string)) 557 == SCHARS (KVAR (current_kboard, echo_string)))
558 return; 558 return;
559 559
560 /* Do nothing if we have already put a dash at the end. */ 560 /* Do nothing if we have already put a dash at the end. */
561 if (SCHARS (current_kboard->echo_string) > 1) 561 if (SCHARS (KVAR (current_kboard, echo_string)) > 1)
562 { 562 {
563 Lisp_Object last_char, prev_char, idx; 563 Lisp_Object last_char, prev_char, idx;
564 564
565 idx = make_number (SCHARS (current_kboard->echo_string) - 2); 565 idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 2);
566 prev_char = Faref (current_kboard->echo_string, idx); 566 prev_char = Faref (KVAR (current_kboard, echo_string), idx);
567 567
568 idx = make_number (SCHARS (current_kboard->echo_string) - 1); 568 idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 1);
569 last_char = Faref (current_kboard->echo_string, idx); 569 last_char = Faref (KVAR (current_kboard, echo_string), idx);
570 570
571 if (XINT (last_char) == '-' && XINT (prev_char) != ' ') 571 if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
572 return; 572 return;
@@ -574,7 +574,7 @@ echo_dash (void)
574 574
575 /* Put a dash at the end of the buffer temporarily, 575 /* Put a dash at the end of the buffer temporarily,
576 but make it go away when the next character is added. */ 576 but make it go away when the next character is added. */
577 current_kboard->echo_string = concat2 (current_kboard->echo_string, 577 KVAR (current_kboard, echo_string) = concat2 (KVAR (current_kboard, echo_string),
578 build_string ("-")); 578 build_string ("-"));
579 echo_now (); 579 echo_now ();
580} 580}
@@ -617,9 +617,9 @@ echo_now (void)
617 } 617 }
618 618
619 echoing = 1; 619 echoing = 1;
620 message3_nolog (current_kboard->echo_string, 620 message3_nolog (KVAR (current_kboard, echo_string),
621 SBYTES (current_kboard->echo_string), 621 SBYTES (KVAR (current_kboard, echo_string)),
622 STRING_MULTIBYTE (current_kboard->echo_string)); 622 STRING_MULTIBYTE (KVAR (current_kboard, echo_string)));
623 echoing = 0; 623 echoing = 0;
624 624
625 /* Record in what buffer we echoed, and from which kboard. */ 625 /* Record in what buffer we echoed, and from which kboard. */
@@ -637,7 +637,7 @@ cancel_echoing (void)
637{ 637{
638 current_kboard->immediate_echo = 0; 638 current_kboard->immediate_echo = 0;
639 current_kboard->echo_after_prompt = -1; 639 current_kboard->echo_after_prompt = -1;
640 current_kboard->echo_string = Qnil; 640 KVAR (current_kboard, echo_string) = Qnil;
641 ok_to_echo_at_next_pause = NULL; 641 ok_to_echo_at_next_pause = NULL;
642 echo_kboard = NULL; 642 echo_kboard = NULL;
643 echo_message_buffer = Qnil; 643 echo_message_buffer = Qnil;
@@ -648,8 +648,8 @@ cancel_echoing (void)
648static int 648static int
649echo_length (void) 649echo_length (void)
650{ 650{
651 return (STRINGP (current_kboard->echo_string) 651 return (STRINGP (KVAR (current_kboard, echo_string))
652 ? SCHARS (current_kboard->echo_string) 652 ? SCHARS (KVAR (current_kboard, echo_string))
653 : 0); 653 : 0);
654} 654}
655 655
@@ -660,9 +660,9 @@ echo_length (void)
660static void 660static void
661echo_truncate (EMACS_INT nchars) 661echo_truncate (EMACS_INT nchars)
662{ 662{
663 if (STRINGP (current_kboard->echo_string)) 663 if (STRINGP (KVAR (current_kboard, echo_string)))
664 current_kboard->echo_string 664 KVAR (current_kboard, echo_string)
665 = Fsubstring (current_kboard->echo_string, 665 = Fsubstring (KVAR (current_kboard, echo_string),
666 make_number (0), make_number (nchars)); 666 make_number (0), make_number (nchars));
667 truncate_echo_area (nchars); 667 truncate_echo_area (nchars);
668} 668}
@@ -993,8 +993,8 @@ cmd_error (Lisp_Object data)
993 Vstandard_input = Qt; 993 Vstandard_input = Qt;
994 Vexecuting_kbd_macro = Qnil; 994 Vexecuting_kbd_macro = Qnil;
995 executing_kbd_macro = Qnil; 995 executing_kbd_macro = Qnil;
996 current_kboard->Vprefix_arg = Qnil; 996 KVAR (current_kboard, Vprefix_arg) = Qnil;
997 current_kboard->Vlast_prefix_arg = Qnil; 997 KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
998 cancel_echoing (); 998 cancel_echoing ();
999 999
1000 /* Avoid unquittable loop if data contains a circular list. */ 1000 /* Avoid unquittable loop if data contains a circular list. */
@@ -1302,8 +1302,8 @@ command_loop_1 (void)
1302#endif 1302#endif
1303 int already_adjusted = 0; 1303 int already_adjusted = 0;
1304 1304
1305 current_kboard->Vprefix_arg = Qnil; 1305 KVAR (current_kboard, Vprefix_arg) = Qnil;
1306 current_kboard->Vlast_prefix_arg = Qnil; 1306 KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
1307 Vdeactivate_mark = Qnil; 1307 Vdeactivate_mark = Qnil;
1308 waiting_for_input = 0; 1308 waiting_for_input = 0;
1309 cancel_echoing (); 1309 cancel_echoing ();
@@ -1331,10 +1331,10 @@ command_loop_1 (void)
1331 } 1331 }
1332 1332
1333 /* Do this after running Vpost_command_hook, for consistency. */ 1333 /* Do this after running Vpost_command_hook, for consistency. */
1334 current_kboard->Vlast_command = Vthis_command; 1334 KVAR (current_kboard, Vlast_command) = Vthis_command;
1335 current_kboard->Vreal_last_command = real_this_command; 1335 KVAR (current_kboard, Vreal_last_command) = real_this_command;
1336 if (!CONSP (last_command_event)) 1336 if (!CONSP (last_command_event))
1337 current_kboard->Vlast_repeatable_command = real_this_command; 1337 KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
1338 1338
1339 while (1) 1339 while (1)
1340 { 1340 {
@@ -1504,9 +1504,9 @@ command_loop_1 (void)
1504 keys = Fkey_description (keys, Qnil); 1504 keys = Fkey_description (keys, Qnil);
1505 bitch_at_user (); 1505 bitch_at_user ();
1506 message_with_string ("%s is undefined", keys, 0); 1506 message_with_string ("%s is undefined", keys, 0);
1507 current_kboard->defining_kbd_macro = Qnil; 1507 KVAR (current_kboard, defining_kbd_macro) = Qnil;
1508 update_mode_lines = 1; 1508 update_mode_lines = 1;
1509 current_kboard->Vprefix_arg = Qnil; 1509 KVAR (current_kboard, Vprefix_arg) = Qnil;
1510 } 1510 }
1511 else 1511 else
1512 { 1512 {
@@ -1523,7 +1523,7 @@ command_loop_1 (void)
1523 } 1523 }
1524#endif 1524#endif
1525 1525
1526 if (NILP (current_kboard->Vprefix_arg)) /* FIXME: Why? --Stef */ 1526 if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */
1527 Fundo_boundary (); 1527 Fundo_boundary ();
1528 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); 1528 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
1529 1529
@@ -1537,7 +1537,7 @@ command_loop_1 (void)
1537 unbind_to (scount, Qnil); 1537 unbind_to (scount, Qnil);
1538#endif 1538#endif
1539 } 1539 }
1540 current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg; 1540 KVAR (current_kboard, Vlast_prefix_arg) = Vcurrent_prefix_arg;
1541 1541
1542 /* Note that the value cell will never directly contain nil 1542 /* Note that the value cell will never directly contain nil
1543 if the symbol is a local variable. */ 1543 if the symbol is a local variable. */
@@ -1565,12 +1565,12 @@ command_loop_1 (void)
1565 If the command didn't actually create a prefix arg, 1565 If the command didn't actually create a prefix arg,
1566 but is merely a frame event that is transparent to prefix args, 1566 but is merely a frame event that is transparent to prefix args,
1567 then the above doesn't apply. */ 1567 then the above doesn't apply. */
1568 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_event)) 1568 if (NILP (KVAR (current_kboard, Vprefix_arg)) || CONSP (last_command_event))
1569 { 1569 {
1570 current_kboard->Vlast_command = Vthis_command; 1570 KVAR (current_kboard, Vlast_command) = Vthis_command;
1571 current_kboard->Vreal_last_command = real_this_command; 1571 KVAR (current_kboard, Vreal_last_command) = real_this_command;
1572 if (!CONSP (last_command_event)) 1572 if (!CONSP (last_command_event))
1573 current_kboard->Vlast_repeatable_command = real_this_command; 1573 KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
1574 cancel_echoing (); 1574 cancel_echoing ();
1575 this_command_key_count = 0; 1575 this_command_key_count = 0;
1576 this_command_key_count_reset = 0; 1576 this_command_key_count_reset = 0;
@@ -1649,8 +1649,8 @@ command_loop_1 (void)
1649 1649
1650 /* Install chars successfully executed in kbd macro. */ 1650 /* Install chars successfully executed in kbd macro. */
1651 1651
1652 if (!NILP (current_kboard->defining_kbd_macro) 1652 if (!NILP (KVAR (current_kboard, defining_kbd_macro))
1653 && NILP (current_kboard->Vprefix_arg)) 1653 && NILP (KVAR (current_kboard, Vprefix_arg)))
1654 finalize_kbd_macro_chars (); 1654 finalize_kbd_macro_chars ();
1655#if 0 /* This shouldn't be necessary anymore. --lorentey */ 1655#if 0 /* This shouldn't be necessary anymore. --lorentey */
1656 if (!was_locked) 1656 if (!was_locked)
@@ -2461,7 +2461,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2461 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame)); 2461 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
2462 if (kb != current_kboard) 2462 if (kb != current_kboard)
2463 { 2463 {
2464 Lisp_Object link = kb->kbd_queue; 2464 Lisp_Object link = KVAR (kb, kbd_queue);
2465 /* We shouldn't get here if we were in single-kboard mode! */ 2465 /* We shouldn't get here if we were in single-kboard mode! */
2466 if (single_kboard) 2466 if (single_kboard)
2467 abort (); 2467 abort ();
@@ -2473,7 +2473,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2473 abort (); 2473 abort ();
2474 } 2474 }
2475 if (!CONSP (link)) 2475 if (!CONSP (link))
2476 kb->kbd_queue = Fcons (c, Qnil); 2476 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2477 else 2477 else
2478 XSETCDR (link, Fcons (c, Qnil)); 2478 XSETCDR (link, Fcons (c, Qnil));
2479 kb->kbd_queue_has_data = 1; 2479 kb->kbd_queue_has_data = 1;
@@ -2645,12 +2645,12 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2645 { 2645 {
2646 if (current_kboard->kbd_queue_has_data) 2646 if (current_kboard->kbd_queue_has_data)
2647 { 2647 {
2648 if (!CONSP (current_kboard->kbd_queue)) 2648 if (!CONSP (KVAR (current_kboard, kbd_queue)))
2649 abort (); 2649 abort ();
2650 c = XCAR (current_kboard->kbd_queue); 2650 c = XCAR (KVAR (current_kboard, kbd_queue));
2651 current_kboard->kbd_queue 2651 KVAR (current_kboard, kbd_queue)
2652 = XCDR (current_kboard->kbd_queue); 2652 = XCDR (KVAR (current_kboard, kbd_queue));
2653 if (NILP (current_kboard->kbd_queue)) 2653 if (NILP (KVAR (current_kboard, kbd_queue)))
2654 current_kboard->kbd_queue_has_data = 0; 2654 current_kboard->kbd_queue_has_data = 0;
2655 input_pending = readable_events (0); 2655 input_pending = readable_events (0);
2656 if (EVENT_HAS_PARAMETERS (c) 2656 if (EVENT_HAS_PARAMETERS (c)
@@ -2712,7 +2712,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2712 2712
2713 if (! NILP (c) && (kb != current_kboard)) 2713 if (! NILP (c) && (kb != current_kboard))
2714 { 2714 {
2715 Lisp_Object link = kb->kbd_queue; 2715 Lisp_Object link = KVAR (kb, kbd_queue);
2716 if (CONSP (link)) 2716 if (CONSP (link))
2717 { 2717 {
2718 while (CONSP (XCDR (link))) 2718 while (CONSP (XCDR (link)))
@@ -2721,7 +2721,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2721 abort (); 2721 abort ();
2722 } 2722 }
2723 if (!CONSP (link)) 2723 if (!CONSP (link))
2724 kb->kbd_queue = Fcons (c, Qnil); 2724 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2725 else 2725 else
2726 XSETCDR (link, Fcons (c, Qnil)); 2726 XSETCDR (link, Fcons (c, Qnil));
2727 kb->kbd_queue_has_data = 1; 2727 kb->kbd_queue_has_data = 1;
@@ -2829,15 +2829,15 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2829 if (XINT (c) == -1) 2829 if (XINT (c) == -1)
2830 goto exit; 2830 goto exit;
2831 2831
2832 if ((STRINGP (current_kboard->Vkeyboard_translate_table) 2832 if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
2833 && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) 2833 && SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
2834 || (VECTORP (current_kboard->Vkeyboard_translate_table) 2834 || (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
2835 && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) 2835 && XVECTOR (KVAR (current_kboard, Vkeyboard_translate_table))->size > (unsigned) XFASTINT (c))
2836 || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table) 2836 || (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
2837 && CHARACTERP (c))) 2837 && CHARACTERP (c)))
2838 { 2838 {
2839 Lisp_Object d; 2839 Lisp_Object d;
2840 d = Faref (current_kboard->Vkeyboard_translate_table, c); 2840 d = Faref (KVAR (current_kboard, Vkeyboard_translate_table), c);
2841 /* nil in keyboard-translate-table means no translation. */ 2841 /* nil in keyboard-translate-table means no translation. */
2842 if (!NILP (d)) 2842 if (!NILP (d))
2843 c = d; 2843 c = d;
@@ -2918,7 +2918,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2918 /* Save the echo status. */ 2918 /* Save the echo status. */
2919 int saved_immediate_echo = current_kboard->immediate_echo; 2919 int saved_immediate_echo = current_kboard->immediate_echo;
2920 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; 2920 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
2921 Lisp_Object saved_echo_string = current_kboard->echo_string; 2921 Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
2922 int saved_echo_after_prompt = current_kboard->echo_after_prompt; 2922 int saved_echo_after_prompt = current_kboard->echo_after_prompt;
2923 2923
2924#if 0 2924#if 0
@@ -2973,7 +2973,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2973 2973
2974 cancel_echoing (); 2974 cancel_echoing ();
2975 ok_to_echo_at_next_pause = saved_ok_to_echo; 2975 ok_to_echo_at_next_pause = saved_ok_to_echo;
2976 current_kboard->echo_string = saved_echo_string; 2976 KVAR (current_kboard, echo_string) = saved_echo_string;
2977 current_kboard->echo_after_prompt = saved_echo_after_prompt; 2977 current_kboard->echo_after_prompt = saved_echo_after_prompt;
2978 if (saved_immediate_echo) 2978 if (saved_immediate_echo)
2979 echo_now (); 2979 echo_now ();
@@ -3459,7 +3459,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3459 3459
3460 if (single_kboard && kb != current_kboard) 3460 if (single_kboard && kb != current_kboard)
3461 { 3461 {
3462 kb->kbd_queue 3462 KVAR (kb, kbd_queue)
3463 = Fcons (make_lispy_switch_frame (event->frame_or_window), 3463 = Fcons (make_lispy_switch_frame (event->frame_or_window),
3464 Fcons (make_number (c), Qnil)); 3464 Fcons (make_number (c), Qnil));
3465 kb->kbd_queue_has_data = 1; 3465 kb->kbd_queue_has_data = 1;
@@ -5322,13 +5322,13 @@ make_lispy_event (struct input_event *event)
5322 { 5322 {
5323 /* We need to use an alist rather than a vector as the cache 5323 /* We need to use an alist rather than a vector as the cache
5324 since we can't make a vector long enuf. */ 5324 since we can't make a vector long enuf. */
5325 if (NILP (current_kboard->system_key_syms)) 5325 if (NILP (KVAR (current_kboard, system_key_syms)))
5326 current_kboard->system_key_syms = Fcons (Qnil, Qnil); 5326 KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil);
5327 return modify_event_symbol (event->code, 5327 return modify_event_symbol (event->code,
5328 event->modifiers, 5328 event->modifiers,
5329 Qfunction_key, 5329 Qfunction_key,
5330 current_kboard->Vsystem_key_alist, 5330 KVAR (current_kboard, Vsystem_key_alist),
5331 0, &current_kboard->system_key_syms, 5331 0, &KVAR (current_kboard, system_key_syms),
5332 (unsigned) -1); 5332 (unsigned) -1);
5333 } 5333 }
5334 5334
@@ -7360,8 +7360,8 @@ menu_bar_items (Lisp_Object old)
7360 /* Yes, use them (if non-nil) as well as the global map. */ 7360 /* Yes, use them (if non-nil) as well as the global map. */
7361 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0])); 7361 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
7362 nmaps = 0; 7362 nmaps = 0;
7363 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 7363 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
7364 maps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 7364 maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
7365 if (!NILP (Voverriding_local_map)) 7365 if (!NILP (Voverriding_local_map))
7366 maps[nmaps++] = Voverriding_local_map; 7366 maps[nmaps++] = Voverriding_local_map;
7367 } 7367 }
@@ -7897,8 +7897,8 @@ tool_bar_items (Lisp_Object reuse, int *nitems)
7897 /* Yes, use them (if non-nil) as well as the global map. */ 7897 /* Yes, use them (if non-nil) as well as the global map. */
7898 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0])); 7898 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
7899 nmaps = 0; 7899 nmaps = 0;
7900 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 7900 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
7901 maps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 7901 maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
7902 if (!NILP (Voverriding_local_map)) 7902 if (!NILP (Voverriding_local_map))
7903 maps[nmaps++] = Voverriding_local_map; 7903 maps[nmaps++] = Voverriding_local_map;
7904 } 7904 }
@@ -8614,12 +8614,12 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
8614 is pressed. Help characters are not recorded because menu prompting 8614 is pressed. Help characters are not recorded because menu prompting
8615 is not used on replay. 8615 is not used on replay.
8616 */ 8616 */
8617 orig_defn_macro = current_kboard->defining_kbd_macro; 8617 orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
8618 current_kboard->defining_kbd_macro = Qnil; 8618 KVAR (current_kboard, defining_kbd_macro) = Qnil;
8619 do 8619 do
8620 obj = read_char (commandflag, 0, 0, Qt, 0, NULL); 8620 obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
8621 while (BUFFERP (obj)); 8621 while (BUFFERP (obj));
8622 current_kboard->defining_kbd_macro = orig_defn_macro; 8622 KVAR (current_kboard, defining_kbd_macro) = orig_defn_macro;
8623 8623
8624 if (!INTEGERP (obj)) 8624 if (!INTEGERP (obj))
8625 return obj; 8625 return obj;
@@ -8632,7 +8632,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
8632 && (!INTEGERP (menu_prompt_more_char) 8632 && (!INTEGERP (menu_prompt_more_char)
8633 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char)))))) 8633 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
8634 { 8634 {
8635 if (!NILP (current_kboard->defining_kbd_macro)) 8635 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
8636 store_kbd_macro_char (obj); 8636 store_kbd_macro_char (obj);
8637 return obj; 8637 return obj;
8638 } 8638 }
@@ -8974,7 +8974,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8974 /* Install the string STR as the beginning of the string of 8974 /* Install the string STR as the beginning of the string of
8975 echoing, so that it serves as a prompt for the next 8975 echoing, so that it serves as a prompt for the next
8976 character. */ 8976 character. */
8977 current_kboard->echo_string = prompt; 8977 KVAR (current_kboard, echo_string) = prompt;
8978 current_kboard->echo_after_prompt = SCHARS (prompt); 8978 current_kboard->echo_after_prompt = SCHARS (prompt);
8979 echo_now (); 8979 echo_now ();
8980 } 8980 }
@@ -9012,8 +9012,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9012 happens if we switch keyboards between rescans. */ 9012 happens if we switch keyboards between rescans. */
9013 replay_entire_sequence: 9013 replay_entire_sequence:
9014 9014
9015 indec.map = indec.parent = current_kboard->Vinput_decode_map; 9015 indec.map = indec.parent = KVAR (current_kboard, Vinput_decode_map);
9016 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; 9016 fkey.map = fkey.parent = KVAR (current_kboard, Vlocal_function_key_map);
9017 keytran.map = keytran.parent = Vkey_translation_map; 9017 keytran.map = keytran.parent = Vkey_translation_map;
9018 indec.start = indec.end = 0; 9018 indec.start = indec.end = 0;
9019 fkey.start = fkey.end = 0; 9019 fkey.start = fkey.end = 0;
@@ -9034,7 +9034,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9034 the initial keymaps from the current buffer. */ 9034 the initial keymaps from the current buffer. */
9035 nmaps = 0; 9035 nmaps = 0;
9036 9036
9037 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 9037 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
9038 { 9038 {
9039 if (2 > nmaps_allocated) 9039 if (2 > nmaps_allocated)
9040 { 9040 {
@@ -9042,7 +9042,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9042 defs = (Lisp_Object *) alloca (2 * sizeof (defs[0])); 9042 defs = (Lisp_Object *) alloca (2 * sizeof (defs[0]));
9043 nmaps_allocated = 2; 9043 nmaps_allocated = 2;
9044 } 9044 }
9045 submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 9045 submaps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
9046 } 9046 }
9047 else if (!NILP (Voverriding_local_map)) 9047 else if (!NILP (Voverriding_local_map))
9048 { 9048 {
@@ -9218,29 +9218,29 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9218 9218
9219 if (!NILP (delayed_switch_frame)) 9219 if (!NILP (delayed_switch_frame))
9220 { 9220 {
9221 interrupted_kboard->kbd_queue 9221 KVAR (interrupted_kboard, kbd_queue)
9222 = Fcons (delayed_switch_frame, 9222 = Fcons (delayed_switch_frame,
9223 interrupted_kboard->kbd_queue); 9223 KVAR (interrupted_kboard, kbd_queue));
9224 delayed_switch_frame = Qnil; 9224 delayed_switch_frame = Qnil;
9225 } 9225 }
9226 9226
9227 while (t > 0) 9227 while (t > 0)
9228 interrupted_kboard->kbd_queue 9228 KVAR (interrupted_kboard, kbd_queue)
9229 = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); 9229 = Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue));
9230 9230
9231 /* If the side queue is non-empty, ensure it begins with a 9231 /* If the side queue is non-empty, ensure it begins with a
9232 switch-frame, so we'll replay it in the right context. */ 9232 switch-frame, so we'll replay it in the right context. */
9233 if (CONSP (interrupted_kboard->kbd_queue) 9233 if (CONSP (KVAR (interrupted_kboard, kbd_queue))
9234 && (key = XCAR (interrupted_kboard->kbd_queue), 9234 && (key = XCAR (KVAR (interrupted_kboard, kbd_queue)),
9235 !(EVENT_HAS_PARAMETERS (key) 9235 !(EVENT_HAS_PARAMETERS (key)
9236 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (key)), 9236 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (key)),
9237 Qswitch_frame)))) 9237 Qswitch_frame))))
9238 { 9238 {
9239 Lisp_Object frame; 9239 Lisp_Object frame;
9240 XSETFRAME (frame, interrupted_frame); 9240 XSETFRAME (frame, interrupted_frame);
9241 interrupted_kboard->kbd_queue 9241 KVAR (interrupted_kboard, kbd_queue)
9242 = Fcons (make_lispy_switch_frame (frame), 9242 = Fcons (make_lispy_switch_frame (frame),
9243 interrupted_kboard->kbd_queue); 9243 KVAR (interrupted_kboard, kbd_queue));
9244 } 9244 }
9245 mock_input = 0; 9245 mock_input = 0;
9246 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9246 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. */)
10115 10115
10116 if (NILP (special)) 10116 if (NILP (special))
10117 { 10117 {
10118 prefixarg = current_kboard->Vprefix_arg; 10118 prefixarg = KVAR (current_kboard, Vprefix_arg);
10119 Vcurrent_prefix_arg = prefixarg; 10119 Vcurrent_prefix_arg = prefixarg;
10120 current_kboard->Vprefix_arg = Qnil; 10120 KVAR (current_kboard, Vprefix_arg) = Qnil;
10121 } 10121 }
10122 else 10122 else
10123 prefixarg = Qnil; 10123 prefixarg = Qnil;
@@ -10251,7 +10251,7 @@ give to the command you invoke, if it asks for an argument. */)
10251 UNGCPRO; 10251 UNGCPRO;
10252 10252
10253 function = Fintern (function, Qnil); 10253 function = Fintern (function, Qnil);
10254 current_kboard->Vprefix_arg = prefixarg; 10254 KVAR (current_kboard, Vprefix_arg) = prefixarg;
10255 Vthis_command = function; 10255 Vthis_command = function;
10256 real_this_command = function; 10256 real_this_command = function;
10257 10257
@@ -10574,7 +10574,7 @@ DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
10574Also end any kbd macro being defined. */) 10574Also end any kbd macro being defined. */)
10575 (void) 10575 (void)
10576{ 10576{
10577 if (!NILP (current_kboard->defining_kbd_macro)) 10577 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
10578 { 10578 {
10579 /* Discard the last command from the macro. */ 10579 /* Discard the last command from the macro. */
10580 Fcancel_kbd_macro_events (); 10580 Fcancel_kbd_macro_events ();
@@ -11224,30 +11224,30 @@ The `posn-' functions access elements of such lists. */)
11224void 11224void
11225init_kboard (KBOARD *kb) 11225init_kboard (KBOARD *kb)
11226{ 11226{
11227 kb->Voverriding_terminal_local_map = Qnil; 11227 KVAR (kb, Voverriding_terminal_local_map) = Qnil;
11228 kb->Vlast_command = Qnil; 11228 KVAR (kb, Vlast_command) = Qnil;
11229 kb->Vreal_last_command = Qnil; 11229 KVAR (kb, Vreal_last_command) = Qnil;
11230 kb->Vkeyboard_translate_table = Qnil; 11230 KVAR (kb, Vkeyboard_translate_table) = Qnil;
11231 kb->Vlast_repeatable_command = Qnil; 11231 KVAR (kb, Vlast_repeatable_command) = Qnil;
11232 kb->Vprefix_arg = Qnil; 11232 KVAR (kb, Vprefix_arg) = Qnil;
11233 kb->Vlast_prefix_arg = Qnil; 11233 KVAR (kb, Vlast_prefix_arg) = Qnil;
11234 kb->kbd_queue = Qnil; 11234 KVAR (kb, kbd_queue) = Qnil;
11235 kb->kbd_queue_has_data = 0; 11235 kb->kbd_queue_has_data = 0;
11236 kb->immediate_echo = 0; 11236 kb->immediate_echo = 0;
11237 kb->echo_string = Qnil; 11237 KVAR (kb, echo_string) = Qnil;
11238 kb->echo_after_prompt = -1; 11238 kb->echo_after_prompt = -1;
11239 kb->kbd_macro_buffer = 0; 11239 kb->kbd_macro_buffer = 0;
11240 kb->kbd_macro_bufsize = 0; 11240 kb->kbd_macro_bufsize = 0;
11241 kb->defining_kbd_macro = Qnil; 11241 KVAR (kb, defining_kbd_macro) = Qnil;
11242 kb->Vlast_kbd_macro = Qnil; 11242 KVAR (kb, Vlast_kbd_macro) = Qnil;
11243 kb->reference_count = 0; 11243 kb->reference_count = 0;
11244 kb->Vsystem_key_alist = Qnil; 11244 KVAR (kb, Vsystem_key_alist) = Qnil;
11245 kb->system_key_syms = Qnil; 11245 KVAR (kb, system_key_syms) = Qnil;
11246 kb->Vwindow_system = Qt; /* Unset. */ 11246 KVAR (kb, Vwindow_system) = Qt; /* Unset. */
11247 kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil); 11247 KVAR (kb, Vinput_decode_map) = Fmake_sparse_keymap (Qnil);
11248 kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); 11248 KVAR (kb, Vlocal_function_key_map) = Fmake_sparse_keymap (Qnil);
11249 Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map); 11249 Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
11250 kb->Vdefault_minibuffer_frame = Qnil; 11250 KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
11251} 11251}
11252 11252
11253/* 11253/*
@@ -11323,7 +11323,7 @@ init_keyboard (void)
11323 init_kboard (current_kboard); 11323 init_kboard (current_kboard);
11324 /* A value of nil for Vwindow_system normally means a tty, but we also use 11324 /* A value of nil for Vwindow_system normally means a tty, but we also use
11325 it for the initial terminal since there is no window system there. */ 11325 it for the initial terminal since there is no window system there. */
11326 current_kboard->Vwindow_system = Qnil; 11326 KVAR (current_kboard, Vwindow_system) = Qnil;
11327 11327
11328 if (!noninteractive) 11328 if (!noninteractive)
11329 { 11329 {
@@ -12266,23 +12266,23 @@ mark_kboards (void)
12266 if (kb->kbd_macro_buffer) 12266 if (kb->kbd_macro_buffer)
12267 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++) 12267 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++)
12268 mark_object (*p); 12268 mark_object (*p);
12269 mark_object (kb->Voverriding_terminal_local_map); 12269 mark_object (KVAR (kb, Voverriding_terminal_local_map));
12270 mark_object (kb->Vlast_command); 12270 mark_object (KVAR (kb, Vlast_command));
12271 mark_object (kb->Vreal_last_command); 12271 mark_object (KVAR (kb, Vreal_last_command));
12272 mark_object (kb->Vkeyboard_translate_table); 12272 mark_object (KVAR (kb, Vkeyboard_translate_table));
12273 mark_object (kb->Vlast_repeatable_command); 12273 mark_object (KVAR (kb, Vlast_repeatable_command));
12274 mark_object (kb->Vprefix_arg); 12274 mark_object (KVAR (kb, Vprefix_arg));
12275 mark_object (kb->Vlast_prefix_arg); 12275 mark_object (KVAR (kb, Vlast_prefix_arg));
12276 mark_object (kb->kbd_queue); 12276 mark_object (KVAR (kb, kbd_queue));
12277 mark_object (kb->defining_kbd_macro); 12277 mark_object (KVAR (kb, defining_kbd_macro));
12278 mark_object (kb->Vlast_kbd_macro); 12278 mark_object (KVAR (kb, Vlast_kbd_macro));
12279 mark_object (kb->Vsystem_key_alist); 12279 mark_object (KVAR (kb, Vsystem_key_alist));
12280 mark_object (kb->system_key_syms); 12280 mark_object (KVAR (kb, system_key_syms));
12281 mark_object (kb->Vwindow_system); 12281 mark_object (KVAR (kb, Vwindow_system));
12282 mark_object (kb->Vinput_decode_map); 12282 mark_object (KVAR (kb, Vinput_decode_map));
12283 mark_object (kb->Vlocal_function_key_map); 12283 mark_object (KVAR (kb, Vlocal_function_key_map));
12284 mark_object (kb->Vdefault_minibuffer_frame); 12284 mark_object (KVAR (kb, Vdefault_minibuffer_frame));
12285 mark_object (kb->echo_string); 12285 mark_object (KVAR (kb, echo_string));
12286 } 12286 }
12287 { 12287 {
12288 struct input_event *event; 12288 struct input_event *event;
diff --git a/src/keyboard.h b/src/keyboard.h
index 7b3374ac3bd..10bf16d5c5c 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -19,6 +19,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#include "systime.h" /* for EMACS_TIME */ 19#include "systime.h" /* for EMACS_TIME */
20#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ 20#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
21 21
22/* Lisp fields in struct keyboard are hidden from most code and accessed
23 via the KVAR macro, below. Only select pieces of code, like the GC,
24 are allowed to use KBOARD_INTERNAL_FIELD. */
25#define KBOARD_INTERNAL_FIELD(field) field ## _
26
27/* Most code should use this macro to access Lisp fields in struct
28 kboard. */
29#define KVAR(kboard, field) ((kboard)->KBOARD_INTERNAL_FIELD (field))
30
22/* Each KBOARD represents one logical input stream from which Emacs 31/* Each KBOARD represents one logical input stream from which Emacs
23 gets input. If we are using ordinary terminals, it has one KBOARD 32 gets input. If we are using ordinary terminals, it has one KBOARD
24 object for each terminal device. 33 object for each terminal device.
@@ -70,32 +79,32 @@ struct kboard
70 can effectively wait for input in the any-kboard state, and hence 79 can effectively wait for input in the any-kboard state, and hence
71 avoid blocking out the other KBOARDs. See universal-argument in 80 avoid blocking out the other KBOARDs. See universal-argument in
72 lisp/simple.el for an example. */ 81 lisp/simple.el for an example. */
73 Lisp_Object Voverriding_terminal_local_map; 82 Lisp_Object KBOARD_INTERNAL_FIELD (Voverriding_terminal_local_map);
74 83
75 /* Last command executed by the editor command loop, not counting 84 /* Last command executed by the editor command loop, not counting
76 commands that set the prefix argument. */ 85 commands that set the prefix argument. */
77 Lisp_Object Vlast_command; 86 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_command);
78 87
79 /* Normally same as last-command, but never modified by other commands. */ 88 /* Normally same as last-command, but never modified by other commands. */
80 Lisp_Object Vreal_last_command; 89 Lisp_Object KBOARD_INTERNAL_FIELD (Vreal_last_command);
81 90
82 /* User-supplied table to translate input characters through. */ 91 /* User-supplied table to translate input characters through. */
83 Lisp_Object Vkeyboard_translate_table; 92 Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table);
84 93
85 /* Last command that may be repeated by `repeat'. */ 94 /* Last command that may be repeated by `repeat'. */
86 Lisp_Object Vlast_repeatable_command; 95 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command);
87 96
88 /* The prefix argument for the next command, in raw form. */ 97 /* The prefix argument for the next command, in raw form. */
89 Lisp_Object Vprefix_arg; 98 Lisp_Object KBOARD_INTERNAL_FIELD (Vprefix_arg);
90 99
91 /* Saved prefix argument for the last command, in raw form. */ 100 /* Saved prefix argument for the last command, in raw form. */
92 Lisp_Object Vlast_prefix_arg; 101 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_prefix_arg);
93 102
94 /* Unread events specific to this kboard. */ 103 /* Unread events specific to this kboard. */
95 Lisp_Object kbd_queue; 104 Lisp_Object KBOARD_INTERNAL_FIELD (kbd_queue);
96 105
97 /* Non-nil while a kbd macro is being defined. */ 106 /* Non-nil while a kbd macro is being defined. */
98 Lisp_Object defining_kbd_macro; 107 Lisp_Object KBOARD_INTERNAL_FIELD (defining_kbd_macro);
99 108
100 /* The start of storage for the current keyboard macro. */ 109 /* The start of storage for the current keyboard macro. */
101 Lisp_Object *kbd_macro_buffer; 110 Lisp_Object *kbd_macro_buffer;
@@ -117,28 +126,28 @@ struct kboard
117 int kbd_macro_bufsize; 126 int kbd_macro_bufsize;
118 127
119 /* Last anonymous kbd macro defined. */ 128 /* Last anonymous kbd macro defined. */
120 Lisp_Object Vlast_kbd_macro; 129 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_kbd_macro);
121 130
122 /* Alist of system-specific X windows key symbols. */ 131 /* Alist of system-specific X windows key symbols. */
123 Lisp_Object Vsystem_key_alist; 132 Lisp_Object KBOARD_INTERNAL_FIELD (Vsystem_key_alist);
124 133
125 /* Cache for modify_event_symbol. */ 134 /* Cache for modify_event_symbol. */
126 Lisp_Object system_key_syms; 135 Lisp_Object KBOARD_INTERNAL_FIELD (system_key_syms);
127 136
128 /* The kind of display: x, w32, ... */ 137 /* The kind of display: x, w32, ... */
129 Lisp_Object Vwindow_system; 138 Lisp_Object KBOARD_INTERNAL_FIELD (Vwindow_system);
130 139
131 /* Keymap mapping keys to alternative preferred forms. 140 /* Keymap mapping keys to alternative preferred forms.
132 See the DEFVAR for more documentation. */ 141 See the DEFVAR for more documentation. */
133 Lisp_Object Vlocal_function_key_map; 142 Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map);
134 143
135 /* Keymap mapping ASCII function key sequences onto their preferred 144 /* Keymap mapping ASCII function key sequences onto their preferred
136 forms. Initialized by the terminal-specific lisp files. See the 145 forms. Initialized by the terminal-specific lisp files. See the
137 DEFVAR for more documentation. */ 146 DEFVAR for more documentation. */
138 Lisp_Object Vinput_decode_map; 147 Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map);
139 148
140 /* Minibufferless frames on this display use this frame's minibuffer. */ 149 /* Minibufferless frames on this display use this frame's minibuffer. */
141 Lisp_Object Vdefault_minibuffer_frame; 150 Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame);
142 151
143 /* Number of displays using this KBOARD. Normally 1, but can be 152 /* Number of displays using this KBOARD. Normally 1, but can be
144 larger when you have multiple screens on a single X display. */ 153 larger when you have multiple screens on a single X display. */
@@ -146,7 +155,7 @@ struct kboard
146 155
147 /* The text we're echoing in the modeline - partial key sequences, 156 /* The text we're echoing in the modeline - partial key sequences,
148 usually. This is nil when not echoing. */ 157 usually. This is nil when not echoing. */
149 Lisp_Object echo_string; 158 Lisp_Object KBOARD_INTERNAL_FIELD (echo_string);
150 159
151 /* This flag indicates that events were put into kbd_queue 160 /* This flag indicates that events were put into kbd_queue
152 while Emacs was running for some other KBOARD. 161 while Emacs was running for some other KBOARD.
diff --git a/src/keymap.c b/src/keymap.c
index d9de2bc804b..0e4715e4b8b 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1565,8 +1565,8 @@ like in the respective argument of `key-binding'. */)
1565 1565
1566 if (!NILP (olp)) 1566 if (!NILP (olp))
1567 { 1567 {
1568 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 1568 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
1569 keymaps = Fcons (current_kboard->Voverriding_terminal_local_map, keymaps); 1569 keymaps = Fcons (KVAR (current_kboard, Voverriding_terminal_local_map), keymaps);
1570 /* The doc said that overriding-terminal-local-map should 1570 /* The doc said that overriding-terminal-local-map should
1571 override overriding-local-map. The code used them both, 1571 override overriding-local-map. The code used them both,
1572 but it seems clearer to use just one. rms, jan 2005. */ 1572 but it seems clearer to use just one. rms, jan 2005. */
@@ -1745,9 +1745,9 @@ specified buffer position instead of point are used.
1745 } 1745 }
1746 } 1746 }
1747 1747
1748 if (! NILP (current_kboard->Voverriding_terminal_local_map)) 1748 if (! NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
1749 { 1749 {
1750 value = Flookup_key (current_kboard->Voverriding_terminal_local_map, 1750 value = Flookup_key (KVAR (current_kboard, Voverriding_terminal_local_map),
1751 key, accept_default); 1751 key, accept_default);
1752 if (! NILP (value) && !INTEGERP (value)) 1752 if (! NILP (value) && !INTEGERP (value))
1753 goto done; 1753 goto done;
@@ -2941,11 +2941,11 @@ You type Translation\n\
2941 outbuf = Fcurrent_buffer (); 2941 outbuf = Fcurrent_buffer ();
2942 2942
2943 /* Report on alternates for keys. */ 2943 /* Report on alternates for keys. */
2944 if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix)) 2944 if (STRINGP (KVAR (current_kboard, Vkeyboard_translate_table)) && !NILP (prefix))
2945 { 2945 {
2946 int c; 2946 int c;
2947 const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table); 2947 const unsigned char *translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table));
2948 int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table); 2948 int translate_len = SCHARS (KVAR (current_kboard, Vkeyboard_translate_table));
2949 2949
2950 for (c = 0; c < translate_len; c++) 2950 for (c = 0; c < translate_len; c++)
2951 if (translate[c] != c) 2951 if (translate[c] != c)
@@ -2968,7 +2968,7 @@ You type Translation\n\
2968 insert ("\n", 1); 2968 insert ("\n", 1);
2969 2969
2970 /* Insert calls signal_after_change which may GC. */ 2970 /* Insert calls signal_after_change which may GC. */
2971 translate = SDATA (current_kboard->Vkeyboard_translate_table); 2971 translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table));
2972 } 2972 }
2973 2973
2974 insert ("\n", 1); 2974 insert ("\n", 1);
@@ -2981,8 +2981,8 @@ You type Translation\n\
2981 2981
2982 /* Print the (major mode) local map. */ 2982 /* Print the (major mode) local map. */
2983 start1 = Qnil; 2983 start1 = Qnil;
2984 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 2984 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
2985 start1 = current_kboard->Voverriding_terminal_local_map; 2985 start1 = KVAR (current_kboard, Voverriding_terminal_local_map);
2986 else if (!NILP (Voverriding_local_map)) 2986 else if (!NILP (Voverriding_local_map))
2987 start1 = Voverriding_local_map; 2987 start1 = Voverriding_local_map;
2988 2988
@@ -3064,13 +3064,13 @@ You type Translation\n\
3064 "\f\nGlobal Bindings", nomenu, 0, 1, 0); 3064 "\f\nGlobal Bindings", nomenu, 0, 1, 0);
3065 3065
3066 /* Print the function-key-map translations under this prefix. */ 3066 /* Print the function-key-map translations under this prefix. */
3067 if (!NILP (current_kboard->Vlocal_function_key_map)) 3067 if (!NILP (KVAR (current_kboard, Vlocal_function_key_map)))
3068 describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix, 3068 describe_map_tree (KVAR (current_kboard, Vlocal_function_key_map), 0, Qnil, prefix,
3069 "\f\nFunction key map translations", nomenu, 1, 0, 0); 3069 "\f\nFunction key map translations", nomenu, 1, 0, 0);
3070 3070
3071 /* Print the input-decode-map translations under this prefix. */ 3071 /* Print the input-decode-map translations under this prefix. */
3072 if (!NILP (current_kboard->Vinput_decode_map)) 3072 if (!NILP (KVAR (current_kboard, Vinput_decode_map)))
3073 describe_map_tree (current_kboard->Vinput_decode_map, 0, Qnil, prefix, 3073 describe_map_tree (KVAR (current_kboard, Vinput_decode_map), 0, Qnil, prefix,
3074 "\f\nInput decoding map translations", nomenu, 1, 0, 0); 3074 "\f\nInput decoding map translations", nomenu, 1, 0, 0);
3075 3075
3076 UNGCPRO; 3076 UNGCPRO;
diff --git a/src/lisp.h b/src/lisp.h
index b82f1b2f722..7cc2a8e7d45 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1890,7 +1890,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1890 static struct Lisp_Kboard_Objfwd ko_fwd; \ 1890 static struct Lisp_Kboard_Objfwd ko_fwd; \
1891 defvar_kboard (&ko_fwd, \ 1891 defvar_kboard (&ko_fwd, \
1892 lname, \ 1892 lname, \
1893 (int)((char *)(&current_kboard->vname) \ 1893 (int)((char *)(&current_kboard->vname ## _) \
1894 - (char *)current_kboard)); \ 1894 - (char *)current_kboard)); \
1895 } while (0) 1895 } while (0)
1896 1896
diff --git a/src/macros.c b/src/macros.c
index 34ac08c3284..d90b31b503f 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -56,7 +56,7 @@ If optional second arg, NO-EXEC, is non-nil, do not re-execute last
56macro before appending to it. */) 56macro before appending to it. */)
57 (Lisp_Object append, Lisp_Object no_exec) 57 (Lisp_Object append, Lisp_Object no_exec)
58{ 58{
59 if (!NILP (current_kboard->defining_kbd_macro)) 59 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
60 error ("Already defining kbd macro"); 60 error ("Already defining kbd macro");
61 61
62 if (!current_kboard->kbd_macro_buffer) 62 if (!current_kboard->kbd_macro_buffer)
@@ -85,9 +85,9 @@ macro before appending to it. */)
85 int cvt; 85 int cvt;
86 86
87 /* Check the type of last-kbd-macro in case Lisp code changed it. */ 87 /* Check the type of last-kbd-macro in case Lisp code changed it. */
88 CHECK_VECTOR_OR_STRING (current_kboard->Vlast_kbd_macro); 88 CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
89 89
90 len = XINT (Flength (current_kboard->Vlast_kbd_macro)); 90 len = XINT (Flength (KVAR (current_kboard, Vlast_kbd_macro)));
91 91
92 /* Copy last-kbd-macro into the buffer, in case the Lisp code 92 /* Copy last-kbd-macro into the buffer, in case the Lisp code
93 has put another macro there. */ 93 has put another macro there. */
@@ -100,11 +100,11 @@ macro before appending to it. */)
100 } 100 }
101 101
102 /* Must convert meta modifier when copying string to vector. */ 102 /* Must convert meta modifier when copying string to vector. */
103 cvt = STRINGP (current_kboard->Vlast_kbd_macro); 103 cvt = STRINGP (KVAR (current_kboard, Vlast_kbd_macro));
104 for (i = 0; i < len; i++) 104 for (i = 0; i < len; i++)
105 { 105 {
106 Lisp_Object c; 106 Lisp_Object c;
107 c = Faref (current_kboard->Vlast_kbd_macro, make_number (i)); 107 c = Faref (KVAR (current_kboard, Vlast_kbd_macro), make_number (i));
108 if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80)) 108 if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80))
109 XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80)); 109 XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
110 current_kboard->kbd_macro_buffer[i] = c; 110 current_kboard->kbd_macro_buffer[i] = c;
@@ -116,12 +116,12 @@ macro before appending to it. */)
116 /* Re-execute the macro we are appending to, 116 /* Re-execute the macro we are appending to,
117 for consistency of behavior. */ 117 for consistency of behavior. */
118 if (NILP (no_exec)) 118 if (NILP (no_exec))
119 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, 119 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro),
120 make_number (1), Qnil); 120 make_number (1), Qnil);
121 121
122 message ("Appending to kbd macro..."); 122 message ("Appending to kbd macro...");
123 } 123 }
124 current_kboard->defining_kbd_macro = Qt; 124 KVAR (current_kboard, defining_kbd_macro) = Qt;
125 125
126 return Qnil; 126 return Qnil;
127} 127}
@@ -131,9 +131,9 @@ macro before appending to it. */)
131void 131void
132end_kbd_macro (void) 132end_kbd_macro (void)
133{ 133{
134 current_kboard->defining_kbd_macro = Qnil; 134 KVAR (current_kboard, defining_kbd_macro) = Qnil;
135 update_mode_lines++; 135 update_mode_lines++;
136 current_kboard->Vlast_kbd_macro 136 KVAR (current_kboard, Vlast_kbd_macro)
137 = make_event_array ((current_kboard->kbd_macro_end 137 = make_event_array ((current_kboard->kbd_macro_end
138 - current_kboard->kbd_macro_buffer), 138 - current_kboard->kbd_macro_buffer),
139 current_kboard->kbd_macro_buffer); 139 current_kboard->kbd_macro_buffer);
@@ -154,7 +154,7 @@ In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
154each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) 154each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
155 (Lisp_Object repeat, Lisp_Object loopfunc) 155 (Lisp_Object repeat, Lisp_Object loopfunc)
156{ 156{
157 if (NILP (current_kboard->defining_kbd_macro)) 157 if (NILP (KVAR (current_kboard, defining_kbd_macro)))
158 error ("Not defining kbd macro"); 158 error ("Not defining kbd macro");
159 159
160 if (NILP (repeat)) 160 if (NILP (repeat))
@@ -162,19 +162,19 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
162 else 162 else
163 CHECK_NUMBER (repeat); 163 CHECK_NUMBER (repeat);
164 164
165 if (!NILP (current_kboard->defining_kbd_macro)) 165 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
166 { 166 {
167 end_kbd_macro (); 167 end_kbd_macro ();
168 message ("Keyboard macro defined"); 168 message ("Keyboard macro defined");
169 } 169 }
170 170
171 if (XFASTINT (repeat) == 0) 171 if (XFASTINT (repeat) == 0)
172 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); 172 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
173 else 173 else
174 { 174 {
175 XSETINT (repeat, XINT (repeat)-1); 175 XSETINT (repeat, XINT (repeat)-1);
176 if (XINT (repeat) > 0) 176 if (XINT (repeat) > 0)
177 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); 177 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
178 } 178 }
179 return Qnil; 179 return Qnil;
180} 180}
@@ -186,7 +186,7 @@ store_kbd_macro_char (Lisp_Object c)
186{ 186{
187 struct kboard *kb = current_kboard; 187 struct kboard *kb = current_kboard;
188 188
189 if (!NILP (kb->defining_kbd_macro)) 189 if (!NILP (KVAR (kb, defining_kbd_macro)))
190 { 190 {
191 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) 191 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize)
192 { 192 {
@@ -248,21 +248,21 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
248{ 248{
249 /* Don't interfere with recognition of the previous command 249 /* Don't interfere with recognition of the previous command
250 from before this macro started. */ 250 from before this macro started. */
251 Vthis_command = current_kboard->Vlast_command; 251 Vthis_command = KVAR (current_kboard, Vlast_command);
252 /* C-x z after the macro should repeat the macro. */ 252 /* C-x z after the macro should repeat the macro. */
253 real_this_command = current_kboard->Vlast_kbd_macro; 253 real_this_command = KVAR (current_kboard, Vlast_kbd_macro);
254 254
255 if (! NILP (current_kboard->defining_kbd_macro)) 255 if (! NILP (KVAR (current_kboard, defining_kbd_macro)))
256 error ("Can't execute anonymous macro while defining one"); 256 error ("Can't execute anonymous macro while defining one");
257 else if (NILP (current_kboard->Vlast_kbd_macro)) 257 else if (NILP (KVAR (current_kboard, Vlast_kbd_macro)))
258 error ("No kbd macro has been defined"); 258 error ("No kbd macro has been defined");
259 else 259 else
260 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, prefix, loopfunc); 260 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), prefix, loopfunc);
261 261
262 /* command_loop_1 sets this to nil before it returns; 262 /* command_loop_1 sets this to nil before it returns;
263 get back the last command within the macro 263 get back the last command within the macro
264 so that it can be last, again, after we return. */ 264 so that it can be last, again, after we return. */
265 Vthis_command = current_kboard->Vlast_command; 265 Vthis_command = KVAR (current_kboard, Vlast_command);
266 266
267 return Qnil; 267 return Qnil;
268} 268}
@@ -322,7 +322,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
322 executing_kbd_macro = final; 322 executing_kbd_macro = final;
323 executing_kbd_macro_index = 0; 323 executing_kbd_macro_index = 0;
324 324
325 current_kboard->Vprefix_arg = Qnil; 325 KVAR (current_kboard, Vprefix_arg) = Qnil;
326 326
327 if (!NILP (loopfunc)) 327 if (!NILP (loopfunc))
328 { 328 {
diff --git a/src/term.c b/src/term.c
index 1aefe02421f..21ed163c934 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1350,14 +1350,14 @@ term_get_fkeys_1 (void)
1350 KBOARD *kboard = term_get_fkeys_kboard; 1350 KBOARD *kboard = term_get_fkeys_kboard;
1351 1351
1352 /* This can happen if CANNOT_DUMP or with strange options. */ 1352 /* This can happen if CANNOT_DUMP or with strange options. */
1353 if (!KEYMAPP (kboard->Vinput_decode_map)) 1353 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
1354 kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil); 1354 KVAR (kboard, Vinput_decode_map) = Fmake_sparse_keymap (Qnil);
1355 1355
1356 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) 1356 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
1357 { 1357 {
1358 char *sequence = tgetstr (keys[i].cap, address); 1358 char *sequence = tgetstr (keys[i].cap, address);
1359 if (sequence) 1359 if (sequence)
1360 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), 1360 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1361 Fmake_vector (make_number (1), 1361 Fmake_vector (make_number (1),
1362 intern (keys[i].name))); 1362 intern (keys[i].name)));
1363 } 1363 }
@@ -1377,13 +1377,13 @@ term_get_fkeys_1 (void)
1377 if (k0) 1377 if (k0)
1378 /* Define f0 first, so that f10 takes precedence in case the 1378 /* Define f0 first, so that f10 takes precedence in case the
1379 key sequences happens to be the same. */ 1379 key sequences happens to be the same. */
1380 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), 1380 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1381 Fmake_vector (make_number (1), intern ("f0"))); 1381 Fmake_vector (make_number (1), intern ("f0")));
1382 Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi), 1382 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k_semi),
1383 Fmake_vector (make_number (1), intern ("f10"))); 1383 Fmake_vector (make_number (1), intern ("f10")));
1384 } 1384 }
1385 else if (k0) 1385 else if (k0)
1386 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), 1386 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1387 Fmake_vector (make_number (1), intern (k0_name))); 1387 Fmake_vector (make_number (1), intern (k0_name)));
1388 } 1388 }
1389 1389
@@ -1406,7 +1406,7 @@ term_get_fkeys_1 (void)
1406 if (sequence) 1406 if (sequence)
1407 { 1407 {
1408 sprintf (fkey, "f%d", i); 1408 sprintf (fkey, "f%d", i);
1409 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), 1409 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1410 Fmake_vector (make_number (1), 1410 Fmake_vector (make_number (1),
1411 intern (fkey))); 1411 intern (fkey)));
1412 } 1412 }
@@ -1423,7 +1423,7 @@ term_get_fkeys_1 (void)
1423 { \ 1423 { \
1424 char *sequence = tgetstr (cap2, address); \ 1424 char *sequence = tgetstr (cap2, address); \
1425 if (sequence) \ 1425 if (sequence) \
1426 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \ 1426 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), \
1427 Fmake_vector (make_number (1), \ 1427 Fmake_vector (make_number (1), \
1428 intern (sym))); \ 1428 intern (sym))); \
1429 } 1429 }
@@ -3418,7 +3418,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3418 3418
3419 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 3419 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
3420 init_kboard (terminal->kboard); 3420 init_kboard (terminal->kboard);
3421 terminal->kboard->Vwindow_system = Qnil; 3421 KVAR (terminal->kboard, Vwindow_system) = Qnil;
3422 terminal->kboard->next_kboard = all_kboards; 3422 terminal->kboard->next_kboard = all_kboards;
3423 all_kboards = terminal->kboard; 3423 all_kboards = terminal->kboard;
3424 terminal->kboard->reference_count++; 3424 terminal->kboard->reference_count++;
diff --git a/src/window.c b/src/window.c
index 675a493e18e..7965269f0e7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4834,8 +4834,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4834 possibility of point becoming "stuck" on a tall line when 4834 possibility of point becoming "stuck" on a tall line when
4835 scrolling by one line. */ 4835 scrolling by one line. */
4836 if (window_scroll_pixel_based_preserve_y < 0 4836 if (window_scroll_pixel_based_preserve_y < 0
4837 || !SYMBOLP (current_kboard->Vlast_command) 4837 || !SYMBOLP (KVAR (current_kboard, Vlast_command))
4838 || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) 4838 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
4839 { 4839 {
4840 start_display (&it, w, start); 4840 start_display (&it, w, start);
4841 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4841 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
@@ -5091,8 +5091,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
5091 if (!NILP (Vscroll_preserve_screen_position)) 5091 if (!NILP (Vscroll_preserve_screen_position))
5092 { 5092 {
5093 if (window_scroll_preserve_vpos <= 0 5093 if (window_scroll_preserve_vpos <= 0
5094 || !SYMBOLP (current_kboard->Vlast_command) 5094 || !SYMBOLP (KVAR (current_kboard, Vlast_command))
5095 || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) 5095 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
5096 { 5096 {
5097 struct position posit 5097 struct position posit
5098 = *compute_motion (startpos, 0, 0, 0, 5098 = *compute_motion (startpos, 0, 0, 0,
diff --git a/src/xfns.c b/src/xfns.c
index d8d4a8ca772..deb0e192a54 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3473,9 +3473,9 @@ This function is an internal primitive--use `make-frame' instead. */)
3473 /* Initialize `default-minibuffer-frame' in case this is the first 3473 /* Initialize `default-minibuffer-frame' in case this is the first
3474 frame on this terminal. */ 3474 frame on this terminal. */
3475 if (FRAME_HAS_MINIBUF_P (f) 3475 if (FRAME_HAS_MINIBUF_P (f)
3476 && (!FRAMEP (kb->Vdefault_minibuffer_frame) 3476 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
3477 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) 3477 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
3478 kb->Vdefault_minibuffer_frame = frame; 3478 KVAR (kb, Vdefault_minibuffer_frame) = frame;
3479 3479
3480 /* All remaining specified parameters, which have not been "used" 3480 /* All remaining specified parameters, which have not been "used"
3481 by x_get_arg and friends, now go in the misc. alist of the frame. */ 3481 by x_get_arg and friends, now go in the misc. alist of the frame. */
diff --git a/src/xterm.c b/src/xterm.c
index 52d79e8dad7..909b6978f5a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7727,7 +7727,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7727 { 7727 {
7728 /* Set this to t so that delete_frame won't get confused 7728 /* Set this to t so that delete_frame won't get confused
7729 trying to find a replacement. */ 7729 trying to find a replacement. */
7730 FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt; 7730 KVAR (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame) = Qt;
7731 delete_frame (frame, Qnoelisp); 7731 delete_frame (frame, Qnoelisp);
7732 } 7732 }
7733 7733
@@ -9966,7 +9966,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9966 { 9966 {
9967 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 9967 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
9968 init_kboard (terminal->kboard); 9968 init_kboard (terminal->kboard);
9969 terminal->kboard->Vwindow_system = Qx; 9969 KVAR (terminal->kboard, Vwindow_system) = Qx;
9970 9970
9971 /* Add the keyboard to the list before running Lisp code (via 9971 /* Add the keyboard to the list before running Lisp code (via
9972 Qvendor_specific_keysyms below), since these are not traced 9972 Qvendor_specific_keysyms below), since these are not traced
@@ -9988,7 +9988,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9988 /* Temporarily hide the partially initialized terminal. */ 9988 /* Temporarily hide the partially initialized terminal. */
9989 terminal_list = terminal->next_terminal; 9989 terminal_list = terminal->next_terminal;
9990 UNBLOCK_INPUT; 9990 UNBLOCK_INPUT;
9991 terminal->kboard->Vsystem_key_alist 9991 KVAR (terminal->kboard, Vsystem_key_alist)
9992 = call1 (Qvendor_specific_keysyms, 9992 = call1 (Qvendor_specific_keysyms,
9993 vendor ? build_string (vendor) : empty_unibyte_string); 9993 vendor ? build_string (vendor) : empty_unibyte_string);
9994 BLOCK_INPUT; 9994 BLOCK_INPUT;