From: David Reitter <david.reitter@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: martin rudalics <rudalics@gmx.at>,
Lennart Borgman <lennart.borgman@gmail.com>,
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>,
Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Frame ordering
Date: Mon, 14 Jun 2010 23:54:29 -0400 [thread overview]
Message-ID: <1437ECA1-253E-46DA-AD1F-ABFDB062E6C3@gmail.com> (raw)
In-Reply-To: <jwv39wpcuza.fsf-monnier+emacs@gnu.org>
Letting the window manager decide works fine. `next-frame' switches back to the previously selected frame, so, when repeated, it'll cycle between just two frames. `previous-frame' lets users cycle through all frames. I feel like it should be the other way round.
Thoughts? How do other window managers do this?
--------
diff --git a/src/frame.c b/src/frame.c
index d73d4d6..2bbcbc8 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1076,6 +1076,7 @@ next_frame (frame, minibuf)
Lisp_Object frame;
Lisp_Object minibuf;
{
+ Lisp_Object frame_list;
Lisp_Object tail;
int passed = 0;
@@ -1086,9 +1087,16 @@ next_frame (frame, minibuf)
/* If this frame is dead, it won't be in Vframe_list, and we'll loop
forever. Forestall that. */
CHECK_LIVE_FRAME (frame);
+
+#if HAVE_NS
+ frame_list = ns_frame_list();
+#else
+ frame_list = Vframe_list;
+#endif
while (1)
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+
+ for (tail = frame_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object f;
@@ -1164,11 +1172,17 @@ prev_frame (frame, minibuf)
abort ();
prev = Qnil;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+
+#if HAVE_NS
+ tail = ns_frame_list();
+#else
+ tail = Vframe_list;
+#endif
+ for (;CONSP (tail); tail = XCDR (tail))
{
Lisp_Object f;
f = XCAR (+
if (!FRAMEP (f))
abort ();
diff --git a/src/nsterm.h b/src/nsterm.h
index e2d42c5..89641ff 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -779,6 +779,8 @@ extern unsigned long ns_get_rgb_color (struct frame *f,
float r, float g, float b, float a);
extern NSPoint last_mouse_motion_position;
+extern Lisp_Object ns_frame_list (void); /* needed by frame.c */
+
#ifdef NS_IMPL_GNUSTEP
extern char gnustep_base_version[]; /* version tracking */
#endif
diff --git a/src/nsterm.m b/src/nsterm.m
index 85f2a26..d61528e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -911,6 +911,32 @@ ns_set_terminal_modes (struct terminal *terminal)
========================================================================== */
+Lisp_Object
+ns_frame_list ()
+{
+ Lisp_Object frame_list = Qnil;
+
+ NSEnumerator *e = [[NSApp orderedWindows] reverseObjectEnumerator];
+ NSWindow *win;
+ Lisp_Object frame;
+ struct frame *f;
+
+ while (win = [e nextObject]) {
+ if (! [win isKindOfClass:[EmacsWindow class]])
+ continue;
+
+ f = ((EmacsView *) [((EmacsWindow *) win) delegate])->emacsframe;
+
+ XSETFRAME (frame, f);
+
+ if (!FRAMEP (frame))
+ abort ();
+ frame_list = Fcons (frame, frame_list);
+ }
+ return frame_list;
+}
+
+
static void
ns_raise_frame (struct frame *f)
/* --------------------------------------------------------------------------
next prev parent reply other threads:[~2010-06-15 3:54 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E9FAA849-1E93-4DD7-AE9D-5E644D990202@univie.ac.at>
2010-06-11 12:29 ` Frame ordering David Reitter
2010-06-11 13:22 ` martin rudalics
2010-06-11 13:55 ` David Reitter
2010-06-11 17:13 ` martin rudalics
2010-06-11 21:04 ` David Reitter
2010-06-12 8:01 ` martin rudalics
2010-06-13 20:16 ` David Reitter
2010-06-14 0:30 ` Stefan Monnier
2010-06-14 2:42 ` David Reitter
2010-06-14 3:30 ` YAMAMOTO Mitsuharu
2010-06-14 6:50 ` martin rudalics
2010-06-14 6:55 ` Lennart Borgman
2010-06-14 7:35 ` YAMAMOTO Mitsuharu
2010-06-14 8:24 ` martin rudalics
2010-06-14 8:31 ` YAMAMOTO Mitsuharu
2010-06-14 9:20 ` martin rudalics
2010-06-14 9:28 ` YAMAMOTO Mitsuharu
2010-06-14 13:29 ` Stefan Monnier
2010-06-14 3:52 ` YAMAMOTO Mitsuharu
2010-06-14 15:52 ` David Reitter
2010-06-14 16:05 ` Lennart Borgman
2010-06-14 16:29 ` David Reitter
2010-06-14 16:47 ` Lennart Borgman
2010-06-14 17:10 ` Jan Djärv
2010-06-14 17:15 ` Lennart Borgman
2010-06-14 17:14 ` David Reitter
2010-06-14 17:19 ` Lennart Borgman
2010-06-14 18:49 ` Stefan Monnier
2010-06-15 3:54 ` David Reitter [this message]
2010-06-15 13:25 ` Stefan Monnier
2010-06-15 14:33 ` David Reitter
2010-06-15 9:24 ` YAMAMOTO Mitsuharu
2010-06-14 6:50 ` martin rudalics
2010-06-12 4:12 ` David Reitter
2010-06-12 5:42 ` YAMAMOTO Mitsuharu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437ECA1-253E-46DA-AD1F-ABFDB062E6C3@gmail.com \
--to=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
--cc=mituharu@math.s.chiba-u.ac.jp \
--cc=monnier@IRO.UMontreal.CA \
--cc=rudalics@gmx.at \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).