From: Eli Zaretskii Date: Sat, 14 Jun 2025 08:57:42 +0000 (+0300) Subject: Support 'C-g C-g C-g' "urgent quit" feature on MS-Windows X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee4f0d1bb0e5413335ac2fa4d582a726abc7c3c7;p=emacs.git Support 'C-g C-g C-g' "urgent quit" feature on MS-Windows * src/w32fns.c (post_character_message): Support triple-C-g. (Bug#78737) (cherry picked from commit 3927402af0affcb13989a7afbacb5107badb9f80) --- diff --git a/src/w32fns.c b/src/w32fns.c index d96c051f30d..493f33486fb 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -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