From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Goldman Newsgroups: gmane.emacs.devel Subject: Re: save-frame-excursion? Date: Thu, 23 Jul 2009 22:28:42 -0500 Message-ID: <4A692A6A.4080601@sift.info> References: <87ocrb8fy0.fsf@bzg.ath.cx> <4A691B47.1050102@sift.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1248426173 923 80.91.229.12 (24 Jul 2009 09:02:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jul 2009 09:02:53 +0000 (UTC) Cc: Bastien , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 24 11:02:46 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 1MUGft-0005fP-QP for ged-emacs-devel@m.gmane.org; Fri, 24 Jul 2009 11:02:46 +0200 Original-Received: from localhost ([127.0.0.1]:45917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUGft-0001Hn-6b for ged-emacs-devel@m.gmane.org; Fri, 24 Jul 2009 05:02:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUBSq-0002Ji-9f for emacs-devel@gnu.org; Thu, 23 Jul 2009 23:28:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUBSl-0002J1-O8 for emacs-devel@gnu.org; Thu, 23 Jul 2009 23:28:56 -0400 Original-Received: from [199.232.76.173] (port=34135 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUBSl-0002Ix-Hv for emacs-devel@gnu.org; Thu, 23 Jul 2009 23:28:51 -0400 Original-Received: from outbound-mail-15.bluehost.com ([69.89.18.115]:54426) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MUBSk-00010Y-V0 for emacs-devel@gnu.org; Thu, 23 Jul 2009 23:28:51 -0400 Original-Received: (qmail 16905 invoked by uid 0); 24 Jul 2009 03:28:49 -0000 Original-Received: from unknown (HELO box544.bluehost.com) (74.220.219.144) by outboundproxy1.bluehost.com with SMTP; 24 Jul 2009 03:28:49 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=sift.info; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:X-Enigmail-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=EBF+r5bdU9WA7n4vw2Vbs+2UQEAVw2YvnhoKGWZICyQ0o4VnVP6GUH04WyO0VZBLjIf9gf8m0hNf+GZ3f+hU+3EtAMuohAZQfmpEC3Y9LALTwqtIb2dykXbGJlSRounz; Original-Received: from 216.243.156.16.real-time.com ([216.243.156.16] helo=rpgoldman-2.local) by box544.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MUBSi-0000M7-Qk; Thu, 23 Jul 2009 21:28:48 -0600 User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) In-Reply-To: X-Enigmail-Version: 0.96.0 X-Identified-User: {8100:box544.bluehost.com:siftinfo:sift.info} {sentby:smtp auth 216.243.156.16 authed with rgoldman+sift.info} X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Fri, 24 Jul 2009 05:01:37 -0400 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:113092 Archived-At: Stefan Monnier wrote: >>> 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. I don't entirely understand how the stickiness happens -- configuration of the emacs calendar is far beyond me. > >> I am not that experienced in this area, but as far as I can tell >> save-window-excursion covers similar ground, but only controls what >> window is selected /within a given frame/. So this macro, on which I >> based org-save-frame-excursion covers similar ground, but it does not >> subsume this macro. > > I know neither subsumes the other (sadly). I just hope new ones can be > made a bit more orthogonal (i.e. with less overlap). Right. I believe that these need to be done "inside to out" i.e., (save-excursion (save-window-excursion (org-save-frame-excursion ....))) in order that they unwind properly. What I think is at least a bit odd is that I don't know of a case where one would /not/ want the current frame focus to be restored when doing a save-excursion. 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? But this may simply expose my naiveté about emacs. Best, r