From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: selected-frame and selected-window Date: Tue, 20 Nov 2012 15:37:05 -0500 Message-ID: References: <83y5hyxnb1.fsf@gnu.org> <83wqxhy4ha.fsf@gnu.org> <83fw45xxzk.fsf@gnu.org> <83ehjpxwqd.fsf@gnu.org> <838v9xxss8.fsf@gnu.org> <83zk2dvsba.fsf@gnu.org> <83ip90w48g.fsf@gnu.org> <4AB1E6AB8BB448AAB037D70CBECBFD9D@us.oracle.com> <83d2z8w2na.fsf@gnu.org> <837gpgvz81.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353443835 2873 80.91.229.3 (20 Nov 2012 20:37:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Nov 2012 20:37:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 20 21:37:26 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TauZP-0001B4-9L for ged-emacs-devel@m.gmane.org; Tue, 20 Nov 2012 21:37:23 +0100 Original-Received: from localhost ([::1]:48319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TauZE-0003Gi-V1 for ged-emacs-devel@m.gmane.org; Tue, 20 Nov 2012 15:37:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TauZB-0003GS-7i for emacs-devel@gnu.org; Tue, 20 Nov 2012 15:37:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TauZA-000483-1c for emacs-devel@gnu.org; Tue, 20 Nov 2012 15:37:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TauZ9-00046z-Os; Tue, 20 Nov 2012 15:37:07 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id qAKKb5xX029453; Tue, 20 Nov 2012 15:37:05 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 89F08B4278; Tue, 20 Nov 2012 15:37:05 -0500 (EST) In-Reply-To: <837gpgvz81.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Nov 2012 21:41:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 2 Rules triggered PHISH_ACC_001=0.1, RV4408=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4408> : streams <862358> : uri <1273009> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155005 Archived-At: > 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
) element, we change selected-window (without changing frame-selected-window) to the window being redisplayed. So in , 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