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#53798: 27.1; OSX: (redisplay) does not reliably redisplay Date: Sat, 05 Feb 2022 15:10:21 +0200 Message-ID: <83leyp1mte.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8949"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53798@debbugs.gnu.org To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 05 14:12:22 2022 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 1nGKrW-0002Bs-DX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 14:12:22 +0100 Original-Received: from localhost ([::1]:39654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGKrU-0000Ri-Pf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 08:12:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGKqE-0000QV-Rt for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 08:11:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGKqE-000208-IE for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 08:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGKqE-00046R-B9 for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 08:11: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, 05 Feb 2022 13:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53798 X-GNU-PR-Package: emacs Original-Received: via spool by 53798-submit@debbugs.gnu.org id=B53798.164406664815752 (code B ref 53798); Sat, 05 Feb 2022 13:11:02 +0000 Original-Received: (at 53798) by debbugs.gnu.org; 5 Feb 2022 13:10:48 +0000 Original-Received: from localhost ([127.0.0.1]:34062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGKq0-000460-KU for submit@debbugs.gnu.org; Sat, 05 Feb 2022 08:10:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGKpz-00045o-2M for 53798@debbugs.gnu.org; Sat, 05 Feb 2022 08:10:48 -0500 Original-Received: from [2001:470:142:3::e] (port=34152 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGKpt-0001zj-39; Sat, 05 Feb 2022 08:10:41 -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=wgRPaIgAUlWX8KXwWsa5c8ITJ8JDmpL79Mw16a+aVqM=; b=MdbNMM7t31LA QUqvBYQu8ERW/Z6SNKw891xTxRaMjdrqm430107yeQGtjSIS7X+hgUR4I+xMnIP6ZijIKBrgmu+dY rWPTJy3QY6y1n5KCWgolc+/BnSbkhZ83AjxHkUyTZfDjmU6LuQXKEF6UHPLCUewuZHvYIzJuqTrhT XEbPZz5dFwqYREu2hcg3tFb3eq8KiStwbrF9QZxZSBhiloPLEk9kyfbQdis0205ODagLZeFvwT2Wp qUCbqp+TE9GP/FgF7Mb+8HIW83ZPKiRH8PgwmXkTe5hFaWfFOC7mbqkA8CNmGmcsrYmBUlTzyd/vb eSyCzZz+k2Lt5qd1qBzV6w==; Original-Received: from [87.69.77.57] (port=4645 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 1nGKps-0007Cn-Gl; Sat, 05 Feb 2022 08:10:40 -0500 In-Reply-To: (message from Markus Triska on Sat, 05 Feb 2022 13:42:58 +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" Xref: news.gmane.io gmane.emacs.bugs:226068 Archived-At: > From: Markus Triska > Date: Sat, 05 Feb 2022 13:42:58 +0100 > > > To reproduce this issue, please start Emacs with: > > $ emacs -Q > > and evaluate the following form: > > (while t > (insert "\n" (make-string 50 ?a)) > (redisplay) > (sit-for 0.1)) > > At first, this works completely as intended: We see a growing number of > lines in the buffer, and we are shown each fresh line as it appears: > > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ... > > However, as soon as any key is pressed, the output becomes erratic in > the sense that for long stretches of time, we see no new lines at all, > and then several of them appear immediately at the same time. > > The snippet uses (redisplay) after writing each line in order to show > the line as it appears. I therefore expect to continue to see, also when > a key is pressed, each line immediately after it is written in the > buffer, not batches of multiple lines to be shown after several of them > have already been written. Is there any way to obtain this behaviour? sit-for exits immediately if some input is available, and pressing a key makes input available. So the loop starts iterating much faster than before, because sit-for no longer waits for 0.1 sec. And that is what you see. If I modify the snippet as below, it behaves the same no matter whether you press a key or not. (while t (insert "\n" (make-string 50 ?a)) (redisplay) (or (sit-for 0.1) (read-char)))