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#60817: 28.2; `x-focus-frame' causes spurious input events causes edebug not showing intermediate results Date: Sun, 15 Jan 2023 08:23:58 +0200 Message-ID: <837cxo71tt.fsf@gnu.org> References: <69384620685645c180d46d62042feb7d@vodafonemail.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60817@debbugs.gnu.org To: "Farblos" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 15 07:25:34 2023 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 1pGwSU-0003rz-5K for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Jan 2023 07:25:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGwS0-0000m1-Fd; Sun, 15 Jan 2023 01:25:04 -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 1pGwRz-0000lc-1W for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 01:25:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGwRy-0004CI-NC for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 01:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGwRy-000786-Cp for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 01:25: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: Sun, 15 Jan 2023 06:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60817 X-GNU-PR-Package: emacs Original-Received: via spool by 60817-submit@debbugs.gnu.org id=B60817.167376384227317 (code B ref 60817); Sun, 15 Jan 2023 06:25:02 +0000 Original-Received: (at 60817) by debbugs.gnu.org; 15 Jan 2023 06:24:02 +0000 Original-Received: from localhost ([127.0.0.1]:55999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGwQz-00076P-J4 for submit@debbugs.gnu.org; Sun, 15 Jan 2023 01:24:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGwQx-00076C-PZ for 60817@debbugs.gnu.org; Sun, 15 Jan 2023 01:24:00 -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 1pGwQs-00044q-9K; Sun, 15 Jan 2023 01:23:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YQ5QF5amIprSf1XJq4SZzH+kqxfzKBG3LemXY3U7+Mg=; b=oeHib+7/aTd6 3ikRlyq13ChBm2UDNcCtwFi1K7O6S+h4FBrCG8tuONXPQrDKIbR2RSyELNb/3UJMYvbhOcaDuK3c4 xR8dfzju4JU+qogtoXxKdXT0RziyCJS/NJ+nqj+hHX+F7hWopk6q0wQ9dD8/05OcZnLIq+Gqc7GCA Zbcvrjo2V8MyP6vnFAAiL8QsF2HV+ysS2w7m3X98Yg6cS1+iegbQMn6f8sKRb8jB5qNGRQTFot1zk AV1JQbfia70I4Az6rHKFKS1JWo/Gnzluao8xXq2EPxBuVAbI/1TzhLLVsB5rWYJ0BhXn8o6jd7/r/ XQAWeTlrprKqcWXx3LOPBA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGwQr-0006T7-PV; Sun, 15 Jan 2023 01:23:54 -0500 In-Reply-To: <69384620685645c180d46d62042feb7d@vodafonemail.de> (bug-gnu-emacs@gnu.org) 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:253406 Archived-At: > Date: Sat, 14 Jan 2023 22:55:15 +0100 > From: "Farblos" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > This is Emacs 28.2 from the Debian emacs-lucid package running on fvwm3 > on Xorg. I guess that either the lucid toolkit or fvwm3 is part of the > problem here, since I cannot reproduce this on a gtk3 Emacs. > > To demonstrate the problem: > > emacs -Q > M-x find-function fundamental-mode RET > C-u C-M-x ; instrument function > C-x 4 b *Messages* RET ; show message buffer > C-x o > M-x fundamental-mode RET ; call function > > Then step through function `fundamental-mode' in edebug using SPC. > While doing so I do not get the intermediate evaluation results > displayed, but rather only the message "Stop". My message buffer looks > like this after stepping through the function: > > fundamental-mode > Stop > > Result: nil > Stop > > Stop > > Result: nil > Stop > > Meaning: These permanent "Stop" messages hide the intermediate > results. I haven't found much information on this on the net, > only the following thread on gnu.emacs.help: > > https://groups.google.com/g/gnu.emacs.help/c/ojSN-PgNvxg > > The cause seems to be the call to function `x-focus-frame' in > function `edebug--display-1': > > (if (not (memq (framep (selected-frame)) '(nil t pc))) > (x-focus-frame (selected-frame))) > > When I instrument that snippet to > > (when (not (memq (framep (selected-frame)) '(nil t pc))) > (message "input-pending-pre: %S" (input-pending-p)) > (x-focus-frame (selected-frame)) > (message "input-pending-pst: %S" (input-pending-p))) > > my message buffer looks like this instead: > > fundamental-mode > input-pending-pre: t > input-pending-pst: t > Stop > > input-pending-pre: nil > input-pending-pst: t > Result: nil > Stop > > input-pending-pre: nil > input-pending-pst: t > Stop > > input-pending-pre: nil > input-pending-pst: t > Result: nil > Stop > > That spurious pending input caused by `x-focus-frame' triggers > the following snippet later in function `edebug--display-1': > > (when (input-pending-p) > (setq edebug-stop t) > (setq edebug-execution-mode 'step) ; for `edebug-overlay-arrow' > (edebug-stop)) > > which causes the "Stop" messages. AFAIU, input-pending-p should filter out focus events, so I don't think I understand why you see this. Can you try this in Emacs 29 or the master branch of the Emacs Git repository, so we make sure this problem was not fixed already? If it still happens in those newer versions, maybe you can step with GDB through get_input_pending, when it's called from input-pending-p, and through readable_events called by get_input_pending, and see why focus events aren't filtered out?