From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: How to get the new frame? Date: Tue, 21 Jul 2015 09:00:30 +0200 Message-ID: <55ADEE0E.5050604@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1437462071 18136 80.91.229.3 (21 Jul 2015 07:01:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2015 07:01:11 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: itz@buug.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 21 09:01:00 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZHRXv-0003nt-P9 for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 09:01:00 +0200 Original-Received: from localhost ([::1]:58187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHRXu-0004li-U1 for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 03:00:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHRXl-0004lX-92 for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 03:00:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHRXh-0001Ss-8f for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 03:00:49 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:56143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHRXg-0001SG-VB for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 03:00:45 -0400 Original-Received: from [88.117.84.27] ([88.117.84.27]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MOfQw-1ZLIt23Arm-00690k; Tue, 21 Jul 2015 09:00:34 +0200 Original-References: 20150721004403.1229.1C8BC4D7@ahiker.mooo.com X-Provags-ID: V03:K0:4MJOkLvTzPRS5pK1qk067jOf0jfg+I21wYmEtSwcy2qTMEy9Esm ZuGdaUoLZ8MVoshEBxQc3NvxNdgkPP74uKWnYsvsr7xFO+VLMN3uA4cDZockuNcned9uJ9w gdvbgpbjOLESOx9cEMTytpAyZYaoWjIGYRLsqioql1T2wtdDTG6MJDSL3FWJaDHMhn8SZVc XDKo8Ux5ByaH2zGh2p5Pw== X-UI-Out-Filterresults: notjunk:1;V01:K0:z4uWu5h/5SE=:OW7lqgRkUKFIaRKaRSGM5g LzKOodJBafVuA/0leS3ncpK7YnQGFr0yrD/4zf+QyIJe5MPnyTE5vZ70pkQKtgYd7fTiNZg43 6VfDUBAsshIuiy1sf0QL8VtQw0FQNJId6Sdw4onXYyRhRU6zh2KIBWACNeacvjYFSh05EQd8I k3cghoPdqhUDklNXa/fXYNtzmVmcTYyZHEChC8Q8Dk88fh9nFECT3gGpR+sFeEME1PMUPA62d Zgt0bIg19OpJp63wtxsJyVDdi6fH0Y8T5q2/SMzgLt2y1Dwuv77ECGlS/KEig1J7joct73Jf2 QK/FU+qPp5wyD4/bc9KwxDxH1W9kWpgkL/XtgaUyeVL/W1DbELv9d9YKfoG9rQ+LCPUeRh3Gl JngJXISBVjHmioEQlEb1R5bpvinISvwLLJ59j1qOrpm7sBzsxXrySP5rIWgWqe1FSOkkphmai l9NtdQ0ks3qkz3oeHoZb6ZPOBDF2up9gQOsxfErqCURrnWQsIUN46fX6ewoQwwxyOmHeIeDym MTEbPXu5WhWfAoXdHGeM9airXFT8RmE5xR7kmzO1iLpojLiXX3a0+g8kg5++nCUP/8+xg2V3c BIWPbSRMvvUV2/ydjeYokkTIEi5YmdZbXq5/Z29vp/I9cTFkSSztqdpc3nJcM1DTT9I1XBP+O cg3LLhN0HP6omq1TNejlw724ED5a9L3dI7XCObE7DiSdfC21nmDf31VMVB3TRIRmJq14= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105897 Archived-At: > Is there a neat way in Lisp code to get at the frame which > find-file-other-frame just has created? No. Also so because `find-file-other-frame' might not have created a new frame in the first place. You would have to write a function returning a list of all windows on all frames together with the buffers they show and call that function twice, once before and once after calling `find-file-other-frame'. If the list returned by the second call contains a window showing your file and that window is not present in the list returned by the first call, chances are that you have found the right window. > The function itself returns > (indirectly, via switch-to-buffer-other-frame) the buffer and not the > frame, just as all the *-other-frame functions. Indeed. I suppose something like (let* ((buffer (find-file-noselect FILENAME)) (window (display-buffer buffer '((display-buffer-pop-up-frame))))) (when (eq (window-buffer window) buffer) (window-frame window))) should be sufficient for your purposes. martin