emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 5c9304e: Disable some display optimizations whe


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master 5c9304e: Disable some display optimizations when frames need redisplay
Date: Sat, 03 Oct 2015 00:24:00 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Fri, 02 Oct 2015 16:55:00 -0400
> 
> >> >> So, what am I missing?
> >> > The setting of windows_or_buffers_changed in fset_redisplay can now be
> >> > removed.
> >> Why would we want to do that?
> 
> > Because a global variable cannot possibly convey the information that
> > only frames F1 and F2 need to be redisplayed.  Only frame-specific
> > variables can do that.
> 
> I know.  But the way windows_or_buffers_changed works, currently it has
> 3 possible values:
> - 0: only the selected-window needs to be redisplayed.
> - 2: all frames/windows/buffers which have the `redisplay' bit set need
>   to be redisplayed
> - >2: all frames&windows need to be redisplayed.
> 
> So, the value 2 (aka REDISPLAY_SOME) already gives you the information
> that "only frames F1 and F2 need to be redisplayed".

But you need to examine the frame's 'redisplay' flag anyway.  So that
special value of windows_or_buffers_changed just adds management (you
need to reset it, and it can acquire higher values depending on what
redisplay_internal discovers), without adding any value.  The loop
over all frames checking whether any have the 'redisplay' flag set is
fast, so there's no need for a global flag to convey that.

> 100% agreement, and that's why I introduced those `redisplay' bits and
> the corresponding REDISPLAY_SOME value for windows_or_buffers_changed.
> 
> And AFAIK it already has the effect that when we call fset_redisplay only
> those frames get redisplayed.

Maybe so, but the effect of this on frames is completely undocumented,
and the name REDISPLAY_SOME has no mnemonic value that helps realize
its meaning.  Also, the fact that fset_redisplay, a setter function,
also sets windows_or_buffers_changed (and then does some more) is IMO
not a good idea, as it gets in the way of understanding the logic
without reading all the functions that are called, just by looking at
their names.

Anyway, I wish all this was written somewhere, rather than divulged in
a discussion of some commit.  The fact that you never documented these
parts in the code, and I never until now knew them, is regrettable, to
say the least.

> Also rather than "don't set windows_or_buffers_changed in
> fset_redisplay", it seems like it would be safer to try and eliminate
> (one by one) the places where we check the value of
> windows_or_buffers_changed instead of checking f->redisplay or something
> like that.

You cannot eliminate windows_or_buffers_changed without replacing them
with something.  They are there for a reason.  It could be that the
effect of having that variable non-zero is too radical, and causes too
thorough redisplay, but then the solution is surely not elimination.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]