diff options
| author | Joakim Verona | 2012-08-19 02:44:11 +0200 |
|---|---|---|
| committer | Joakim Verona | 2012-08-19 02:44:11 +0200 |
| commit | 5436d1df5e2ba0b4d4f72b03a1cd09b20403654b (patch) | |
| tree | 532faa27319b3bb199d414dc85e63a58246d30b0 /src/keyboard.c | |
| parent | d02344322b0d2fea8dd9ad9dd0a6c70e058f967b (diff) | |
| parent | e757f1c6f393cf82057dbee0a4325b07f0fd55c4 (diff) | |
| download | emacs-5436d1df5e2ba0b4d4f72b03a1cd09b20403654b.tar.gz emacs-5436d1df5e2ba0b4d4f72b03a1cd09b20403654b.zip | |
upstream
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 182 |
1 files changed, 117 insertions, 65 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 0b3c48ab713..7b9be358caa 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -18,6 +18,9 @@ You should have received a copy of the GNU General Public License | |||
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 19 | 19 | ||
| 20 | #include <config.h> | 20 | #include <config.h> |
| 21 | |||
| 22 | #define KEYBOARD_INLINE EXTERN_INLINE | ||
| 23 | |||
| 21 | #include <signal.h> | 24 | #include <signal.h> |
| 22 | #include <stdio.h> | 25 | #include <stdio.h> |
| 23 | #include <setjmp.h> | 26 | #include <setjmp.h> |
| @@ -472,6 +475,53 @@ static void handle_user_signal (int); | |||
| 472 | static char *find_user_signal_name (int); | 475 | static char *find_user_signal_name (int); |
| 473 | static int store_user_signal_events (void); | 476 | static int store_user_signal_events (void); |
| 474 | 477 | ||
| 478 | /* These setters are used only in this file, so they can be private. */ | ||
| 479 | static inline void | ||
| 480 | kset_echo_string (struct kboard *kb, Lisp_Object val) | ||
| 481 | { | ||
| 482 | kb->INTERNAL_FIELD (echo_string) = val; | ||
| 483 | } | ||
| 484 | static inline void | ||
| 485 | kset_kbd_queue (struct kboard *kb, Lisp_Object val) | ||
| 486 | { | ||
| 487 | kb->INTERNAL_FIELD (kbd_queue) = val; | ||
| 488 | } | ||
| 489 | static inline void | ||
| 490 | kset_keyboard_translate_table (struct kboard *kb, Lisp_Object val) | ||
| 491 | { | ||
| 492 | kb->INTERNAL_FIELD (Vkeyboard_translate_table) = val; | ||
| 493 | } | ||
| 494 | static inline void | ||
| 495 | kset_last_prefix_arg (struct kboard *kb, Lisp_Object val) | ||
| 496 | { | ||
| 497 | kb->INTERNAL_FIELD (Vlast_prefix_arg) = val; | ||
| 498 | } | ||
| 499 | static inline void | ||
| 500 | kset_last_repeatable_command (struct kboard *kb, Lisp_Object val) | ||
| 501 | { | ||
| 502 | kb->INTERNAL_FIELD (Vlast_repeatable_command) = val; | ||
| 503 | } | ||
| 504 | static inline void | ||
| 505 | kset_local_function_key_map (struct kboard *kb, Lisp_Object val) | ||
| 506 | { | ||
| 507 | kb->INTERNAL_FIELD (Vlocal_function_key_map) = val; | ||
| 508 | } | ||
| 509 | static inline void | ||
| 510 | kset_overriding_terminal_local_map (struct kboard *kb, Lisp_Object val) | ||
| 511 | { | ||
| 512 | kb->INTERNAL_FIELD (Voverriding_terminal_local_map) = val; | ||
| 513 | } | ||
| 514 | static inline void | ||
| 515 | kset_real_last_command (struct kboard *kb, Lisp_Object val) | ||
| 516 | { | ||
| 517 | kb->INTERNAL_FIELD (Vreal_last_command) = val; | ||
| 518 | } | ||
| 519 | static inline void | ||
| 520 | kset_system_key_syms (struct kboard *kb, Lisp_Object val) | ||
| 521 | { | ||
| 522 | kb->INTERNAL_FIELD (system_key_syms) = val; | ||
| 523 | } | ||
| 524 | |||
| 475 | 525 | ||
| 476 | /* Add C to the echo string, if echoing is going on. | 526 | /* Add C to the echo string, if echoing is going on. |
| 477 | C can be a character, which is printed prettily ("M-C-x" and all that | 527 | C can be a character, which is printed prettily ("M-C-x" and all that |
| @@ -554,8 +604,9 @@ echo_char (Lisp_Object c) | |||
| 554 | else if (STRINGP (echo_string)) | 604 | else if (STRINGP (echo_string)) |
| 555 | echo_string = concat2 (echo_string, build_string (" ")); | 605 | echo_string = concat2 (echo_string, build_string (" ")); |
| 556 | 606 | ||
| 557 | KSET (current_kboard, echo_string, | 607 | kset_echo_string |
| 558 | concat2 (echo_string, make_string (buffer, ptr - buffer))); | 608 | (current_kboard, |
| 609 | concat2 (echo_string, make_string (buffer, ptr - buffer))); | ||
| 559 | 610 | ||
| 560 | echo_now (); | 611 | echo_now (); |
| 561 | } | 612 | } |
| @@ -600,8 +651,9 @@ echo_dash (void) | |||
| 600 | 651 | ||
| 601 | /* Put a dash at the end of the buffer temporarily, | 652 | /* Put a dash at the end of the buffer temporarily, |
| 602 | but make it go away when the next character is added. */ | 653 | but make it go away when the next character is added. */ |
| 603 | KSET (current_kboard, echo_string, | 654 | kset_echo_string |
| 604 | concat2 (KVAR (current_kboard, echo_string), build_string ("-"))); | 655 | (current_kboard, |
| 656 | concat2 (KVAR (current_kboard, echo_string), build_string ("-"))); | ||
| 605 | echo_now (); | 657 | echo_now (); |
| 606 | } | 658 | } |
| 607 | 659 | ||
| @@ -663,7 +715,7 @@ cancel_echoing (void) | |||
| 663 | { | 715 | { |
| 664 | current_kboard->immediate_echo = 0; | 716 | current_kboard->immediate_echo = 0; |
| 665 | current_kboard->echo_after_prompt = -1; | 717 | current_kboard->echo_after_prompt = -1; |
| 666 | KSET (current_kboard, echo_string, Qnil); | 718 | kset_echo_string (current_kboard, Qnil); |
| 667 | ok_to_echo_at_next_pause = NULL; | 719 | ok_to_echo_at_next_pause = NULL; |
| 668 | echo_kboard = NULL; | 720 | echo_kboard = NULL; |
| 669 | echo_message_buffer = Qnil; | 721 | echo_message_buffer = Qnil; |
| @@ -687,9 +739,9 @@ static void | |||
| 687 | echo_truncate (ptrdiff_t nchars) | 739 | echo_truncate (ptrdiff_t nchars) |
| 688 | { | 740 | { |
| 689 | if (STRINGP (KVAR (current_kboard, echo_string))) | 741 | if (STRINGP (KVAR (current_kboard, echo_string))) |
| 690 | KSET (current_kboard, echo_string, | 742 | kset_echo_string (current_kboard, |
| 691 | Fsubstring (KVAR (current_kboard, echo_string), | 743 | Fsubstring (KVAR (current_kboard, echo_string), |
| 692 | make_number (0), make_number (nchars))); | 744 | make_number (0), make_number (nchars))); |
| 693 | truncate_echo_area (nchars); | 745 | truncate_echo_area (nchars); |
| 694 | } | 746 | } |
| 695 | 747 | ||
| @@ -1019,8 +1071,8 @@ cmd_error (Lisp_Object data) | |||
| 1019 | Vstandard_input = Qt; | 1071 | Vstandard_input = Qt; |
| 1020 | Vexecuting_kbd_macro = Qnil; | 1072 | Vexecuting_kbd_macro = Qnil; |
| 1021 | executing_kbd_macro = Qnil; | 1073 | executing_kbd_macro = Qnil; |
| 1022 | KSET (current_kboard, Vprefix_arg, Qnil); | 1074 | kset_prefix_arg (current_kboard, Qnil); |
| 1023 | KSET (current_kboard, Vlast_prefix_arg, Qnil); | 1075 | kset_last_prefix_arg (current_kboard, Qnil); |
| 1024 | cancel_echoing (); | 1076 | cancel_echoing (); |
| 1025 | 1077 | ||
| 1026 | /* Avoid unquittable loop if data contains a circular list. */ | 1078 | /* Avoid unquittable loop if data contains a circular list. */ |
| @@ -1341,8 +1393,8 @@ command_loop_1 (void) | |||
| 1341 | #endif | 1393 | #endif |
| 1342 | int already_adjusted = 0; | 1394 | int already_adjusted = 0; |
| 1343 | 1395 | ||
| 1344 | KSET (current_kboard, Vprefix_arg, Qnil); | 1396 | kset_prefix_arg (current_kboard, Qnil); |
| 1345 | KSET (current_kboard, Vlast_prefix_arg, Qnil); | 1397 | kset_last_prefix_arg (current_kboard, Qnil); |
| 1346 | Vdeactivate_mark = Qnil; | 1398 | Vdeactivate_mark = Qnil; |
| 1347 | waiting_for_input = 0; | 1399 | waiting_for_input = 0; |
| 1348 | cancel_echoing (); | 1400 | cancel_echoing (); |
| @@ -1374,10 +1426,10 @@ command_loop_1 (void) | |||
| 1374 | } | 1426 | } |
| 1375 | 1427 | ||
| 1376 | /* Do this after running Vpost_command_hook, for consistency. */ | 1428 | /* Do this after running Vpost_command_hook, for consistency. */ |
| 1377 | KSET (current_kboard, Vlast_command, Vthis_command); | 1429 | kset_last_command (current_kboard, Vthis_command); |
| 1378 | KSET (current_kboard, Vreal_last_command, Vreal_this_command); | 1430 | kset_real_last_command (current_kboard, Vreal_this_command); |
| 1379 | if (!CONSP (last_command_event)) | 1431 | if (!CONSP (last_command_event)) |
| 1380 | KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command); | 1432 | kset_last_repeatable_command (current_kboard, Vreal_this_command); |
| 1381 | 1433 | ||
| 1382 | while (1) | 1434 | while (1) |
| 1383 | { | 1435 | { |
| @@ -1549,7 +1601,7 @@ command_loop_1 (void) | |||
| 1549 | keys = Fkey_description (keys, Qnil); | 1601 | keys = Fkey_description (keys, Qnil); |
| 1550 | bitch_at_user (); | 1602 | bitch_at_user (); |
| 1551 | message_with_string ("%s is undefined", keys, 0); | 1603 | message_with_string ("%s is undefined", keys, 0); |
| 1552 | KSET (current_kboard, defining_kbd_macro, Qnil); | 1604 | kset_defining_kbd_macro (current_kboard, Qnil); |
| 1553 | update_mode_lines = 1; | 1605 | update_mode_lines = 1; |
| 1554 | /* If this is a down-mouse event, don't reset prefix-arg; | 1606 | /* If this is a down-mouse event, don't reset prefix-arg; |
| 1555 | pass it to the command run by the up event. */ | 1607 | pass it to the command run by the up event. */ |
| @@ -1559,10 +1611,10 @@ command_loop_1 (void) | |||
| 1559 | = parse_modifiers (EVENT_HEAD (last_command_event)); | 1611 | = parse_modifiers (EVENT_HEAD (last_command_event)); |
| 1560 | int modifiers = XINT (XCAR (XCDR (breakdown))); | 1612 | int modifiers = XINT (XCAR (XCDR (breakdown))); |
| 1561 | if (!(modifiers & down_modifier)) | 1613 | if (!(modifiers & down_modifier)) |
| 1562 | KSET (current_kboard, Vprefix_arg, Qnil); | 1614 | kset_prefix_arg (current_kboard, Qnil); |
| 1563 | } | 1615 | } |
| 1564 | else | 1616 | else |
| 1565 | KSET (current_kboard, Vprefix_arg, Qnil); | 1617 | kset_prefix_arg (current_kboard, Qnil); |
| 1566 | } | 1618 | } |
| 1567 | else | 1619 | else |
| 1568 | { | 1620 | { |
| @@ -1599,7 +1651,7 @@ command_loop_1 (void) | |||
| 1599 | unbind_to (scount, Qnil); | 1651 | unbind_to (scount, Qnil); |
| 1600 | #endif | 1652 | #endif |
| 1601 | } | 1653 | } |
| 1602 | KSET (current_kboard, Vlast_prefix_arg, Vcurrent_prefix_arg); | 1654 | kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg); |
| 1603 | 1655 | ||
| 1604 | safe_run_hooks (Qpost_command_hook); | 1656 | safe_run_hooks (Qpost_command_hook); |
| 1605 | 1657 | ||
| @@ -1630,10 +1682,10 @@ command_loop_1 (void) | |||
| 1630 | if (NILP (KVAR (current_kboard, Vprefix_arg)) | 1682 | if (NILP (KVAR (current_kboard, Vprefix_arg)) |
| 1631 | || CONSP (last_command_event)) | 1683 | || CONSP (last_command_event)) |
| 1632 | { | 1684 | { |
| 1633 | KSET (current_kboard, Vlast_command, Vthis_command); | 1685 | kset_last_command (current_kboard, Vthis_command); |
| 1634 | KSET (current_kboard, Vreal_last_command, Vreal_this_command); | 1686 | kset_real_last_command (current_kboard, Vreal_this_command); |
| 1635 | if (!CONSP (last_command_event)) | 1687 | if (!CONSP (last_command_event)) |
| 1636 | KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command); | 1688 | kset_last_repeatable_command (current_kboard, Vreal_this_command); |
| 1637 | cancel_echoing (); | 1689 | cancel_echoing (); |
| 1638 | this_command_key_count = 0; | 1690 | this_command_key_count = 0; |
| 1639 | this_command_key_count_reset = 0; | 1691 | this_command_key_count_reset = 0; |
| @@ -2576,7 +2628,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2576 | abort (); | 2628 | abort (); |
| 2577 | } | 2629 | } |
| 2578 | if (!CONSP (last)) | 2630 | if (!CONSP (last)) |
| 2579 | KSET (kb, kbd_queue, Fcons (c, Qnil)); | 2631 | kset_kbd_queue (kb, Fcons (c, Qnil)); |
| 2580 | else | 2632 | else |
| 2581 | XSETCDR (last, Fcons (c, Qnil)); | 2633 | XSETCDR (last, Fcons (c, Qnil)); |
| 2582 | kb->kbd_queue_has_data = 1; | 2634 | kb->kbd_queue_has_data = 1; |
| @@ -2748,8 +2800,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2748 | if (!CONSP (KVAR (current_kboard, kbd_queue))) | 2800 | if (!CONSP (KVAR (current_kboard, kbd_queue))) |
| 2749 | abort (); | 2801 | abort (); |
| 2750 | c = XCAR (KVAR (current_kboard, kbd_queue)); | 2802 | c = XCAR (KVAR (current_kboard, kbd_queue)); |
| 2751 | KSET (current_kboard, kbd_queue, | 2803 | kset_kbd_queue (current_kboard, |
| 2752 | XCDR (KVAR (current_kboard, kbd_queue))); | 2804 | XCDR (KVAR (current_kboard, kbd_queue))); |
| 2753 | if (NILP (KVAR (current_kboard, kbd_queue))) | 2805 | if (NILP (KVAR (current_kboard, kbd_queue))) |
| 2754 | current_kboard->kbd_queue_has_data = 0; | 2806 | current_kboard->kbd_queue_has_data = 0; |
| 2755 | input_pending = readable_events (0); | 2807 | input_pending = readable_events (0); |
| @@ -2816,7 +2868,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2816 | abort (); | 2868 | abort (); |
| 2817 | } | 2869 | } |
| 2818 | if (!CONSP (last)) | 2870 | if (!CONSP (last)) |
| 2819 | KSET (kb, kbd_queue, Fcons (c, Qnil)); | 2871 | kset_kbd_queue (kb, Fcons (c, Qnil)); |
| 2820 | else | 2872 | else |
| 2821 | XSETCDR (last, Fcons (c, Qnil)); | 2873 | XSETCDR (last, Fcons (c, Qnil)); |
| 2822 | kb->kbd_queue_has_data = 1; | 2874 | kb->kbd_queue_has_data = 1; |
| @@ -3074,7 +3126,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 3074 | 3126 | ||
| 3075 | cancel_echoing (); | 3127 | cancel_echoing (); |
| 3076 | ok_to_echo_at_next_pause = saved_ok_to_echo; | 3128 | ok_to_echo_at_next_pause = saved_ok_to_echo; |
| 3077 | KSET (current_kboard, echo_string, saved_echo_string); | 3129 | kset_echo_string (current_kboard, saved_echo_string); |
| 3078 | current_kboard->echo_after_prompt = saved_echo_after_prompt; | 3130 | current_kboard->echo_after_prompt = saved_echo_after_prompt; |
| 3079 | if (saved_immediate_echo) | 3131 | if (saved_immediate_echo) |
| 3080 | echo_now (); | 3132 | echo_now (); |
| @@ -3545,9 +3597,9 @@ kbd_buffer_store_event_hold (register struct input_event *event, | |||
| 3545 | 3597 | ||
| 3546 | if (single_kboard && kb != current_kboard) | 3598 | if (single_kboard && kb != current_kboard) |
| 3547 | { | 3599 | { |
| 3548 | KSET (kb, kbd_queue, | 3600 | kset_kbd_queue |
| 3549 | Fcons (make_lispy_switch_frame (event->frame_or_window), | 3601 | (kb, Fcons (make_lispy_switch_frame (event->frame_or_window), |
| 3550 | Fcons (make_number (c), Qnil))); | 3602 | Fcons (make_number (c), Qnil))); |
| 3551 | kb->kbd_queue_has_data = 1; | 3603 | kb->kbd_queue_has_data = 1; |
| 3552 | for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) | 3604 | for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) |
| 3553 | { | 3605 | { |
| @@ -5426,7 +5478,7 @@ make_lispy_event (struct input_event *event) | |||
| 5426 | /* We need to use an alist rather than a vector as the cache | 5478 | /* We need to use an alist rather than a vector as the cache |
| 5427 | since we can't make a vector long enough. */ | 5479 | since we can't make a vector long enough. */ |
| 5428 | if (NILP (KVAR (current_kboard, system_key_syms))) | 5480 | if (NILP (KVAR (current_kboard, system_key_syms))) |
| 5429 | KSET (current_kboard, system_key_syms, Fcons (Qnil, Qnil)); | 5481 | kset_system_key_syms (current_kboard, Fcons (Qnil, Qnil)); |
| 5430 | return modify_event_symbol (event->code, | 5482 | return modify_event_symbol (event->code, |
| 5431 | event->modifiers, | 5483 | event->modifiers, |
| 5432 | Qfunction_key, | 5484 | Qfunction_key, |
| @@ -8755,11 +8807,11 @@ read_char_minibuf_menu_prompt (int commandflag, | |||
| 8755 | is not used on replay. | 8807 | is not used on replay. |
| 8756 | */ | 8808 | */ |
| 8757 | orig_defn_macro = KVAR (current_kboard, defining_kbd_macro); | 8809 | orig_defn_macro = KVAR (current_kboard, defining_kbd_macro); |
| 8758 | KSET (current_kboard, defining_kbd_macro, Qnil); | 8810 | kset_defining_kbd_macro (current_kboard, Qnil); |
| 8759 | do | 8811 | do |
| 8760 | obj = read_char (commandflag, 0, 0, Qt, 0, NULL); | 8812 | obj = read_char (commandflag, 0, 0, Qt, 0, NULL); |
| 8761 | while (BUFFERP (obj)); | 8813 | while (BUFFERP (obj)); |
| 8762 | KSET (current_kboard, defining_kbd_macro, orig_defn_macro); | 8814 | kset_defining_kbd_macro (current_kboard, orig_defn_macro); |
| 8763 | 8815 | ||
| 8764 | if (!INTEGERP (obj)) | 8816 | if (!INTEGERP (obj)) |
| 8765 | return obj; | 8817 | return obj; |
| @@ -9115,7 +9167,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9115 | /* Install the string STR as the beginning of the string of | 9167 | /* Install the string STR as the beginning of the string of |
| 9116 | echoing, so that it serves as a prompt for the next | 9168 | echoing, so that it serves as a prompt for the next |
| 9117 | character. */ | 9169 | character. */ |
| 9118 | KSET (current_kboard, echo_string, prompt); | 9170 | kset_echo_string (current_kboard, prompt); |
| 9119 | current_kboard->echo_after_prompt = SCHARS (prompt); | 9171 | current_kboard->echo_after_prompt = SCHARS (prompt); |
| 9120 | echo_now (); | 9172 | echo_now (); |
| 9121 | } | 9173 | } |
| @@ -9361,15 +9413,17 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9361 | 9413 | ||
| 9362 | if (!NILP (delayed_switch_frame)) | 9414 | if (!NILP (delayed_switch_frame)) |
| 9363 | { | 9415 | { |
| 9364 | KSET (interrupted_kboard, kbd_queue, | 9416 | kset_kbd_queue |
| 9365 | Fcons (delayed_switch_frame, | 9417 | (interrupted_kboard, |
| 9366 | KVAR (interrupted_kboard, kbd_queue))); | 9418 | Fcons (delayed_switch_frame, |
| 9419 | KVAR (interrupted_kboard, kbd_queue))); | ||
| 9367 | delayed_switch_frame = Qnil; | 9420 | delayed_switch_frame = Qnil; |
| 9368 | } | 9421 | } |
| 9369 | 9422 | ||
| 9370 | while (t > 0) | 9423 | while (t > 0) |
| 9371 | KSET (interrupted_kboard, kbd_queue, | 9424 | kset_kbd_queue |
| 9372 | Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue))); | 9425 | (interrupted_kboard, |
| 9426 | Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue))); | ||
| 9373 | 9427 | ||
| 9374 | /* If the side queue is non-empty, ensure it begins with a | 9428 | /* If the side queue is non-empty, ensure it begins with a |
| 9375 | switch-frame, so we'll replay it in the right context. */ | 9429 | switch-frame, so we'll replay it in the right context. */ |
| @@ -9381,9 +9435,10 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9381 | { | 9435 | { |
| 9382 | Lisp_Object frame; | 9436 | Lisp_Object frame; |
| 9383 | XSETFRAME (frame, interrupted_frame); | 9437 | XSETFRAME (frame, interrupted_frame); |
| 9384 | KSET (interrupted_kboard, kbd_queue, | 9438 | kset_kbd_queue |
| 9385 | Fcons (make_lispy_switch_frame (frame), | 9439 | (interrupted_kboard, |
| 9386 | KVAR (interrupted_kboard, kbd_queue))); | 9440 | Fcons (make_lispy_switch_frame (frame), |
| 9441 | KVAR (interrupted_kboard, kbd_queue))); | ||
| 9387 | } | 9442 | } |
| 9388 | mock_input = 0; | 9443 | mock_input = 0; |
| 9389 | orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); | 9444 | orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); |
| @@ -10277,7 +10332,7 @@ a special event, so ignore the prefix argument and don't clear it. */) | |||
| 10277 | { | 10332 | { |
| 10278 | prefixarg = KVAR (current_kboard, Vprefix_arg); | 10333 | prefixarg = KVAR (current_kboard, Vprefix_arg); |
| 10279 | Vcurrent_prefix_arg = prefixarg; | 10334 | Vcurrent_prefix_arg = prefixarg; |
| 10280 | KSET (current_kboard, Vprefix_arg, Qnil); | 10335 | kset_prefix_arg (current_kboard, Qnil); |
| 10281 | } | 10336 | } |
| 10282 | else | 10337 | else |
| 10283 | prefixarg = Qnil; | 10338 | prefixarg = Qnil; |
| @@ -11216,11 +11271,8 @@ The `posn-' functions access elements of such lists. */) | |||
| 11216 | 11271 | ||
| 11217 | if (WINDOWP (frame_or_window)) | 11272 | if (WINDOWP (frame_or_window)) |
| 11218 | { | 11273 | { |
| 11219 | struct window *w; | 11274 | struct window *w = decode_valid_window (frame_or_window); |
| 11220 | |||
| 11221 | CHECK_LIVE_WINDOW (frame_or_window); | ||
| 11222 | 11275 | ||
| 11223 | w = XWINDOW (frame_or_window); | ||
| 11224 | XSETINT (x, (XINT (x) | 11276 | XSETINT (x, (XINT (x) |
| 11225 | + WINDOW_LEFT_EDGE_X (w) | 11277 | + WINDOW_LEFT_EDGE_X (w) |
| 11226 | + (NILP (whole) | 11278 | + (NILP (whole) |
| @@ -11275,30 +11327,30 @@ The `posn-' functions access elements of such lists. */) | |||
| 11275 | void | 11327 | void |
| 11276 | init_kboard (KBOARD *kb) | 11328 | init_kboard (KBOARD *kb) |
| 11277 | { | 11329 | { |
| 11278 | KSET (kb, Voverriding_terminal_local_map, Qnil); | 11330 | kset_overriding_terminal_local_map (kb, Qnil); |
| 11279 | KSET (kb, Vlast_command, Qnil); | 11331 | kset_last_command (kb, Qnil); |
| 11280 | KSET (kb, Vreal_last_command, Qnil); | 11332 | kset_real_last_command (kb, Qnil); |
| 11281 | KSET (kb, Vkeyboard_translate_table, Qnil); | 11333 | kset_keyboard_translate_table (kb, Qnil); |
| 11282 | KSET (kb, Vlast_repeatable_command, Qnil); | 11334 | kset_last_repeatable_command (kb, Qnil); |
| 11283 | KSET (kb, Vprefix_arg, Qnil); | 11335 | kset_prefix_arg (kb, Qnil); |
| 11284 | KSET (kb, Vlast_prefix_arg, Qnil); | 11336 | kset_last_prefix_arg (kb, Qnil); |
| 11285 | KSET (kb, kbd_queue, Qnil); | 11337 | kset_kbd_queue (kb, Qnil); |
| 11286 | kb->kbd_queue_has_data = 0; | 11338 | kb->kbd_queue_has_data = 0; |
| 11287 | kb->immediate_echo = 0; | 11339 | kb->immediate_echo = 0; |
| 11288 | KSET (kb, echo_string, Qnil); | 11340 | kset_echo_string (kb, Qnil); |
| 11289 | kb->echo_after_prompt = -1; | 11341 | kb->echo_after_prompt = -1; |
| 11290 | kb->kbd_macro_buffer = 0; | 11342 | kb->kbd_macro_buffer = 0; |
| 11291 | kb->kbd_macro_bufsize = 0; | 11343 | kb->kbd_macro_bufsize = 0; |
| 11292 | KSET (kb, defining_kbd_macro, Qnil); | 11344 | kset_defining_kbd_macro (kb, Qnil); |
| 11293 | KSET (kb, Vlast_kbd_macro, Qnil); | 11345 | kset_last_kbd_macro (kb, Qnil); |
| 11294 | kb->reference_count = 0; | 11346 | kb->reference_count = 0; |
| 11295 | KSET (kb, Vsystem_key_alist, Qnil); | 11347 | kset_system_key_alist (kb, Qnil); |
| 11296 | KSET (kb, system_key_syms, Qnil); | 11348 | kset_system_key_syms (kb, Qnil); |
| 11297 | KSET (kb, Vwindow_system, Qt); /* Unset. */ | 11349 | kset_window_system (kb, Qt); /* Unset. */ |
| 11298 | KSET (kb, Vinput_decode_map, Fmake_sparse_keymap (Qnil)); | 11350 | kset_input_decode_map (kb, Fmake_sparse_keymap (Qnil)); |
| 11299 | KSET (kb, Vlocal_function_key_map, Fmake_sparse_keymap (Qnil)); | 11351 | kset_local_function_key_map (kb, Fmake_sparse_keymap (Qnil)); |
| 11300 | Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map); | 11352 | Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map); |
| 11301 | KSET (kb, Vdefault_minibuffer_frame, Qnil); | 11353 | kset_default_minibuffer_frame (kb, Qnil); |
| 11302 | } | 11354 | } |
| 11303 | 11355 | ||
| 11304 | /* | 11356 | /* |
| @@ -11374,7 +11426,7 @@ init_keyboard (void) | |||
| 11374 | init_kboard (current_kboard); | 11426 | init_kboard (current_kboard); |
| 11375 | /* A value of nil for Vwindow_system normally means a tty, but we also use | 11427 | /* A value of nil for Vwindow_system normally means a tty, but we also use |
| 11376 | it for the initial terminal since there is no window system there. */ | 11428 | it for the initial terminal since there is no window system there. */ |
| 11377 | KSET (current_kboard, Vwindow_system, Qnil); | 11429 | kset_window_system (current_kboard, Qnil); |
| 11378 | 11430 | ||
| 11379 | if (!noninteractive) | 11431 | if (!noninteractive) |
| 11380 | { | 11432 | { |