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#45898: 27.1; wedged in redisplay again Date: Wed, 08 Jun 2022 18:58:08 +0300 Message-ID: <8335gf5er3.fsf@gnu.org> References: <46b65e3f-cf3d-a3f2-9a9a-100e58274ff6@jovi.net> <87h74wh9x7.fsf@gnus.org> <83bkv47evy.fsf@gnu.org> <87k09rbcmn.fsf@gnus.org> <83a6an5jt3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21302"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org To: larsi@gnus.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 08 17:59:32 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 1nyy5k-0005N9-6d for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jun 2022 17:59:32 +0200 Original-Received: from localhost ([::1]:48704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyy5i-0004Dr-Id for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jun 2022 11:59:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyy5G-0004Cz-Kv for bug-gnu-emacs@gnu.org; Wed, 08 Jun 2022 11:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyy5G-0008Qn-CR for bug-gnu-emacs@gnu.org; Wed, 08 Jun 2022 11:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nyy5G-0007dn-AJ for bug-gnu-emacs@gnu.org; Wed, 08 Jun 2022 11:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jun 2022 15:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45898 X-GNU-PR-Package: emacs Original-Received: via spool by 45898-submit@debbugs.gnu.org id=B45898.165470390329318 (code B ref 45898); Wed, 08 Jun 2022 15:59:02 +0000 Original-Received: (at 45898) by debbugs.gnu.org; 8 Jun 2022 15:58:23 +0000 Original-Received: from localhost ([127.0.0.1]:44032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyy4d-0007co-Cv for submit@debbugs.gnu.org; Wed, 08 Jun 2022 11:58:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyy4b-0007cT-6Y for 45898@debbugs.gnu.org; Wed, 08 Jun 2022 11:58:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyy4V-0008OA-F1; Wed, 08 Jun 2022 11:58:15 -0400 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=Q+XtxrO2SWKas9gvute4TZUkTEindfFhWM99A2WPTRw=; b=CivhbzPOPMwN +cvdqqlQxbZl7qSUwGy6MQXKcKbuiqHadphL4zt+AH3GSRfCeLo+379eFAvRRWFCgdJjh9A0lew4z BH07RFHatZUBYqkEe8IcoCjshkbLWEcq8S2k3W1RIPOVjfTxbSKlHkQVBbl78+jftZpioM2QeFpu6 6AFz8C4mknT7XwhsQ1n1iZ6GwE144ZaZdnUlsqh6lya5i1SzMMg4DZ6ZqoQnCWiJFTYzlVMWWp1fD Jww8BBjb8amBcUl5YgQqnu0vOd/QRSK1i7O5NAsZDslchmUIbi3elnRk0V0mMpz80mmjy/ZQsLz4Y isnMDsTVqIKvE8cTPU2X1Q==; Original-Received: from [87.69.77.57] (port=2640 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 1nyy4U-0005aB-Pw; Wed, 08 Jun 2022 11:58:15 -0400 In-Reply-To: <83a6an5jt3.fsf@gnu.org> (message from Eli Zaretskii on Wed, 08 Jun 2022 17:08:56 +0300) 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:233980 Archived-At: > Cc: Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org > Date: Wed, 08 Jun 2022 17:08:56 +0300 > From: Eli Zaretskii > > > From: Lars Ingebrigtsen > > Cc: Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org > > Date: Wed, 08 Jun 2022 13:47:28 +0200 > > > > But if we had this facility (i.e., a way to make Emacs call some > > function after `C-g'-ing a lot during redisplay), then we can start > > experimenting -- and users can, too. So I think having a > > `break-during-redisplay-function' variable that specifies something to > > be called in these situations would allow some possible progress in this > > area. > > One problem with this is that we already have the "emergency exit" > feature, which is triggered by 2 or more C-g's. This only works > reliably on TTY frames, but it's still a feature we don't want to > lose. > > The other problem is that I don't know how to do this safely. Btw, this says "redisplay", but that's somewhat misleading: in many cases I've seen, at least half of the time, and sometimes most of it, is spent in the move_it_* functions, which are called both from the display engine (to make layout decisions), and more-or-less directly from Lisp, like via posn-at-point, vertical-motion, and scrolling commands. These are not "redisplay", strictly speaking, although they reuse a lot of the display code. So one challenge is to detect the "during redisplay" situation, including the fact that it's "still the same redisplay cycle". As for the C-g idea, I think a better and cleaner idea would be to use atimers to detect signs of potentially a very long redisplay cycle, and then do...something. Not unlike what we already do with the hourglass-cursor feature. Other clever ideas are welcome.