aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index cd1747ea88c..1d67c3eaabd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -360,7 +360,7 @@ static Lisp_Object make_lispy_focus_in (Lisp_Object);
360static Lisp_Object make_lispy_focus_out (Lisp_Object); 360static Lisp_Object make_lispy_focus_out (Lisp_Object);
361static bool help_char_p (Lisp_Object); 361static bool help_char_p (Lisp_Object);
362static void save_getcjmp (sys_jmp_buf); 362static void save_getcjmp (sys_jmp_buf);
363static void restore_getcjmp (sys_jmp_buf); 363static void restore_getcjmp (void *);
364static Lisp_Object apply_modifiers (int, Lisp_Object); 364static Lisp_Object apply_modifiers (int, Lisp_Object);
365static void restore_kboard_configuration (int); 365static void restore_kboard_configuration (int);
366static void handle_interrupt (bool); 366static void handle_interrupt (bool);
@@ -2126,12 +2126,14 @@ read_event_from_main_queue (struct timespec *end_time,
2126 return c; 2126 return c;
2127 2127
2128 /* Actually read a character, waiting if necessary. */ 2128 /* Actually read a character, waiting if necessary. */
2129 ptrdiff_t count = SPECPDL_INDEX ();
2129 save_getcjmp (save_jump); 2130 save_getcjmp (save_jump);
2131 record_unwind_protect_ptr (restore_getcjmp, save_jump);
2130 restore_getcjmp (local_getcjmp); 2132 restore_getcjmp (local_getcjmp);
2131 if (!end_time) 2133 if (!end_time)
2132 timer_start_idle (); 2134 timer_start_idle ();
2133 c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); 2135 c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time);
2134 restore_getcjmp (save_jump); 2136 unbind_to (count, Qnil);
2135 2137
2136 if (! NILP (c) && (kb != current_kboard)) 2138 if (! NILP (c) && (kb != current_kboard))
2137 { 2139 {
@@ -2620,10 +2622,12 @@ read_char (int commandflag, Lisp_Object map,
2620 { 2622 {
2621 Lisp_Object tem0; 2623 Lisp_Object tem0;
2622 2624
2625 ptrdiff_t count = SPECPDL_INDEX ();
2623 save_getcjmp (save_jump); 2626 save_getcjmp (save_jump);
2627 record_unwind_protect_ptr (restore_getcjmp, save_jump);
2624 restore_getcjmp (local_getcjmp); 2628 restore_getcjmp (local_getcjmp);
2625 tem0 = sit_for (Vecho_keystrokes, 1, 1); 2629 tem0 = sit_for (Vecho_keystrokes, 1, 1);
2626 restore_getcjmp (save_jump); 2630 unbind_to (count, Qnil);
2627 if (EQ (tem0, Qt) 2631 if (EQ (tem0, Qt)
2628 && ! CONSP (Vunread_command_events)) 2632 && ! CONSP (Vunread_command_events))
2629 echo_now (); 2633 echo_now ();
@@ -2694,10 +2698,12 @@ read_char (int commandflag, Lisp_Object map,
2694 2698
2695 timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4); 2699 timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4);
2696 timeout = delay_level * timeout / 4; 2700 timeout = delay_level * timeout / 4;
2701 ptrdiff_t count1 = SPECPDL_INDEX ();
2697 save_getcjmp (save_jump); 2702 save_getcjmp (save_jump);
2703 record_unwind_protect_ptr (restore_getcjmp, save_jump);
2698 restore_getcjmp (local_getcjmp); 2704 restore_getcjmp (local_getcjmp);
2699 tem0 = sit_for (make_fixnum (timeout), 1, 1); 2705 tem0 = sit_for (make_fixnum (timeout), 1, 1);
2700 restore_getcjmp (save_jump); 2706 unbind_to (count1, Qnil);
2701 2707
2702 if (EQ (tem0, Qt) 2708 if (EQ (tem0, Qt)
2703 && ! CONSP (Vunread_command_events)) 2709 && ! CONSP (Vunread_command_events))
@@ -3320,7 +3326,7 @@ save_getcjmp (sys_jmp_buf temp)
3320} 3326}
3321 3327
3322static void 3328static void
3323restore_getcjmp (sys_jmp_buf temp) 3329restore_getcjmp (void *temp)
3324{ 3330{
3325 memcpy (getcjmp, temp, sizeof getcjmp); 3331 memcpy (getcjmp, temp, sizeof getcjmp);
3326} 3332}