GNU bug report logs - #81573
30.2; sit-for sometimes does not delay as expected

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Markus Triska <triska@HIDDEN>; dated Fri, 7 Aug 2026 06:18:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Changed bug title to '30.2; sit-for sometimes does not delay as expected' from '31.0.90; sit-for sometimes does not delay as expected' Request was from Sean Whitton <spwhitton@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 81573 <at> debbugs.gnu.org:


Received: (at 81573) by debbugs.gnu.org; 7 Aug 2026 10:57:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 07 06:57:25 2026
Received: from localhost ([127.0.0.1]:43659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wsIGT-0006CI-Lh
	for submit <at> debbugs.gnu.org; Fri, 07 Aug 2026 06:57:25 -0400
Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]:42193)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1wsIGR-0006Bu-0f; Fri, 07 Aug 2026 06:57:23 -0400
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfout.stl.internal (Postfix) with ESMTP id 853381D0007E;
 Fri,  7 Aug 2026 06:57:17 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-04.internal (MEProxy); Fri, 07 Aug 2026 06:57:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:cc:content-type:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm2; t=1786100237; x=
 1786186637; bh=2M328FTQfIeY9srTLS5ebBn4HogNc3y9sZ8yeCTqSYk=; b=X
 5KkRaIDuVTzEvtWnDVufYfB/uZCRnm6kGDRVsdDt8zpmMxHkAa/V/ecg+PzKSzo8
 bA9NZg09PqRPdT28WRohrfolgKJkVNpaKhhnbDOHqCVIi6zKylJh4tcOH744HMI3
 8v6UR5I7V8kq3X+UUr9Rs3OW57xiGzjlXhFseuZvJhyXL7OMfwi57AM9BmlYeTdy
 SAk64t55AFPmwnTFqUTYRGcDgpsyGg/ndIHN/57d5ygVpgR2BwdNBEh9Kd8GmVkN
 PmPCpz3+QAswTxPt0fvV9GqRUUj6drsSA65bK/NRrchUxy/KgcnL2H2aWFGttNpf
 QF3zlPEOmDiev8koJpzlA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
 1786100237; x=1786186637; bh=2M328FTQfIeY9srTLS5ebBn4HogNc3y9sZ8
 yeCTqSYk=; b=jn1YrRmBMXEQzWCx2IHPYtMIDtSY884BQO/hrPvOOTarruzlVIT
 Olx5grTRNHIG/Nkn5U1LcddclOWWRXhFA3hXiOxv7VI3wVuDL/yH6m3G/q1Znkxg
 cMWS8lv4jOy8Lf/QyVr6tq4GGJpJU2PxhuJe9qBwdcxAhn3D8z6KFaUb4IsqDUK3
 itpqIdxbBH/SmQtCV1j+mblcQq6PeSengYvJDmMd3EET8bFfdUsBPqH4fqioEaur
 EwmjopWLfA2s7sHCXbpUzKs1paJWe/+IWJw/WMHjZrKdXeEmV2CrFSEZoWPslmJk
 YnAUsskkix8HqCaz7DiSeQ77GMp2xfE0GYQ==
X-ME-Sender: <xms:Dbp1avalZNWNW9H2kSnbETakbyKAZKieq-Wb3Zsr589qIiHdvU2yqA>
 <xme:Dbp1asO73XSHXH3l_gfpg1gYPl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gKMEkAPJfubVKssWeRUXHzn9V2aEk6T9bvAi2meACWEYQ>
 <xmx:Dbp1aj2qGM6tbrMDq7D05ueNKNpdt0qXJMqozwEmZ8oJaBaA9LHFoQ>
 <xmx:Dbp1av_0TeXGI11-jzvt1glFv1fPwoF2iC2DgITMqg0DAcgCjcEbZkmk>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 7 Aug 2026 06:57:16 -0400 (EDT)
Received: by zephyr.silentflame.com (Postfix, from userid 1000)
 id 1D790940AAB; Fri, 07 Aug 2026 11:57:14 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Markus Triska <triska@HIDDEN>, 81573 <at> debbugs.gnu.org
Subject: Re: bug#81573: 31.0.90; sit-for sometimes does not delay as expected
In-Reply-To: <20260807062422.9DAEEF08652@triska-ser8>
References: <20260807062422.9DAEEF08652@triska-ser8>
Date: Fri, 07 Aug 2026 11:57:14 +0100
Message-ID: <87v79mw645.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81573
Cc: martin rudalics <rudalics@HIDDEN>, control <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

retitle 81573 30.2; sit-for sometimes does not delay as expected
thanks

Markus Triska [07/Aug  8:24am +02] wrote:
> This difference between "-nw" and GUI sessions occurs as of:
>
>     458024a3d9e3c58d11deeb879ffc73c96840f6f0

