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: save-frame-excursion? Date: Fri, 24 Jul 2009 15:24:33 -0400 Message-ID: References: <87ocrb8fy0.fsf@bzg.ath.cx> <4A691B47.1050102@sift.info> <4A692A6A.4080601@sift.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248466388 32603 80.91.229.12 (24 Jul 2009 20:13:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jul 2009 20:13:08 +0000 (UTC) Cc: Bastien , emacs-devel@gnu.org To: Robert Goldman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 24 22:13:02 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MUR8W-0000z8-O1 for ged-emacs-devel@m.gmane.org; Fri, 24 Jul 2009 22:13:01 +0200 Original-Received: from localhost ([127.0.0.1]:49545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUR8W-00018S-0T for ged-emacs-devel@m.gmane.org; Fri, 24 Jul 2009 16:13:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUQOa-0001yp-L2 for emacs-devel@gnu.org; Fri, 24 Jul 2009 15:25:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUQOV-0001vb-Mp for emacs-devel@gnu.org; Fri, 24 Jul 2009 15:25:31 -0400 Original-Received: from [199.232.76.173] (port=50277 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUQOV-0001vE-6u for emacs-devel@gnu.org; Fri, 24 Jul 2009 15:25:27 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:14123 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MUQNp-0001Oi-3A for emacs-devel@gnu.org; Fri, 24 Jul 2009 15:24:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIFAGunaUpMCrRU/2dsb2JhbACBUdNShA0Fhws X-IronPort-AV: E=Sophos;i="4.43,266,1246852800"; d="scan'208";a="42122994" Original-Received: from 76-10-180-84.dsl.teksavvy.com (HELO pastel.home) ([76.10.180.84]) by ironport2-out.teksavvy.com with ESMTP; 24 Jul 2009 15:24:33 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0FF2384ED; Fri, 24 Jul 2009 15:24:33 -0400 (EDT) In-Reply-To: <4A692A6A.4080601@sift.info> (Robert Goldman's message of "Thu, 23 Jul 2009 22:28:42 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113111 Archived-At: >>>> Do you know when/why it lost the focus? >>> The org frame lost focus because focus shifted to the frame that >>> contained the *Calendar* buffer. >> OK, so the next question is "why/when did focus shift to the *Calendar" >> buffer" (and just to be more clear by "why/when" I mean at the level of >> the Elisp code, which trail of calls causes it). > The calendar buffer was configured to be sticky in a particular frame, > so that when emacs wanted to show that calendar buffer, it showed it in > the different frame. That still doesn't explain the shift of focus. > I don't entirely understand how the stickiness happens -- configuration > of the emacs calendar is far beyond me. Doesn't matter. If the code doesn't explicitly ask for a change in focus, then there's no reason (other than to work around a bug somewhere, probably) why we need to reset the focus via select-frame-set-input-focus when unwinding. That's why we need to know the detail. > Admittedly it's unlikely (at least now) to get into a state where you > will change the frame focus, but whenever you /do/ change the frame > focus, wouldn't you want it restored? Emacs almost never changes frame focus explicitly (for the good reason that it's mighty hard to do it reliably for all possible WMs). Stefan