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#64596: 30.0.50; On FIXME: in src/buffer.c:1481 (force-mode-line-update) Date: Sun, 16 Jul 2023 22:06:49 +0300 Message-ID: <83edl78yly.fsf@gnu.org> References: <877cr4nez9.fsf@localhost> <83lefj4okb.fsf@gnu.org> <83fs5r3tqv.fsf@gnu.org> <834jm6fppc.fsf@gnu.org> <87a5vyidy6.fsf@localhost> <83sf9qe2ip.fsf@gnu.org> <83a5vxejz6.fsf@gnu.org> <87ttu4gnpt.fsf@localhost> <83351o9m6h.fsf@gnu.org> <87ilakgmjo.fsf@localhost> <83pm4r9apt.fsf@gnu.org> <83mszv93yb.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30716"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, 64596@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 16 21:07:15 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 1qL75O-0007mY-S2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jul 2023 21:07:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qL75G-0003WW-2x; Sun, 16 Jul 2023 15:07:06 -0400 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 1qL75D-0003W8-IM for bug-gnu-emacs@gnu.org; Sun, 16 Jul 2023 15:07:03 -0400 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 1qL75C-0002FW-Ae for bug-gnu-emacs@gnu.org; Sun, 16 Jul 2023 15:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qL75B-0001j2-Uz for bug-gnu-emacs@gnu.org; Sun, 16 Jul 2023 15:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jul 2023 19:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64596 X-GNU-PR-Package: emacs Original-Received: via spool by 64596-submit@debbugs.gnu.org id=B64596.16895344036604 (code B ref 64596); Sun, 16 Jul 2023 19:07:01 +0000 Original-Received: (at 64596) by debbugs.gnu.org; 16 Jul 2023 19:06:43 +0000 Original-Received: from localhost ([127.0.0.1]:48598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qL74p-0001iP-D8 for submit@debbugs.gnu.org; Sun, 16 Jul 2023 15:06:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qL74h-0001i6-5J for 64596@debbugs.gnu.org; Sun, 16 Jul 2023 15:06:38 -0400 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 1qL74b-0001Ww-MP; Sun, 16 Jul 2023 15:06:25 -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=PDbHjc83tXtd0LmMg9fxHlVZNtO7C9e5wfc8zIY9Bi8=; b=buZBFE152KOQ MfOiB6RMhpjOX+/viveExuo3YPKP7HzOscytqa19xrjvEj+Imv0HXWrh8DovH6tS0lYljFq3hapVo gmmSsvVpsGLhZ6hXWN3w6YL0MeM/uhbYpELUmvXfANBGMV3hKgdwpDHR9HQCax3nwhbpTyWNmGmO8 itEry8skle7Dh/GEejEA/wVhVZY8GTspPuCjysWxDRralX8ZyvYFdZa4nHZd1HvDbzmQRGsDpoT9Q 3iqC3esTIC/kASbQhK4NWKoHdV8l5W63xZuLC1rmc/pnQE9RSxL4ofFlt8+OZ/30Co0RWHUwBasyj 0BXiFi5cZ71eDFMty6Y/PQ==; 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 1qL74b-0003tk-6f; Sun, 16 Jul 2023 15:06:25 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 16 Jul 2023 14:53:03 -0400) 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:265360 Archived-At: > From: Stefan Monnier > Cc: yantar92@posteo.net, 64596@debbugs.gnu.org > Date: Sun, 16 Jul 2023 14:53:03 -0400 > > >> Hmm... I'm not sure why you're saying > >> > >> frame's redisplay flag is what causes us to consider a frame in the > >> first place. > > > > Because fset_redisplay does this: > > > > void > > fset_redisplay (struct frame *f) > > { > > redisplay_other_windows (); > > f->redisplay = true; > > } > > > > and redisplay_other_windows sets windows_or_buffers_changed, which > > then causes consider_all_windows_p to be true upon the next redisplay > > cycle: > > > > consider_all_windows_p = (update_mode_lines > > || windows_or_buffers_changed); > > Yes, most calls to `[fbw]set_redisplay` will call > `redisplay_other_windows` and once that function has been called, all > the frames will be "considered", but that happens regardless of the > `redisplay` bit of any particular frame. If we always set these flags by calling these functions, then we will end up doing more in redisplay than needed, because update_mode_lines and windows_or_buffers_changed also disable certain optimizations. When someone writes code that calls fset_redisplay, he or she are likely to think that all this does is set the redisplay flag. Which is not true. If every call to fset_redisplay indeed needs to disable those optimizations, we should have more flags, and should probably not call the function fset_redisplay, but something else. > The `redisplay` bit is consulted later, once we loop over all the > windows in all those frames, where we decide which of those windows are > updated depending on the `redisplay` bits of the window, the window's > buffer, and the window's frame. That's not all of the uses of this flag. Here's one example of other uses: if (some_windows && !f->redisplay && !w->redisplay && !XBUFFER (w->contents)->text->redisplay) continue; (This avoids updating the tool bar and the tab bar of the frame, and there's a similar condition that avoids updating the frame's title.) > Are you maybe confused by the name of the `FRAME_REDISPLAY_P` macro, > which does *not* pay attention to the `redisplay` bit? No, I don't think I'm confused about that.