all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: itz@buug.org
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to get the new frame?
Date: Tue, 21 Jul 2015 09:00:30 +0200	[thread overview]
Message-ID: <55ADEE0E.5050604@gmx.at> (raw)

 > 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



             reply	other threads:[~2015-07-21  7:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  7:00 martin rudalics [this message]
     [not found] <mailman.7205.1437439660.904.help-gnu-emacs@gnu.org>
2015-07-21 17:25 ` How to get the new frame? Javier
2015-07-21 17:44   ` Javier
2015-07-23  9:01   ` Javier
  -- strict thread matches above, loose matches on Subject: below --
2015-07-21  0:47 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ADEE0E.5050604@gmx.at \
    --to=rudalics@gmx.at \
    --cc=help-gnu-emacs@gnu.org \
    --cc=itz@buug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.