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: Re: run_window_configuration_change_hook Date: Tue, 19 Apr 2011 10:45:00 -0300 Message-ID: References: <4DAC398A.204@gmx.at> <4DAD835E.9010301@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1303220715 7659 80.91.229.12 (19 Apr 2011 13:45:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2011 13:45:15 +0000 (UTC) Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 19 15:45:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QCBEr-0008Hm-HL for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2011 15:45:09 +0200 Original-Received: from localhost ([::1]:38493 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCBEr-0005tI-4o for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2011 09:45:09 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCBEo-0005t2-QX for emacs-devel@gnu.org; Tue, 19 Apr 2011 09:45:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCBEn-0005gs-Pm for emacs-devel@gnu.org; Tue, 19 Apr 2011 09:45:06 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:36072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCBEn-0005go-N0 for emacs-devel@gnu.org; Tue, 19 Apr 2011 09:45:05 -0400 Original-Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:49723 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QCBEm-0001Vg-AM; Tue, 19 Apr 2011 09:45:04 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 1ED62662B5; Tue, 19 Apr 2011 10:45:00 -0300 (ART) In-Reply-To: <4DAD835E.9010301@gmx.at> (martin rudalics's message of "Tue, 19 Apr 2011 14:43:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:138578 Archived-At: > As stated before the reason is that run_window_configuration_change_hook > has this code > if (SELECTED_FRAME () != f) > { > record_unwind_protect (select_frame_norecord, Fselected_frame ()); > Fselect_frame (frame, Qt); > } > /* Use the right buffer. Matters when running the local hooks. */ > if (current_buffer != XBUFFER (Fwindow_buffer (Qnil))) > { > record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); > Fset_buffer (Fwindow_buffer (Qnil)); > } > which implies to first restore the current buffer and afterwards the > selected frame which can make another buffer current. Indeed, that sounds wrong. > Inverting the order of the two clauses resolves the problem for me. > Since I hardly ever use more than one frame, I'm not 100% sure whether > reverting the clauses can break existing code. Comments welcome. I think swapping the two is the right thing to do, yes. Stefan