unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: yantar92@posteo.net, 64596@debbugs.gnu.org
Subject: bug#64596: 30.0.50; On FIXME: in src/buffer.c:1481 (force-mode-line-update)
Date: Sun, 16 Jul 2023 20:11:24 +0300	[thread overview]
Message-ID: <83mszv93yb.fsf@gnu.org> (raw)
In-Reply-To: <jwvsf9n969o.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sun, 16 Jul 2023 12:44:08 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: yantar92@posteo.net,  64596@debbugs.gnu.org
> Date: Sun, 16 Jul 2023 12:44:08 -0400
> 
> >   1a - decide whether all the windows need to be considered, or just
> >        the selected window
> >   1b - if all the windows need to be considered, decide for each frame
> >        whether it needs to be considered, and if so, consider all of
> >        that frame's windows
> >
> > Considering a window can sometimes decide very quickly that the window
> > doesn't need to be redisplayed, but, as I mentioned elsewhere, when
> > its frame's redisplay flag is set, we never decide that, and the
> > frame's redisplay flag is what causes us to consider a frame in the
> > first place.
> 
> 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);

> If the redisplay toplevel could be hacked in ELisp, follow-mode could
> call the `update-window-glyph-matrix` on the "main window" of its
> window-set first, then get the resulting window-end/start and use that
> to adjust/scroll its next/prev windows, and then call
> `update-window-glyph-matrix` on them, thus propagating the information
> in the right direction and avoiding unnecessary redisplay computations.
> 
> > But if you want to be able to tell redisplay "update only this window
> > and nothing else", I think it should be easy to accomplish by adding
> > a single function and no other changes: all you need is to call
> > 'redisplay' (which is already exposed) after setting the redisplay
> > flag of a single window.
> 
> That won't avoid redisplaying the other windows whose `redisplay` bits
> had been set already for other reasons.

Yes, it will: when a window is redisplayed by redisplay_window, its
redisplay flag is reset, and it will not be redisplayed during this
cycle.  So if you have a way to redisplay a single window, you can do
that in any order you want, one window at a time, and those windows
which you redisplayed in this way will not be redisplayed until the
next cycle.

As for update-window-glyph-matrix, I don't see why that would help,
because updating the matrix without calling update_window fairly soon
after that will not produce the effect that you want.

> I guess we could try to "save the redisplay bit" of other
> windows/buffers/frames, and restore them afterwards.

What for?

> Also, it would be good to be able to compute the glyph matrices of
> the various affected windows before we do the actual glass update
> (especially if we want to handle iteration where some part of the
> redisplay (e.g. jit-lock, evaluation of mode-lines and menu bars,
> point moving out of scope forcing a scroll, you name it) causes
> changes which require recomputing a glyph matrix we just computed).

Sounds like an unnecessary complication to me, and for some situations
I'm not even sure how you can handle them, unless you thoroughly
redesign the display code.

