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: Sun, 26 Jul 2009 10:26:00 -0400 Message-ID: References: <87ocrb8fy0.fsf@bzg.ath.cx> <4A691B47.1050102@sift.info> <4A692A6A.4080601@sift.info> <871vo5c7lj.fsf@bzg.ath.cx> <87y6qcbeg6.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248618382 9709 80.91.229.12 (26 Jul 2009 14:26:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2009 14:26:22 +0000 (UTC) Cc: emacs-devel@gnu.org, Carsten Dominik , Robert Goldman To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 26 16:26:14 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 1MV4g2-0006uR-Dj for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2009 16:26:14 +0200 Original-Received: from localhost ([127.0.0.1]:51007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV4g1-0003Kp-Lj for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2009 10:26:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV4fw-0003Kg-2m for emacs-devel@gnu.org; Sun, 26 Jul 2009 10:26:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV4fq-0003KO-8c for emacs-devel@gnu.org; Sun, 26 Jul 2009 10:26:06 -0400 Original-Received: from [199.232.76.173] (port=56527 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV4fq-0003KL-36 for emacs-devel@gnu.org; Sun, 26 Jul 2009 10:26:02 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:8572) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MV4fp-0005xu-R0 for emacs-devel@gnu.org; Sun, 26 Jul 2009 10:26:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQFAFYEbEpFxJuZ/2dsb2JhbACBUMpxhA0FhxQ X-IronPort-AV: E=Sophos;i="4.43,272,1246852800"; d="scan'208";a="42168453" Original-Received: from 69-196-155-153.dsl.teksavvy.com (HELO ceviche.home) ([69.196.155.153]) by ironport2-out.teksavvy.com with ESMTP; 26 Jul 2009 10:26:00 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 608EA70018; Sun, 26 Jul 2009 10:26:00 -0400 (EDT) In-Reply-To: <87y6qcbeg6.fsf@bzg.ath.cx> (Bastien's message of "Sun, 26 Jul 2009 06:11:37 +0800") 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:113168 Archived-At: >> A select-frame inside calendar should be undoable with just >> a select-frame in org-mode. > calendar-frame-setup uses `make-frame' which does not only select the > frame, but also focuses onto it. Hence `select-frame-set-input-focus' > for restoring the focus in the minibuffer. Thanks for digging deeper, so the problem is not just that focus switches to some other frame, but that a new frame is created. Note also that make-frame's docstring says: This function itself does not make the new frame the selected frame. The previously selected frame remains selected. However, the window system may select the new frame for its own reasons, for instance if the frame appears under the mouse pointer and your setup is for focus to follow the pointer. So the really better fix would be to make sure make-frame doesn't change the focus (especially since the above note is not quite correct: even for click-to-focus WMs, the new frames may get selected just by virtue of being new, which is most likely what you're seeing). Stefan