From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: selected-frame and selected-window
Date: Tue, 20 Nov 2012 15:37:05 -0500 [thread overview]
Message-ID: <jwvk3tg2fef.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <837gpgvz81.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Nov 2012 21:41:34 +0200")
> This is assertion violation in redisplay_internal, here:
> eassert (EQ (XFRAME (selected_frame)->selected_window,
> selected_window));
> This crash is probably of the kind you reported in the past, related
> to the selected-frame/selected-window issues.
I'm not sure is that assertion is actually right.
99% of the time the (frame-selected-window) is the same as the
(selected-window), but there are some exceptions. So far I found two:
- one in the redisplay, where we change selected-frame (without changing
selected-window) just to get the frame-local variables. As soon as we
drop frame-local variables, this one will disappear (e.g. it's gone in
my local branch).
- one in the mode-line computation. This one is nasty because it is
visible to lisp: while running an (:eval <form>) element, we change
selected-window (without changing frame-selected-window) to the window
being redisplayed. So in <form>, it is not always true that
(eq (selected-window) (frame-selected-window)). To some extent this
could be a feature (lets you return different data for the mode-line
depending on whether it's selected or not), but I'd rather get this
information differently since it is so easy to assume that
(eq (selected-window) (frame-selected-window)) without being aware of it.
There might be more cases: I added a whole bunch of `eassert's where the
assertion is refined to try and take the above discrepancies into
account, and those get caught occasionally. I haven't managed to track
down their cause yet. It might just be a bug in the assertions.
Stefan
next parent reply other threads:[~2012-11-20 20:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E434CEB9297E432AA3570AF8C351C084@us.oracle.com>
[not found] ` <jwvlidynywq.fsf-monnier+emacs@gnu.org>
[not found] ` <83y5hyxnb1.fsf@gnu.org>
[not found] ` <jwvsj86me1m.fsf-monnier+emacs@gnu.org>
[not found] ` <83wqxhy4ha.fsf@gnu.org>
[not found] ` <jwv62513216.fsf-monnier+emacs@gnu.org>
[not found] ` <83fw45xxzk.fsf@gnu.org>
[not found] ` <jwv39051lyw.fsf-monnier+emacs@gnu.org>
[not found] ` <83ehjpxwqd.fsf@gnu.org>
[not found] ` <jwvr4npz8az.fsf-monnier+emacs@gnu.org>
[not found] ` <838v9xxss8.fsf@gnu.org>
[not found] ` <jwvy5hxxpv3.fsf-monnier+emacs@gnu.org>
[not found] ` <83zk2dvsba.fsf@gnu.org>
[not found] ` <jwvd2z8na6f.fsf-monnier+emacs@gnu.org>
[not found] ` <CAAeL0STTFjDRCjWUbQJOc1=YdF+M9JG6_BypOfr1X9_vQN+yeg@mail.gmail.com>
[not found] ` <A5B77C60B99D463D8B4818431132BD6F@us.oracle.com>
[not found] ` <83ip90w48g.fsf@gnu.org>
[not found] ` <4AB1E6AB8BB448AAB037D70CBECBFD9D@us.oracle.com>
[not found] ` <83d2z8w2na.fsf@gnu.org>
[not found] ` <CAH8Pv0j-ZFs1xSpsSFy3QW9MP3zDO6nzaNGvUtYr8-UTJ3ifWw@mail.gmail.com>
[not found] ` <837gpgvz81.fsf@gnu.org>
2012-11-20 20:37 ` Stefan Monnier [this message]
2012-11-21 17:05 ` selected-frame and selected-window Stefan Monnier
2012-12-08 12:24 ` Eli Zaretskii
2012-12-08 23:51 ` Stefan Monnier
2012-12-09 3:50 ` Eli Zaretskii
2012-12-14 15:53 ` Stefan Monnier
2012-12-14 16:04 ` 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=jwvk3tg2fef.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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).