]> git.eshelyaron.com Git - emacs.git/commitdiff
Support 'C-g C-g C-g' "urgent quit" feature on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Sat, 14 Jun 2025 08:57:42 +0000 (11:57 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:12:47 +0000 (10:12 +0200)
* src/w32fns.c (post_character_message): Support triple-C-g.
(Bug#78737)

(cherry picked from commit 3927402af0affcb13989a7afbacb5107badb9f80)

src/w32fns.c

index d96c051f30d23b7098020fd3dd45526b9c8e2198..493f33486fbff2af5eb5ff94ffacd5a5fa91e406 100644 (file)
@@ -3977,6 +3977,13 @@ post_character_message (HWND hwnd, UINT msg,
        || (wmsg.dwModifiers == 0
            && w32_quit_key && wParam == w32_quit_key))
       {
+       /* See keyboard.c:handle_interrupt.  We repeat the same code
+           here to support the triple-C-g feature.  */
+       static int force_quit_count;
+       int count = NILP (Vquit_flag) ? 1 : force_quit_count + 1;
+       force_quit_count = count;
+       if (count == 3)
+         Vinhibit_quit = Qnil;
        Vquit_flag = Qt;
 
        /* The choice of message is somewhat arbitrary, as long as