]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/keyboard.c: Override inhibit-quit after the third C-g.
authorJason S. Cornez <jcornez@ravenpack.com>
Tue, 10 Apr 2012 19:36:17 +0000 (15:36 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 10 Apr 2012 19:36:17 +0000 (15:36 -0400)
(force_quit_count): New var.
(handle_interrupt): Use it.

Fixes: debbugs:6585
src/ChangeLog
src/keyboard.c

index 76a8353b853a7ba656be0b18db5b66d2ed41fde4..994b8d034ffc1e51c5e95e44060daabc8eba20cc 100644 (file)
@@ -1,3 +1,9 @@
+2012-04-10  "Jason S. Cornez"  <jcornez@ravenpack.com>  (tiny change)
+
+       * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
+       (force_quit_count): New var.
+       (handle_interrupt): Use it.
+
 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
 
        * w32.c (w32_delayed_load): Record the full path of the library
@@ -17,8 +23,8 @@
        * process.h: Add integer `gnutls_handshakes_tried' member to
        process struct.
 
-       * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.  Add
-       convenience `GNUTLS_LOG2i' macro.
+       * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
+       Add convenience `GNUTLS_LOG2i' macro.
 
        * gnutls.c (gnutls_log_function2i): Convenience log function.
        (emacs_gnutls_read): Use new log functions,
        (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
        Calls xmlCleanupParser only if libxml2 was loaded (or statically
        linked in).
-       (Flibxml_parse_html_region, Flibxml_parse_xml_region): Call
-       init_libxml2_functions before calling libxml2 functions.
+       (Flibxml_parse_html_region, Flibxml_parse_xml_region):
+       Call init_libxml2_functions before calling libxml2 functions.
        (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
 
        * emacs.c: Don't include libxml/parser.h.
index 50b2ade8ee477e17a8a32d6ec40326b9604f06cc..9ff19d61d41bc7f6e713b408a8f18e58049008a6 100644 (file)
@@ -10213,7 +10213,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
 
   memset (keybuf, 0, sizeof keybuf);
   GCPRO1 (keybuf[0]);
-  gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0]));
+  gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0]));
 
   if (NILP (continue_echo))
     {
@@ -10227,7 +10227,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
     cancel_hourglass ();
 #endif
 
-  i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])),
+  i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])),
                         prompt, ! NILP (dont_downcase_last),
                         ! NILP (can_return_switch_frame), 0);
 
@@ -10918,6 +10918,11 @@ interrupt_signal (int signalnum)       /* If we don't have an argument, some */
   errno = old_errno;
 }
 
+/* If Emacs is stuck because `inhibit-quit' is true, then keep track
+   of the number of times C-g has been requested.  If C-g is pressed
+   enough times, then quit anyway.  See bug#6585.  */
+static int force_quit_count;
+
 /* This routine is called at interrupt level in response to C-g.
 
    It is called from the SIGINT handler or kbd_buffer_store_event.
@@ -11036,8 +11041,16 @@ handle_interrupt (void)
          UNGCPRO;
        }
       else
-       /* Else request quit when it's safe */
-       Vquit_flag = Qt;
+        { /* Else request quit when it's safe.  */
+          if (NILP (Vquit_flag))
+           force_quit_count = 0;
+         if (++force_quit_count == 3)
+            {
+              immediate_quit = 1;
+              Vinhibit_quit = Qnil;
+            }
+          Vquit_flag = Qt;
+        }
     }
 
 /* TODO: The longjmp in this call throws the NS event loop integration off,