summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-01-02 08:55:11 +0000
committerRichard M. Stallman <rms@gnu.org>1996-01-02 08:55:11 +0000
commit825c2446c71d0583d8d626878af3d3bca5624f78 (patch)
treee265c58c512bc807f04b2ff2b1d12f7821166c91 /src/window.c
parent7c8306750715643bb6d7a8f565ded1d28436c49b (diff)
downloademacs-825c2446c71d0583d8d626878af3d3bca5624f78.tar.gz
(replace_buffer_in_all_windows): New function.
Like Freplace_buffer_in_windows but really does all frames.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index be1722ae3e4..fd39556b847 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1624,6 +1624,36 @@ DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows,
}
return Qnil;
}
+
+/* Replace BUFFER with some other buffer in all windows
+ of all frames, even those on other keyboards. */
+
+void
+replace_buffer_in_all_windows (buffer)
+ Lisp_Object buffer;
+{
+ Lisp_Object tail, frame;
+
+#ifdef MULTI_FRAME
+ Lisp_Object old_selected;
+
+ old_selected = selected_window;
+
+ /* A single call to window_loop won't do the job
+ because it only considers frames on the current keyboard.
+ So loop manually over frames, and handle each one. */
+ FOR_EACH_FRAME (tail, frame)
+ {
+ Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (frame)));
+
+ window_loop (UNSHOW_BUFFER, buffer, 0, frame);
+ }
+
+ Fselect_window (old_selected);
+#else
+ window_loop (UNSHOW_BUFFER, buffer, 0, Qt);
+#endif
+}
/* Set the height of WINDOW and all its inferiors. */