aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-13 07:44:27 +0400
committerDmitry Antipov2012-08-13 07:44:27 +0400
commit7864a3f729e9bd78f17deefec428a6db41742c82 (patch)
tree35be2792b8dc2716b43b096ff81d4f107427a158 /src
parent4c31be6153255dfe29a0231253263ea0d9011ac3 (diff)
downloademacs-7864a3f729e9bd78f17deefec428a6db41742c82.tar.gz
emacs-7864a3f729e9bd78f17deefec428a6db41742c82.zip
Use KSET for write access to Lisp_Object members of struct kboard.
* keyboard.h (KSET): New macro. * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c: * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c: * xterm.c: Adjust users.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/callint.c4
-rw-r--r--src/category.c2
-rw-r--r--src/frame.c10
-rw-r--r--src/keyboard.c123
-rw-r--r--src/keyboard.h1
-rw-r--r--src/macros.c14
-rw-r--r--src/msdos.c2
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsterm.m2
-rw-r--r--src/term.c4
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32term.c2
-rw-r--r--src/xfns.c2
-rw-r--r--src/xterm.c10
15 files changed, 98 insertions, 90 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 606b3fe64a3..a30c5af1eb9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12012-08-13 Dmitry Antipov <dmantipov@yandex.ru> 12012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Use KSET for write access to Lisp_Object members of struct kboard.
4 * keyboard.h (KSET): New macro.
5 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7 * xterm.c: Adjust users.
8
92012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
10
3 Use BSET for write access to Lisp_Object members of struct buffer. 11 Use BSET for write access to Lisp_Object members of struct buffer.
4 * buffer.h (BSET): New macro. 12 * buffer.h (BSET): New macro.
5 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c: 13 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
diff --git a/src/callint.c b/src/callint.c
index 51d0a5fa2e8..e0133864674 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -372,7 +372,7 @@ invoke it. If KEYS is omitted or nil, the return value of
372 Vthis_command = save_this_command; 372 Vthis_command = save_this_command;
373 Vthis_original_command = save_this_original_command; 373 Vthis_original_command = save_this_original_command;
374 Vreal_this_command = save_real_this_command; 374 Vreal_this_command = save_real_this_command;
375 KVAR (current_kboard, Vlast_command) = save_last_command; 375 KSET (current_kboard, Vlast_command, save_last_command);
376 376
377 temporarily_switch_to_single_kboard (NULL); 377 temporarily_switch_to_single_kboard (NULL);
378 return unbind_to (speccount, apply1 (function, specs)); 378 return unbind_to (speccount, apply1 (function, specs));
@@ -843,7 +843,7 @@ invoke it. If KEYS is omitted or nil, the return value of
843 Vthis_command = save_this_command; 843 Vthis_command = save_this_command;
844 Vthis_original_command = save_this_original_command; 844 Vthis_original_command = save_this_original_command;
845 Vreal_this_command = save_real_this_command; 845 Vreal_this_command = save_real_this_command;
846 KVAR (current_kboard, Vlast_command) = save_last_command; 846 KSET (current_kboard, Vlast_command, save_last_command);
847 847
848 { 848 {
849 Lisp_Object val; 849 Lisp_Object val;
diff --git a/src/category.c b/src/category.c
index 507f880a0ad..13c6e46d283 100644
--- a/src/category.c
+++ b/src/category.c
@@ -285,7 +285,7 @@ Return TABLE. */)
285{ 285{
286 int idx; 286 int idx;
287 table = check_category_table (table); 287 table = check_category_table (table);
288 BVAR (current_buffer, category_table) = table; 288 BSET (current_buffer, category_table, table);
289 /* Indicate that this buffer now has a specified category table. */ 289 /* Indicate that this buffer now has a specified category table. */
290 idx = PER_BUFFER_VAR_IDX (category_table); 290 idx = PER_BUFFER_VAR_IDX (category_table);
291 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); 291 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
diff --git a/src/frame.c b/src/frame.c
index 768cec4c7e7..b2990929058 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -393,8 +393,8 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
393 XSETFRAME (frame_dummy, f); 393 XSETFRAME (frame_dummy, f);
394 GCPRO1 (frame_dummy); 394 GCPRO1 (frame_dummy);
395 /* If there's no minibuffer frame to use, create one. */ 395 /* If there's no minibuffer frame to use, create one. */
396 KVAR (kb, Vdefault_minibuffer_frame) = 396 KSET (kb, Vdefault_minibuffer_frame,
397 call1 (intern ("make-initial-minibuffer-frame"), display); 397 call1 (intern ("make-initial-minibuffer-frame"), display));
398 UNGCPRO; 398 UNGCPRO;
399 } 399 }
400 400
@@ -843,7 +843,7 @@ to that frame. */)
843 (Lisp_Object event) 843 (Lisp_Object event)
844{ 844{
845 /* Preserve prefix arg that the command loop just cleared. */ 845 /* Preserve prefix arg that the command loop just cleared. */
846 KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg; 846 KSET (current_kboard, Vprefix_arg, Vcurrent_prefix_arg);
847 Frun_hooks (1, &Qmouse_leave_buffer_hook); 847 Frun_hooks (1, &Qmouse_leave_buffer_hook);
848 return do_switch_frame (event, 0, 0, Qnil); 848 return do_switch_frame (event, 0, 0, Qnil);
849} 849}
@@ -1435,11 +1435,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1435 if (NILP (frame_with_minibuf)) 1435 if (NILP (frame_with_minibuf))
1436 abort (); 1436 abort ();
1437 1437
1438 KVAR (kb, Vdefault_minibuffer_frame) = frame_with_minibuf; 1438 KSET (kb, Vdefault_minibuffer_frame, frame_with_minibuf);
1439 } 1439 }
1440 else 1440 else
1441 /* No frames left on this kboard--say no minibuffer either. */ 1441 /* No frames left on this kboard--say no minibuffer either. */
1442 KVAR (kb, Vdefault_minibuffer_frame) = Qnil; 1442 KSET (kb, Vdefault_minibuffer_frame, Qnil);
1443 } 1443 }
1444 1444
1445 /* Cause frame titles to update--necessary if we now have just one frame. */ 1445 /* Cause frame titles to update--necessary if we now have just one frame. */
diff --git a/src/keyboard.c b/src/keyboard.c
index bf4125f055b..5ed1f9f2c69 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -551,8 +551,8 @@ echo_char (Lisp_Object c)
551 else if (STRINGP (echo_string)) 551 else if (STRINGP (echo_string))
552 echo_string = concat2 (echo_string, build_string (" ")); 552 echo_string = concat2 (echo_string, build_string (" "));
553 553
554 KVAR (current_kboard, echo_string) 554 KSET (current_kboard, echo_string,
555 = concat2 (echo_string, make_string (buffer, ptr - buffer)); 555 concat2 (echo_string, make_string (buffer, ptr - buffer)));
556 556
557 echo_now (); 557 echo_now ();
558 } 558 }
@@ -597,8 +597,8 @@ echo_dash (void)
597 597
598 /* Put a dash at the end of the buffer temporarily, 598 /* Put a dash at the end of the buffer temporarily,
599 but make it go away when the next character is added. */ 599 but make it go away when the next character is added. */
600 KVAR (current_kboard, echo_string) = concat2 (KVAR (current_kboard, echo_string), 600 KSET (current_kboard, echo_string,
601 build_string ("-")); 601 concat2 (KVAR (current_kboard, echo_string), build_string ("-")));
602 echo_now (); 602 echo_now ();
603} 603}
604 604
@@ -660,7 +660,7 @@ cancel_echoing (void)
660{ 660{
661 current_kboard->immediate_echo = 0; 661 current_kboard->immediate_echo = 0;
662 current_kboard->echo_after_prompt = -1; 662 current_kboard->echo_after_prompt = -1;
663 KVAR (current_kboard, echo_string) = Qnil; 663 KSET (current_kboard, echo_string, Qnil);
664 ok_to_echo_at_next_pause = NULL; 664 ok_to_echo_at_next_pause = NULL;
665 echo_kboard = NULL; 665 echo_kboard = NULL;
666 echo_message_buffer = Qnil; 666 echo_message_buffer = Qnil;
@@ -684,9 +684,9 @@ static void
684echo_truncate (ptrdiff_t nchars) 684echo_truncate (ptrdiff_t nchars)
685{ 685{
686 if (STRINGP (KVAR (current_kboard, echo_string))) 686 if (STRINGP (KVAR (current_kboard, echo_string)))
687 KVAR (current_kboard, echo_string) 687 KSET (current_kboard, echo_string,
688 = Fsubstring (KVAR (current_kboard, echo_string), 688 Fsubstring (KVAR (current_kboard, echo_string),
689 make_number (0), make_number (nchars)); 689 make_number (0), make_number (nchars)));
690 truncate_echo_area (nchars); 690 truncate_echo_area (nchars);
691} 691}
692 692
@@ -1016,8 +1016,8 @@ cmd_error (Lisp_Object data)
1016 Vstandard_input = Qt; 1016 Vstandard_input = Qt;
1017 Vexecuting_kbd_macro = Qnil; 1017 Vexecuting_kbd_macro = Qnil;
1018 executing_kbd_macro = Qnil; 1018 executing_kbd_macro = Qnil;
1019 KVAR (current_kboard, Vprefix_arg) = Qnil; 1019 KSET (current_kboard, Vprefix_arg, Qnil);
1020 KVAR (current_kboard, Vlast_prefix_arg) = Qnil; 1020 KSET (current_kboard, Vlast_prefix_arg, Qnil);
1021 cancel_echoing (); 1021 cancel_echoing ();
1022 1022
1023 /* Avoid unquittable loop if data contains a circular list. */ 1023 /* Avoid unquittable loop if data contains a circular list. */
@@ -1338,8 +1338,8 @@ command_loop_1 (void)
1338#endif 1338#endif
1339 int already_adjusted = 0; 1339 int already_adjusted = 0;
1340 1340
1341 KVAR (current_kboard, Vprefix_arg) = Qnil; 1341 KSET (current_kboard, Vprefix_arg, Qnil);
1342 KVAR (current_kboard, Vlast_prefix_arg) = Qnil; 1342 KSET (current_kboard, Vlast_prefix_arg, Qnil);
1343 Vdeactivate_mark = Qnil; 1343 Vdeactivate_mark = Qnil;
1344 waiting_for_input = 0; 1344 waiting_for_input = 0;
1345 cancel_echoing (); 1345 cancel_echoing ();
@@ -1371,10 +1371,10 @@ command_loop_1 (void)
1371 } 1371 }
1372 1372
1373 /* Do this after running Vpost_command_hook, for consistency. */ 1373 /* Do this after running Vpost_command_hook, for consistency. */
1374 KVAR (current_kboard, Vlast_command) = Vthis_command; 1374 KSET (current_kboard, Vlast_command, Vthis_command);
1375 KVAR (current_kboard, Vreal_last_command) = Vreal_this_command; 1375 KSET (current_kboard, Vreal_last_command, Vreal_this_command);
1376 if (!CONSP (last_command_event)) 1376 if (!CONSP (last_command_event))
1377 KVAR (current_kboard, Vlast_repeatable_command) = Vreal_this_command; 1377 KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command);
1378 1378
1379 while (1) 1379 while (1)
1380 { 1380 {
@@ -1537,7 +1537,7 @@ command_loop_1 (void)
1537 keys = Fkey_description (keys, Qnil); 1537 keys = Fkey_description (keys, Qnil);
1538 bitch_at_user (); 1538 bitch_at_user ();
1539 message_with_string ("%s is undefined", keys, 0); 1539 message_with_string ("%s is undefined", keys, 0);
1540 KVAR (current_kboard, defining_kbd_macro) = Qnil; 1540 KSET (current_kboard, defining_kbd_macro, Qnil);
1541 update_mode_lines = 1; 1541 update_mode_lines = 1;
1542 /* If this is a down-mouse event, don't reset prefix-arg; 1542 /* If this is a down-mouse event, don't reset prefix-arg;
1543 pass it to the command run by the up event. */ 1543 pass it to the command run by the up event. */
@@ -1547,10 +1547,10 @@ command_loop_1 (void)
1547 = parse_modifiers (EVENT_HEAD (last_command_event)); 1547 = parse_modifiers (EVENT_HEAD (last_command_event));
1548 int modifiers = XINT (XCAR (XCDR (breakdown))); 1548 int modifiers = XINT (XCAR (XCDR (breakdown)));
1549 if (!(modifiers & down_modifier)) 1549 if (!(modifiers & down_modifier))
1550 KVAR (current_kboard, Vprefix_arg) = Qnil; 1550 KSET (current_kboard, Vprefix_arg, Qnil);
1551 } 1551 }
1552 else 1552 else
1553 KVAR (current_kboard, Vprefix_arg) = Qnil; 1553 KSET (current_kboard, Vprefix_arg, Qnil);
1554 } 1554 }
1555 else 1555 else
1556 { 1556 {
@@ -1587,7 +1587,7 @@ command_loop_1 (void)
1587 unbind_to (scount, Qnil); 1587 unbind_to (scount, Qnil);
1588#endif 1588#endif
1589 } 1589 }
1590 KVAR (current_kboard, Vlast_prefix_arg) = Vcurrent_prefix_arg; 1590 KSET (current_kboard, Vlast_prefix_arg, Vcurrent_prefix_arg);
1591 1591
1592 safe_run_hooks (Qpost_command_hook); 1592 safe_run_hooks (Qpost_command_hook);
1593 1593
@@ -1618,11 +1618,10 @@ command_loop_1 (void)
1618 if (NILP (KVAR (current_kboard, Vprefix_arg)) 1618 if (NILP (KVAR (current_kboard, Vprefix_arg))
1619 || CONSP (last_command_event)) 1619 || CONSP (last_command_event))
1620 { 1620 {
1621 KVAR (current_kboard, Vlast_command) = Vthis_command; 1621 KSET (current_kboard, Vlast_command, Vthis_command);
1622 KVAR (current_kboard, Vreal_last_command) = Vreal_this_command; 1622 KSET (current_kboard, Vreal_last_command, Vreal_this_command);
1623 if (!CONSP (last_command_event)) 1623 if (!CONSP (last_command_event))
1624 KVAR (current_kboard, Vlast_repeatable_command) 1624 KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command);
1625 = Vreal_this_command;
1626 cancel_echoing (); 1625 cancel_echoing ();
1627 this_command_key_count = 0; 1626 this_command_key_count = 0;
1628 this_command_key_count_reset = 0; 1627 this_command_key_count_reset = 0;
@@ -2565,7 +2564,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2565 abort (); 2564 abort ();
2566 } 2565 }
2567 if (!CONSP (last)) 2566 if (!CONSP (last))
2568 KVAR (kb, kbd_queue) = Fcons (c, Qnil); 2567 KSET (kb, kbd_queue, Fcons (c, Qnil));
2569 else 2568 else
2570 XSETCDR (last, Fcons (c, Qnil)); 2569 XSETCDR (last, Fcons (c, Qnil));
2571 kb->kbd_queue_has_data = 1; 2570 kb->kbd_queue_has_data = 1;
@@ -2737,8 +2736,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2737 if (!CONSP (KVAR (current_kboard, kbd_queue))) 2736 if (!CONSP (KVAR (current_kboard, kbd_queue)))
2738 abort (); 2737 abort ();
2739 c = XCAR (KVAR (current_kboard, kbd_queue)); 2738 c = XCAR (KVAR (current_kboard, kbd_queue));
2740 KVAR (current_kboard, kbd_queue) 2739 KSET (current_kboard, kbd_queue,
2741 = XCDR (KVAR (current_kboard, kbd_queue)); 2740 XCDR (KVAR (current_kboard, kbd_queue)));
2742 if (NILP (KVAR (current_kboard, kbd_queue))) 2741 if (NILP (KVAR (current_kboard, kbd_queue)))
2743 current_kboard->kbd_queue_has_data = 0; 2742 current_kboard->kbd_queue_has_data = 0;
2744 input_pending = readable_events (0); 2743 input_pending = readable_events (0);
@@ -2805,7 +2804,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2805 abort (); 2804 abort ();
2806 } 2805 }
2807 if (!CONSP (last)) 2806 if (!CONSP (last))
2808 KVAR (kb, kbd_queue) = Fcons (c, Qnil); 2807 KSET (kb, kbd_queue, Fcons (c, Qnil));
2809 else 2808 else
2810 XSETCDR (last, Fcons (c, Qnil)); 2809 XSETCDR (last, Fcons (c, Qnil));
2811 kb->kbd_queue_has_data = 1; 2810 kb->kbd_queue_has_data = 1;
@@ -3063,7 +3062,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
3063 3062
3064 cancel_echoing (); 3063 cancel_echoing ();
3065 ok_to_echo_at_next_pause = saved_ok_to_echo; 3064 ok_to_echo_at_next_pause = saved_ok_to_echo;
3066 KVAR (current_kboard, echo_string) = saved_echo_string; 3065 KSET (current_kboard, echo_string, saved_echo_string);
3067 current_kboard->echo_after_prompt = saved_echo_after_prompt; 3066 current_kboard->echo_after_prompt = saved_echo_after_prompt;
3068 if (saved_immediate_echo) 3067 if (saved_immediate_echo)
3069 echo_now (); 3068 echo_now ();
@@ -3534,9 +3533,9 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3534 3533
3535 if (single_kboard && kb != current_kboard) 3534 if (single_kboard && kb != current_kboard)
3536 { 3535 {
3537 KVAR (kb, kbd_queue) 3536 KSET (kb, kbd_queue,
3538 = Fcons (make_lispy_switch_frame (event->frame_or_window), 3537 Fcons (make_lispy_switch_frame (event->frame_or_window),
3539 Fcons (make_number (c), Qnil)); 3538 Fcons (make_number (c), Qnil)));
3540 kb->kbd_queue_has_data = 1; 3539 kb->kbd_queue_has_data = 1;
3541 for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) 3540 for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
3542 { 3541 {
@@ -5408,7 +5407,7 @@ make_lispy_event (struct input_event *event)
5408 /* We need to use an alist rather than a vector as the cache 5407 /* We need to use an alist rather than a vector as the cache
5409 since we can't make a vector long enough. */ 5408 since we can't make a vector long enough. */
5410 if (NILP (KVAR (current_kboard, system_key_syms))) 5409 if (NILP (KVAR (current_kboard, system_key_syms)))
5411 KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil); 5410 KSET (current_kboard, system_key_syms, Fcons (Qnil, Qnil));
5412 return modify_event_symbol (event->code, 5411 return modify_event_symbol (event->code,
5413 event->modifiers, 5412 event->modifiers,
5414 Qfunction_key, 5413 Qfunction_key,
@@ -8729,11 +8728,11 @@ read_char_minibuf_menu_prompt (int commandflag,
8729 is not used on replay. 8728 is not used on replay.
8730 */ 8729 */
8731 orig_defn_macro = KVAR (current_kboard, defining_kbd_macro); 8730 orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
8732 KVAR (current_kboard, defining_kbd_macro) = Qnil; 8731 KSET (current_kboard, defining_kbd_macro, Qnil);
8733 do 8732 do
8734 obj = read_char (commandflag, 0, 0, Qt, 0, NULL); 8733 obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
8735 while (BUFFERP (obj)); 8734 while (BUFFERP (obj));
8736 KVAR (current_kboard, defining_kbd_macro) = orig_defn_macro; 8735 KSET (current_kboard, defining_kbd_macro, orig_defn_macro);
8737 8736
8738 if (!INTEGERP (obj)) 8737 if (!INTEGERP (obj))
8739 return obj; 8738 return obj;
@@ -9089,7 +9088,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9089 /* Install the string STR as the beginning of the string of 9088 /* Install the string STR as the beginning of the string of
9090 echoing, so that it serves as a prompt for the next 9089 echoing, so that it serves as a prompt for the next
9091 character. */ 9090 character. */
9092 KVAR (current_kboard, echo_string) = prompt; 9091 KSET (current_kboard, echo_string, prompt);
9093 current_kboard->echo_after_prompt = SCHARS (prompt); 9092 current_kboard->echo_after_prompt = SCHARS (prompt);
9094 echo_now (); 9093 echo_now ();
9095 } 9094 }
@@ -9335,15 +9334,15 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9335 9334
9336 if (!NILP (delayed_switch_frame)) 9335 if (!NILP (delayed_switch_frame))
9337 { 9336 {
9338 KVAR (interrupted_kboard, kbd_queue) 9337 KSET (interrupted_kboard, kbd_queue,
9339 = Fcons (delayed_switch_frame, 9338 Fcons (delayed_switch_frame,
9340 KVAR (interrupted_kboard, kbd_queue)); 9339 KVAR (interrupted_kboard, kbd_queue)));
9341 delayed_switch_frame = Qnil; 9340 delayed_switch_frame = Qnil;
9342 } 9341 }
9343 9342
9344 while (t > 0) 9343 while (t > 0)
9345 KVAR (interrupted_kboard, kbd_queue) 9344 KSET (interrupted_kboard, kbd_queue,
9346 = Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue)); 9345 Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue)));
9347 9346
9348 /* If the side queue is non-empty, ensure it begins with a 9347 /* If the side queue is non-empty, ensure it begins with a
9349 switch-frame, so we'll replay it in the right context. */ 9348 switch-frame, so we'll replay it in the right context. */
@@ -9355,9 +9354,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9355 { 9354 {
9356 Lisp_Object frame; 9355 Lisp_Object frame;
9357 XSETFRAME (frame, interrupted_frame); 9356 XSETFRAME (frame, interrupted_frame);
9358 KVAR (interrupted_kboard, kbd_queue) 9357 KSET (interrupted_kboard, kbd_queue,
9359 = Fcons (make_lispy_switch_frame (frame), 9358 Fcons (make_lispy_switch_frame (frame),
9360 KVAR (interrupted_kboard, kbd_queue)); 9359 KVAR (interrupted_kboard, kbd_queue)));
9361 } 9360 }
9362 mock_input = 0; 9361 mock_input = 0;
9363 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9362 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@@ -10251,7 +10250,7 @@ a special event, so ignore the prefix argument and don't clear it. */)
10251 { 10250 {
10252 prefixarg = KVAR (current_kboard, Vprefix_arg); 10251 prefixarg = KVAR (current_kboard, Vprefix_arg);
10253 Vcurrent_prefix_arg = prefixarg; 10252 Vcurrent_prefix_arg = prefixarg;
10254 KVAR (current_kboard, Vprefix_arg) = Qnil; 10253 KSET (current_kboard, Vprefix_arg, Qnil);
10255 } 10254 }
10256 else 10255 else
10257 prefixarg = Qnil; 10256 prefixarg = Qnil;
@@ -11249,30 +11248,30 @@ The `posn-' functions access elements of such lists. */)
11249void 11248void
11250init_kboard (KBOARD *kb) 11249init_kboard (KBOARD *kb)
11251{ 11250{
11252 KVAR (kb, Voverriding_terminal_local_map) = Qnil; 11251 KSET (kb, Voverriding_terminal_local_map, Qnil);
11253 KVAR (kb, Vlast_command) = Qnil; 11252 KSET (kb, Vlast_command, Qnil);
11254 KVAR (kb, Vreal_last_command) = Qnil; 11253 KSET (kb, Vreal_last_command, Qnil);
11255 KVAR (kb, Vkeyboard_translate_table) = Qnil; 11254 KSET (kb, Vkeyboard_translate_table, Qnil);
11256 KVAR (kb, Vlast_repeatable_command) = Qnil; 11255 KSET (kb, Vlast_repeatable_command, Qnil);
11257 KVAR (kb, Vprefix_arg) = Qnil; 11256 KSET (kb, Vprefix_arg, Qnil);
11258 KVAR (kb, Vlast_prefix_arg) = Qnil; 11257 KSET (kb, Vlast_prefix_arg, Qnil);
11259 KVAR (kb, kbd_queue) = Qnil; 11258 KSET (kb, kbd_queue, Qnil);
11260 kb->kbd_queue_has_data = 0; 11259 kb->kbd_queue_has_data = 0;
11261 kb->immediate_echo = 0; 11260 kb->immediate_echo = 0;
11262 KVAR (kb, echo_string) = Qnil; 11261 KSET (kb, echo_string, Qnil);
11263 kb->echo_after_prompt = -1; 11262 kb->echo_after_prompt = -1;
11264 kb->kbd_macro_buffer = 0; 11263 kb->kbd_macro_buffer = 0;
11265 kb->kbd_macro_bufsize = 0; 11264 kb->kbd_macro_bufsize = 0;
11266 KVAR (kb, defining_kbd_macro) = Qnil; 11265 KSET (kb, defining_kbd_macro, Qnil);
11267 KVAR (kb, Vlast_kbd_macro) = Qnil; 11266 KSET (kb, Vlast_kbd_macro, Qnil);
11268 kb->reference_count = 0; 11267 kb->reference_count = 0;
11269 KVAR (kb, Vsystem_key_alist) = Qnil; 11268 KSET (kb, Vsystem_key_alist, Qnil);
11270 KVAR (kb, system_key_syms) = Qnil; 11269 KSET (kb, system_key_syms, Qnil);
11271 KVAR (kb, Vwindow_system) = Qt; /* Unset. */ 11270 KSET (kb, Vwindow_system, Qt); /* Unset. */
11272 KVAR (kb, Vinput_decode_map) = Fmake_sparse_keymap (Qnil); 11271 KSET (kb, Vinput_decode_map, Fmake_sparse_keymap (Qnil));
11273 KVAR (kb, Vlocal_function_key_map) = Fmake_sparse_keymap (Qnil); 11272 KSET (kb, Vlocal_function_key_map, Fmake_sparse_keymap (Qnil));
11274 Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map); 11273 Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
11275 KVAR (kb, Vdefault_minibuffer_frame) = Qnil; 11274 KSET (kb, Vdefault_minibuffer_frame, Qnil);
11276} 11275}
11277 11276
11278/* 11277/*
@@ -11348,7 +11347,7 @@ init_keyboard (void)
11348 init_kboard (current_kboard); 11347 init_kboard (current_kboard);
11349 /* A value of nil for Vwindow_system normally means a tty, but we also use 11348 /* A value of nil for Vwindow_system normally means a tty, but we also use
11350 it for the initial terminal since there is no window system there. */ 11349 it for the initial terminal since there is no window system there. */
11351 KVAR (current_kboard, Vwindow_system) = Qnil; 11350 KSET (current_kboard, Vwindow_system, Qnil);
11352 11351
11353 if (!noninteractive) 11352 if (!noninteractive)
11354 { 11353 {
diff --git a/src/keyboard.h b/src/keyboard.h
index 4006c67d68e..f83643d6f6e 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22/* Most code should use this macro to access Lisp fields in struct kboard. */ 22/* Most code should use this macro to access Lisp fields in struct kboard. */
23 23
24#define KVAR(kboard, field) ((kboard)->INTERNAL_FIELD (field)) 24#define KVAR(kboard, field) ((kboard)->INTERNAL_FIELD (field))
25#define KSET(kboard, field, value) ((kboard)->INTERNAL_FIELD (field) = (value))
25 26
26/* Each KBOARD represents one logical input stream from which Emacs 27/* Each KBOARD represents one logical input stream from which Emacs
27 gets input. If we are using ordinary terminals, it has one KBOARD 28 gets input. If we are using ordinary terminals, it has one KBOARD
diff --git a/src/macros.c b/src/macros.c
index 8a4361fc1f6..d74d12e6158 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -127,7 +127,7 @@ macro before appending to it. */)
127 127
128 message ("Appending to kbd macro..."); 128 message ("Appending to kbd macro...");
129 } 129 }
130 KVAR (current_kboard, defining_kbd_macro) = Qt; 130 KSET (current_kboard, defining_kbd_macro, Qt);
131 131
132 return Qnil; 132 return Qnil;
133} 133}
@@ -137,12 +137,12 @@ macro before appending to it. */)
137void 137void
138end_kbd_macro (void) 138end_kbd_macro (void)
139{ 139{
140 KVAR (current_kboard, defining_kbd_macro) = Qnil; 140 KSET (current_kboard, defining_kbd_macro, Qnil);
141 update_mode_lines++; 141 update_mode_lines++;
142 KVAR (current_kboard, Vlast_kbd_macro) 142 KSET (current_kboard, Vlast_kbd_macro,
143 = make_event_array ((current_kboard->kbd_macro_end 143 make_event_array ((current_kboard->kbd_macro_end
144 - current_kboard->kbd_macro_buffer), 144 - current_kboard->kbd_macro_buffer),
145 current_kboard->kbd_macro_buffer); 145 current_kboard->kbd_macro_buffer));
146} 146}
147 147
148DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p", 148DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p",
@@ -330,7 +330,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
330 executing_kbd_macro = final; 330 executing_kbd_macro = final;
331 executing_kbd_macro_index = 0; 331 executing_kbd_macro_index = 0;
332 332
333 KVAR (current_kboard, Vprefix_arg) = Qnil; 333 KSET (current_kboard, Vprefix_arg, Qnil);
334 334
335 if (!NILP (loopfunc)) 335 if (!NILP (loopfunc))
336 { 336 {
diff --git a/src/msdos.c b/src/msdos.c
index 45f30af6d8c..bcb7fbe75e0 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1801,7 +1801,7 @@ internal_terminal_init (void)
1801 } 1801 }
1802 1802
1803 tty = FRAME_TTY (sf); 1803 tty = FRAME_TTY (sf);
1804 KVAR (current_kboard, Vwindow_system) = Qpc; 1804 KSET (current_kboard, Vwindow_system, Qpc);
1805 sf->output_method = output_msdos_raw; 1805 sf->output_method = output_msdos_raw;
1806 if (init_needed) 1806 if (init_needed)
1807 { 1807 {
diff --git a/src/nsfns.m b/src/nsfns.m
index 0b639d6269c..1b39f0257a5 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1391,7 +1391,7 @@ This function is an internal primitive--use `make-frame' instead. */)
1391 if (FRAME_HAS_MINIBUF_P (f) 1391 if (FRAME_HAS_MINIBUF_P (f)
1392 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) 1392 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
1393 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) 1393 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
1394 KVAR (kb, Vdefault_minibuffer_frame) = frame; 1394 KSET (kb, Vdefault_minibuffer_frame, frame);
1395 1395
1396 /* All remaining specified parameters, which have not been "used" 1396 /* All remaining specified parameters, which have not been "used"
1397 by x_get_arg and friends, now go in the misc. alist of the frame. */ 1397 by x_get_arg and friends, now go in the misc. alist of the frame. */
diff --git a/src/nsterm.m b/src/nsterm.m
index b99241f4e15..5e3c3ac777f 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4051,7 +4051,7 @@ ns_term_init (Lisp_Object display_name)
4051 4051
4052 terminal->kboard = xmalloc (sizeof *terminal->kboard); 4052 terminal->kboard = xmalloc (sizeof *terminal->kboard);
4053 init_kboard (terminal->kboard); 4053 init_kboard (terminal->kboard);
4054 KVAR (terminal->kboard, Vwindow_system) = Qns; 4054 KSET (terminal->kboard, Vwindow_system, Qns);
4055 terminal->kboard->next_kboard = all_kboards; 4055 terminal->kboard->next_kboard = all_kboards;
4056 all_kboards = terminal->kboard; 4056 all_kboards = terminal->kboard;
4057 /* Don't let the initial kboard remain current longer than necessary. 4057 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/term.c b/src/term.c
index 2b944b48a12..514c7ad11ec 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1333,7 +1333,7 @@ term_get_fkeys_1 (void)
1333 1333
1334 /* This can happen if CANNOT_DUMP or with strange options. */ 1334 /* This can happen if CANNOT_DUMP or with strange options. */
1335 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map))) 1335 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
1336 KVAR (kboard, Vinput_decode_map) = Fmake_sparse_keymap (Qnil); 1336 KSET (kboard, Vinput_decode_map, Fmake_sparse_keymap (Qnil));
1337 1337
1338 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) 1338 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
1339 { 1339 {
@@ -3281,7 +3281,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3281 3281
3282 terminal->kboard = xmalloc (sizeof *terminal->kboard); 3282 terminal->kboard = xmalloc (sizeof *terminal->kboard);
3283 init_kboard (terminal->kboard); 3283 init_kboard (terminal->kboard);
3284 KVAR (terminal->kboard, Vwindow_system) = Qnil; 3284 KSET (terminal->kboard, Vwindow_system, Qnil);
3285 terminal->kboard->next_kboard = all_kboards; 3285 terminal->kboard->next_kboard = all_kboards;
3286 all_kboards = terminal->kboard; 3286 all_kboards = terminal->kboard;
3287 terminal->kboard->reference_count++; 3287 terminal->kboard->reference_count++;
diff --git a/src/w32fns.c b/src/w32fns.c
index ebe382f75d2..d1dba0c0bb8 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4381,7 +4381,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4381 if (FRAME_HAS_MINIBUF_P (f) 4381 if (FRAME_HAS_MINIBUF_P (f)
4382 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) 4382 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
4383 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) 4383 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
4384 KVAR (kb, Vdefault_minibuffer_frame) = frame; 4384 KSET (kb, Vdefault_minibuffer_frame, frame);
4385 4385
4386 /* All remaining specified parameters, which have not been "used" 4386 /* All remaining specified parameters, which have not been "used"
4387 by x_get_arg and friends, now go in the misc. alist of the frame. */ 4387 by x_get_arg and friends, now go in the misc. alist of the frame. */
diff --git a/src/w32term.c b/src/w32term.c
index 190919f7176..7da9433d3f1 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6232,7 +6232,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6232 terminal like X does. */ 6232 terminal like X does. */
6233 terminal->kboard = xmalloc (sizeof (KBOARD)); 6233 terminal->kboard = xmalloc (sizeof (KBOARD));
6234 init_kboard (terminal->kboard); 6234 init_kboard (terminal->kboard);
6235 KVAR (terminal->kboard, Vwindow_system) = intern ("w32"); 6235 KSET (terminal->kboard, Vwindow_system, intern ("w32"));
6236 terminal->kboard->next_kboard = all_kboards; 6236 terminal->kboard->next_kboard = all_kboards;
6237 all_kboards = terminal->kboard; 6237 all_kboards = terminal->kboard;
6238 /* Don't let the initial kboard remain current longer than necessary. 6238 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/xfns.c b/src/xfns.c
index 9c9fcb16aba..bbc9f375340 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3461,7 +3461,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3461 if (FRAME_HAS_MINIBUF_P (f) 3461 if (FRAME_HAS_MINIBUF_P (f)
3462 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) 3462 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
3463 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) 3463 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
3464 KVAR (kb, Vdefault_minibuffer_frame) = frame; 3464 KSET (kb, Vdefault_minibuffer_frame, frame);
3465 3465
3466 /* All remaining specified parameters, which have not been "used" 3466 /* All remaining specified parameters, which have not been "used"
3467 by x_get_arg and friends, now go in the misc. alist of the frame. */ 3467 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 e56c19e03e7..1b746f87d53 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7835,7 +7835,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7835 { 7835 {
7836 /* Set this to t so that delete_frame won't get confused 7836 /* Set this to t so that delete_frame won't get confused
7837 trying to find a replacement. */ 7837 trying to find a replacement. */
7838 KVAR (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame) = Qt; 7838 KSET (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame, Qt);
7839 delete_frame (frame, Qnoelisp); 7839 delete_frame (frame, Qnoelisp);
7840 } 7840 }
7841 7841
@@ -10115,7 +10115,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10115 { 10115 {
10116 terminal->kboard = xmalloc (sizeof *terminal->kboard); 10116 terminal->kboard = xmalloc (sizeof *terminal->kboard);
10117 init_kboard (terminal->kboard); 10117 init_kboard (terminal->kboard);
10118 KVAR (terminal->kboard, Vwindow_system) = Qx; 10118 KSET (terminal->kboard, Vwindow_system, Qx);
10119 10119
10120 /* Add the keyboard to the list before running Lisp code (via 10120 /* Add the keyboard to the list before running Lisp code (via
10121 Qvendor_specific_keysyms below), since these are not traced 10121 Qvendor_specific_keysyms below), since these are not traced
@@ -10137,9 +10137,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10137 /* Temporarily hide the partially initialized terminal. */ 10137 /* Temporarily hide the partially initialized terminal. */
10138 terminal_list = terminal->next_terminal; 10138 terminal_list = terminal->next_terminal;
10139 UNBLOCK_INPUT; 10139 UNBLOCK_INPUT;
10140 KVAR (terminal->kboard, Vsystem_key_alist) 10140 KSET (terminal->kboard, Vsystem_key_alist,
10141 = call1 (Qvendor_specific_keysyms, 10141 call1 (Qvendor_specific_keysyms,
10142 vendor ? build_string (vendor) : empty_unibyte_string); 10142 vendor ? build_string (vendor) : empty_unibyte_string));
10143 BLOCK_INPUT; 10143 BLOCK_INPUT;
10144 terminal->next_terminal = terminal_list; 10144 terminal->next_terminal = terminal_list;
10145 terminal_list = terminal; 10145 terminal_list = terminal;