IOW, this is not just a matter of exposing a small number of functions
to Lisp, IMO.





  reply	other threads:[~2023-07-16 17:11 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:00 bug#64596: 30.0.50; On FIXME: in src/buffer.c:1481 (force-mode-line-update) Ihor Radchenko
2023-07-13 13:34 ` Eli Zaretskii
2023-07-13 17:19   ` Ihor Radchenko
2023-07-13 19:03     ` Eli Zaretskii
2023-07-14 11:53   ` Ihor Radchenko
2023-07-14 12:25     ` Eli Zaretskii
2023-07-14 13:48       ` Ihor Radchenko
2023-07-14 14:20         ` Eli Zaretskii
2023-07-14 14:50       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14 14:20     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14 15:56       ` Eli Zaretskii
2023-07-13 17:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-13 19:08   ` Eli Zaretskii
2023-07-13 21:00     ` Ihor Radchenko
2023-07-13 22:02     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14  6:14       ` Eli Zaretskii
2023-07-14 14:31         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14 16:00           ` Eli Zaretskii
2023-07-14 17:38             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14 17:46               ` Ihor Radchenko
2023-07-14 19:06                 ` Eli Zaretskii
2023-07-15  7:01                   ` Eli Zaretskii
2023-07-15  7:22                     ` Ihor Radchenko
2023-07-15  8:52                       ` Eli Zaretskii
2023-07-15 14:49                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 15:22                       ` Eli Zaretskii
2023-07-15 16:01                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 16:16                           ` Eli Zaretskii
2023-07-15 17:15                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 19:04                               ` Eli Zaretskii
2023-07-16 10:38                               ` Ihor Radchenko
2023-07-16 11:26                                 ` Eli Zaretskii
2023-07-15 18:15                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 19:18                               ` Eli Zaretskii
2023-07-15 19:28                               ` Eli Zaretskii
2023-07-15 19:43                                 ` Ihor Radchenko
2023-07-15 23:10                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16  4:57                                   ` Eli Zaretskii
2023-07-16  5:49                                     ` Ihor Radchenko
2023-07-16  7:15                                       ` Eli Zaretskii
2023-07-16  8:26                                     ` martin rudalics
2023-07-16  8:40                                       ` Ihor Radchenko
2023-07-16  8:56                                         ` Eli Zaretskii
2023-07-16  9:41                                           ` Ihor Radchenko
2023-07-16 10:30                                             ` Eli Zaretskii
2023-07-16  8:50                                       ` Eli Zaretskii
2023-07-17  8:30                                         ` martin rudalics
2023-07-15 22:53                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16  5:17                                   ` Eli Zaretskii
2023-07-16  5:52                                   ` Ihor Radchenko
2023-07-16  7:16                                     ` Eli Zaretskii
2023-07-16  7:28                                       ` Ihor Radchenko
2023-07-16  7:35                                         ` Eli Zaretskii
2023-07-16 14:04                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 14:27                                       ` Eli Zaretskii
2023-07-16 14:49                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 10:22                       ` Ihor Radchenko
2023-07-16 10:37                         ` Eli Zaretskii
2023-07-16 10:47                           ` Ihor Radchenko
2023-07-16 11:31                             ` Eli Zaretskii
2023-07-16 14:26                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 14:45                               ` Eli Zaretskii
2023-07-16 16:44                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 17:11                                   ` Eli Zaretskii [this message]
2023-07-16 17:20                                     ` Eli Zaretskii
2023-07-16 18:53                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 19:06                                       ` Eli Zaretskii
2023-07-16 22:19                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-17 11:20                                           ` Eli Zaretskii
2023-07-17 12:53                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-17 13:07                                               ` Eli Zaretskii
2023-07-16 19:27                         ` Eli Zaretskii
2023-07-16 20:12                           ` Ihor Radchenko
2023-07-17  2:23                             ` Eli Zaretskii
2023-07-17  9:22                               ` Ihor Radchenko
2023-07-17 11:54                                 ` Eli Zaretskii
2023-07-17 12:00                                   ` Ihor Radchenko
2023-07-17 12:22                                     ` Eli Zaretskii
2023-07-18  9:52                                       ` Ihor Radchenko
2023-07-18 11:51                                         ` Eli Zaretskii
2023-07-19 10:11                                           ` Ihor Radchenko
2023-07-19 14:55                                             ` Eli Zaretskii
2023-07-19 15:50                                               ` Ihor Radchenko
2023-07-19 16:30                                                 ` Eli Zaretskii
2023-07-20  9:40                                                   ` Ihor Radchenko
2023-07-20 10:23                                                     ` Eli Zaretskii
2023-07-21  2:41                                         ` Richard Stallman
2023-07-21  5:48                                           ` Eli Zaretskii
2023-07-23  3:01                                             ` Richard Stallman
2023-07-14 19:05               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mszv93yb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64596@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).