This one is not Emacs 31-specific, too, then.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#81573; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Aug 2026 06:17:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 07 02:17:50 2026
Received: from localhost ([127.0.0.1]:42168 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wsDtt-0007Oc-PO
	for submit <at> debbugs.gnu.org; Fri, 07 Aug 2026 02:17:50 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:43356)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mt@triska-ser8>) id 1wsDtp-0007OH-M2
 for submit <at> debbugs.gnu.org; Fri, 07 Aug 2026 02:17:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mt@triska-ser8>) id 1wsDth-000537-0X
 for bug-gnu-emacs@HIDDEN; Fri, 07 Aug 2026 02:17:37 -0400
Received: from [78.47.144.35] (helo=metalevel.at)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <mt@triska-ser8>) id 1wsDtc-0002c9-0J
 for bug-gnu-emacs@HIDDEN; Fri, 07 Aug 2026 02:17:36 -0400
Received: from triska-ser8 (localhost [127.0.0.1])
 by metalevel.at (Postfix) with ESMTP id 9C5829C776;
 Fri,  7 Aug 2026 08:17:29 +0200 (CEST)
Received: by triska-ser8 (Postfix, from userid 1000)
 id 9DAEEF08652; Fri, 07 Aug 2026 08:24:22 +0200 (CEST)
From: Markus Triska <triska@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.90; sit-for sometimes does not delay as expected
X-Debbugs-Cc: 
Message-Id: <20260807062422.9DAEEF08652@triska-ser8>
Date: Fri, 07 Aug 2026 08:24:22 +0200 (CEST)
X-Host-Lookup-Failed: Reverse DNS lookup failed for 78.47.144.35 (failed)
Received-SPF: none client-ip=78.47.144.35; envelope-from=mt@triska-ser8;
 helo=metalevel.at
X-Spam_score_int: -8
X-Spam_score: -0.9
X-Spam_bar: /
X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, RDNS_NONE=0.793, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: submit
Cc: martin rudalics <rudalics@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

This is an issue that we found during the discussion of #80131:

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80131#53

I file it here separately so that it can be discussed and addressed
separately, and is not forgotten after the other issue is closed.

To reproduce this issue, please start Emacs with:

    $ emacs -Q

and then evaluate the following form:

    (while t
      (let ((buf (get-buffer-create "sit-for-example"))
            (old-frame (selected-frame))
            (frame (make-frame `((parent-frame . ,(selected-frame))
                                 (left . 0)
                                 (minibuffer . nil)
                                 (visibility . nil)
                                 (top . 0)))))
        (set-frame-width frame 200 nil t)
        (set-frame-height frame 100 nil t)
        (set-frame-parameter frame 'visibility t)
        (discard-input)
        (unwind-protect
            (progn
              (select-frame-set-input-focus frame)
              (switch-to-buffer buf)
              (erase-buffer)
              (setq mode-line-format nil)
              (let ((chars (string-to-list "Hello!")))
                (while chars
                  (insert (pop chars))
                  (sit-for 0.1))))
          (select-frame-set-input-focus old-frame)
          (delete-frame frame))))

Unexpectedly, sit-for does not wait as expected. It works as intended
in the terminal, i.e., when I launch Emacs with "$ emacs -Q -nw".

This difference between "-nw" and GUI sessions occurs as of:

    458024a3d9e3c58d11deeb879ffc73c96840f6f0

As discussed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80131#71,
the following one-line change can be used to address the issue:

diff --git a/src/xterm.c b/src/xterm.c
index ac115c4ba1a..83fc583782c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -29033,7 +29033,7 @@ x_focus_frame (struct frame *f, bool noactivate)
 	     A BadMatch error can occur if the window was obscured
 	     after the time of the last user interaction without
 	     changing the last-focus-change-time.  */
-	  x_set_input_focus (FRAME_DISPLAY_INFO (f), FRAME_OUTER_WINDOW (f),
+	  x_set_input_focus (FRAME_DISPLAY_INFO (f), FRAME_X_WINDOW (f),
 			     time);
 	}
       else

Please consider applying the change, or a different way to resolve this.

Thank you and all the best,
Markus



In GNU Emacs 31.0.90 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw
 scroll bars) of 2026-07-19 built on beelink-ser8
Repository revision: 407de5142c2631d42d53c8da470188f61e46ab22
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Debian GNU/Linux 13 (trixie)

Configured using:
 'configure --without-cairo --with-x-toolkit=lucid
 --with-xpm=ifavailable --with-gif=ifavailable --with-tiff=ifavailable
 --with-gnutls=ifavailable --with-native-compilation=no'

Configured features:
DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSYSTEMD
LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS
TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XFT XIM XINERAMA
XINPUT2 XPM XRANDR LUCID ZLIB





Acknowledgement sent to Markus Triska <triska@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#81573; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 7 Aug 2026 11:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.