[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the new frame?
From: |
martin rudalics |
Subject: |
Re: How to get the new frame? |
Date: |
Tue, 21 Jul 2015 09:00:30 +0200 |
> 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
- Re: How to get the new frame?, (continued)
- Message not available
- Re: How to get the new frame?, B. T. Raven, 2015/07/24
- Re: How to get the new frame?, Eli Zaretskii, 2015/07/24
- Re: How to get the new frame?, Robert Thorpe, 2015/07/27
- Re: How to get the new frame?, Yuri Khan, 2015/07/24
- Re: How to get the new frame?, Eli Zaretskii, 2015/07/24
- Re: How to get the new frame?, Emanuel Berg, 2015/07/23
Re: How to get the new frame?,
martin rudalics <=
Re: How to get the new frame?, Javier, 2015/07/21