aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index bad91ea3f72..79d9e7a18e8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -7200,6 +7200,7 @@ handle_async_input (void)
7200#endif 7200#endif
7201} 7201}
7202 7202
7203#ifdef SYNC_INPUT
7203void 7204void
7204process_pending_signals (void) 7205process_pending_signals (void)
7205{ 7206{
@@ -7207,6 +7208,7 @@ process_pending_signals (void)
7207 handle_async_input (); 7208 handle_async_input ();
7208 do_pending_atimers (); 7209 do_pending_atimers ();
7209} 7210}
7211#endif
7210 7212
7211#ifdef SIGIO /* for entire page */ 7213#ifdef SIGIO /* for entire page */
7212/* Note SIGIO has been undef'd if FIONREAD is missing. */ 7214/* Note SIGIO has been undef'd if FIONREAD is missing. */
@@ -10218,7 +10220,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
10218 10220
10219 memset (keybuf, 0, sizeof keybuf); 10221 memset (keybuf, 0, sizeof keybuf);
10220 GCPRO1 (keybuf[0]); 10222 GCPRO1 (keybuf[0]);
10221 gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0])); 10223 gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0]));
10222 10224
10223 if (NILP (continue_echo)) 10225 if (NILP (continue_echo))
10224 { 10226 {
@@ -10232,7 +10234,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
10232 cancel_hourglass (); 10234 cancel_hourglass ();
10233#endif 10235#endif
10234 10236
10235 i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])), 10237 i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])),
10236 prompt, ! NILP (dont_downcase_last), 10238 prompt, ! NILP (dont_downcase_last),
10237 ! NILP (can_return_switch_frame), 0); 10239 ! NILP (can_return_switch_frame), 0);
10238 10240
@@ -10923,6 +10925,11 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
10923 errno = old_errno; 10925 errno = old_errno;
10924} 10926}
10925 10927
10928/* If Emacs is stuck because `inhibit-quit' is true, then keep track
10929 of the number of times C-g has been requested. If C-g is pressed
10930 enough times, then quit anyway. See bug#6585. */
10931static int force_quit_count;
10932
10926/* This routine is called at interrupt level in response to C-g. 10933/* This routine is called at interrupt level in response to C-g.
10927 10934
10928 It is called from the SIGINT handler or kbd_buffer_store_event. 10935 It is called from the SIGINT handler or kbd_buffer_store_event.
@@ -11041,8 +11048,16 @@ handle_interrupt (void)
11041 UNGCPRO; 11048 UNGCPRO;
11042 } 11049 }
11043 else 11050 else
11044 /* Else request quit when it's safe */ 11051 { /* Else request quit when it's safe. */
11045 Vquit_flag = Qt; 11052 if (NILP (Vquit_flag))
11053 force_quit_count = 0;
11054 if (++force_quit_count == 3)
11055 {
11056 immediate_quit = 1;
11057 Vinhibit_quit = Qnil;
11058 }
11059 Vquit_flag = Qt;
11060 }
11046 } 11061 }
11047 11062
11048/* TODO: The longjmp in this call throws the NS event loop integration off, 11063/* TODO: The longjmp in this call throws the NS event loop integration off,