unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to get the new frame?
@ 2015-07-21  0:47 Ian Zimmerman
  2015-07-21  1:03 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Ian Zimmerman @ 2015-07-21  0:47 UTC (permalink / raw)
  To: help-gnu-emacs

Is there a neat way in Lisp code to get at the frame which
find-file-other-frame just has created?  The function itself returns
(indirectly, via switch-to-buffer-other-frame) the buffer and not the
frame, just as all the *-other-frame functions.

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: How to get the new frame?
@ 2015-07-21  7:00 martin rudalics
  0 siblings, 0 replies; 31+ messages in thread
From: martin rudalics @ 2015-07-21  7:00 UTC (permalink / raw)
  To: itz; +Cc: help-gnu-emacs

 > 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



^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <mailman.7205.1437439660.904.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2015-07-27 21:13 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21  0:47 How to get the new frame? Ian Zimmerman
2015-07-21  1:03 ` Emanuel Berg
2015-07-21  1:42   ` Ian Zimmerman
2015-07-21  1:43     ` Emanuel Berg
2015-07-21  2:07       ` Ian Zimmerman
2015-07-21 21:07         ` Emanuel Berg
2015-07-21 21:49           ` Ian Zimmerman
2015-07-21 23:35             ` Emanuel Berg
2015-07-21  3:56 ` John Mastro
2015-07-21  4:46   ` Ian Zimmerman
     [not found] ` <mailman.7206.1437440684.904.help-gnu-emacs@gnu.org>
2015-07-23 15:11   ` B. T. Raven
2015-07-23 15:52     ` Eli Zaretskii
     [not found]     ` <mailman.7309.1437666858.904.help-gnu-emacs@gnu.org>
2015-07-23 18:21       ` B. T. Raven
2015-07-23 19:23         ` Javier
2015-07-23 19:26         ` Eli Zaretskii
     [not found]         ` <mailman.7315.1437679612.904.help-gnu-emacs@gnu.org>
2015-07-23 21:02           ` B. T. Raven
2015-07-23 22:38             ` Javier
2015-07-24  7:13               ` Eli Zaretskii
2015-07-24 12:02               ` B. T. Raven
2015-07-24 13:38                 ` Eli Zaretskii
     [not found]                 ` <mailman.7348.1437745104.904.help-gnu-emacs@gnu.org>
2015-07-24 14:55                   ` Javier
     [not found]               ` <mailman.7337.1437722035.904.help-gnu-emacs@gnu.org>
2015-07-24 12:51                 ` B. T. Raven
2015-07-24 13:47                   ` Eli Zaretskii
2015-07-27 21:13                     ` Robert Thorpe
2015-07-24 15:25                   ` Yuri Khan
2015-07-24  7:10             ` Eli Zaretskii
2015-07-23 23:14     ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2015-07-21  7:00 martin rudalics
     [not found] <mailman.7205.1437439660.904.help-gnu-emacs@gnu.org>
2015-07-21 17:25 ` Javier
2015-07-21 17:44   ` Javier
2015-07-23  9:01   ` Javier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).