# HG changeset patch # User Richard M. Stallman # Date 820572911 0 # Node ID 2f6eaea659da99d494920c11f6d67f80ff40c17b # Parent c7c63fcb828e5db194ff57a2c173fc54d97ada44 (replace_buffer_in_all_windows): New function. Like Freplace_buffer_in_windows but really does all frames. diff -r c7c63fcb828e -r 2f6eaea659da src/window.c --- a/src/window.c Tue Jan 02 08:54:40 1996 +0000 +++ b/src/window.c Tue Jan 02 08:55:11 1996 +0000 @@ -1624,6 +1624,36 @@ } 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. */