From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69561: 30.0.50; Freeze from M-x gnus on macOS Date: Sat, 09 Mar 2024 09:33:55 +0200 Message-ID: <864jdfzwnw.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69561@debbugs.gnu.org, alan@idiocy.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 09 08:34:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rirEP-0002fI-J5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Mar 2024 08:34:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rirE4-000256-Sc; Sat, 09 Mar 2024 02:34:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rirDz-00024e-Hi for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2024 02:34:32 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rirDx-0005uj-KC for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2024 02:34:30 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rirET-0001TR-Vl for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2024 02:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2024 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69561 X-GNU-PR-Package: emacs Original-Received: via spool by 69561-submit@debbugs.gnu.org id=B69561.17099696805635 (code B ref 69561); Sat, 09 Mar 2024 07:35:01 +0000 Original-Received: (at 69561) by debbugs.gnu.org; 9 Mar 2024 07:34:40 +0000 Original-Received: from localhost ([127.0.0.1]:60409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rirE7-0001So-RY for submit@debbugs.gnu.org; Sat, 09 Mar 2024 02:34:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rirE5-0001Sc-O1 for 69561@debbugs.gnu.org; Sat, 09 Mar 2024 02:34:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rirDS-0005rg-OV; Sat, 09 Mar 2024 02:33:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=I4dV8O3pv9Wnm17vnax3y2N2ArntVWYFIRoUiycQVcM=; b=DziyFkOXRXlfTYTxYqwV 38QAE8jK7EJUECwvAZPtcnQMDCIVKQPrQxDUTA6K+A6JeRI1RNfoRPkw0eNEzts4MDGPlnHn1Th99 kixBno1zv/THnOlPxWMH46Rjx+pEe8LkLFvc3EZC9d3iMfBNW29AIxXGe6DqmrU51O4qzfYQff0uH pbiXsn7U3XpY1pEFktENMh6OP4wW8fN2lAhH743lN+iVrd0vQGWGZW6NNcKYO18G0PABGMkkAIQuA XCqb/ty0DAKfOO7KwLnqAe6B6Epo6aNwPbDnBQzkxFl+KDYnZAfG19p/8pX5WuWplwji1BJXYJmIs WS1+t22EnQIHQA==; In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Thu, 07 Mar 2024 20:29:44 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281298 Archived-At: > Cc: 69561@debbugs.gnu.org > From: Gerd Möllmann > Date: Thu, 07 Mar 2024 20:29:44 +0100 > > Alan Third writes: > > >> Thanks. That's in if (read_kbd), and the first backtrace I sent had > >> > >> frame #6: 0x00000001001d94d2 > >> emacs`wait_reading_process_output(time_limit=, > >> nsecs=, read_kbd=0, do_display=false, > >> wait_for_cell=(struct Lisp_Symbol *) $123 = 0x00000001007d24b0, > >> wait_proc=0x00007fccffdcc9d8, just_wait_proc=0) at process.c:5484:9 > >> [opt] > >> > >> i.e. read_kbd should be 0. > >> > >> Maybe that's also an explanation why it doesn't freeze most of time? > >> If it sometimes does detect_input_pending... > > > > So this > > > > READ_KBD is: > > 0 to ignore keyboard input, or > > 1 to return when input is available, or > > -1 meaning caller will actually read the input, so don't throw to > > the quit handler > > > > implies that if read_kbd is zero then we should be able to quit? > > I'm afraid I can't answer that. Maybe Eli can, or knows someone who can? I think the fragment below answers the question? /* If calling from keyboard input, do not quit since we want to return C-g as an input character. Otherwise, do pending quit if requested. */ if (read_kbd >= 0) maybe_quit (); So yes, if read_kbd is zero, we should be able to quit. > > If that's the case then we need some special handling in nsterm.m for > > C-g, I suppose. > > > > Having dug around in other terms I assume this means setting > > Vquit_flag? So in the keyDown method we should identify C-g and set > > Vquit_flag...? > > As far as I understand the code, Vquit_flag will also be set by storing > the event in question with kbd_buffer_store_event_hold. I think that > would be the easiest way. And it's what ns_read_socket already does. Setting Vquit_flag directly has the advantage that it will cause C-g to be processed earlier, without waiting for all the previous queued inputs to be processed first. In general, users expect C-g to be processed ASAP.