emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107849: * src/keyboard.c: Override i


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107849: * src/keyboard.c: Override inhibit-quit after the third C-g.
Date: Tue, 10 Apr 2012 15:36:17 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107849
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6585
author: "Jason S. Cornez" <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2012-04-10 15:36:17 -0400
message:
  * src/keyboard.c: Override inhibit-quit after the third C-g.
  (force_quit_count): New var.
  (handle_interrupt): Use it.
modified:
  src/ChangeLog
  src/keyboard.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-04-10 14:16:05 +0000
+++ b/src/ChangeLog     2012-04-10 19:36:17 +0000
@@ -1,3 +1,9 @@
+2012-04-10  "Jason S. Cornez"  <address@hidden>  (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  <address@hidden>
 
        * 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,
@@ -104,8 +110,8 @@
        (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.

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-04-04 07:54:02 +0000
+++ b/src/keyboard.c    2012-04-10 19:36:17 +0000
@@ -10213,7 +10213,7 @@
 
   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 @@
     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 @@
   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 @@
          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,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]