From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 5c9304e: Disable some display optimizations when frames need redisplay
Date: Sat, 03 Oct 2015 00:24:00 +0300 [thread overview]
Message-ID: <83vbap3qxb.fsf@gnu.org> (raw)
In-Reply-To: <jwveghdj8td.fsf-monnier+emacsdiffs@gnu.org>
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> 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.
next prev parent reply other threads:[~2015-10-02 21:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150930193450.11644.62040@vcs.savannah.gnu.org>
[not found] ` <E1ZhN9O-00032Q-5G@vcs.savannah.gnu.org>
2015-10-02 12:44 ` [Emacs-diffs] master 5c9304e: Disable some display optimizations when frames need redisplay Stefan Monnier
2015-10-02 13:40 ` Eli Zaretskii
2015-10-02 15:46 ` Stefan Monnier
2015-10-02 17:49 ` Eli Zaretskii
2015-10-02 20:55 ` Stefan Monnier
2015-10-02 21:24 ` Eli Zaretskii [this message]
2015-10-03 1:05 ` Stefan Monnier
2015-10-03 7:21 ` Eli Zaretskii
2015-10-04 2:33 ` Stefan Monnier
2015-10-04 9:53 ` Eli Zaretskii
2015-10-05 15:50 ` Stefan Monnier
2015-10-05 16:57 ` Eli Zaretskii
2015-10-05 22:46 ` Stefan Monnier
2015-10-06 1:19 ` Stefan Monnier
2015-10-06 7:57 ` martin rudalics
2015-10-06 16:15 ` Stefan Monnier
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=83vbap3qxb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).