int pop_up_frames;
+/* Nonzero means reuse existing frames for displaying buffers. */
+
+int display_buffer_reuse_frames;
+
/* Non-nil means use this function instead of default */
Lisp_Object Vpop_up_frame_function;
argument NOT-THIS-WINDOW is non-nil (interactively, with prefix arg).\n\
If `pop-up-frames' is non-nil, make a new frame if no window shows BUFFER.\n\
Returns the window displaying BUFFER.\n\
+If `display-reuse-frames' is non-nil, and another frame is currently\n\
+displaying BUFFER, then simply raise that frame.\n\
\n\
The variables `special-display-buffer-names', `special-display-regexps',\n\
`same-window-buffer-names', and `same-window-regexps' customize how certain\n\
If FRAME is a frame, search only that frame.\n\
If FRAME is nil, search only the selected frame\n\
(actually the last nonminibuffer frame),\n\
- unless `pop-up-frames' is non-nil,\n\
+ unless `pop-up-frames' or `display-reuse-frames' is non-nil,\n\
which means search visible and iconified frames.")
(buffer, not_this_window, frame)
register Lisp_Object buffer, not_this_window, frame;
}
}
- /* If pop_up_frames,
+ /* If the user wants pop-up-frames or display-reuse-frames, then
look for a window showing BUFFER on any visible or iconified frame.
Otherwise search only the current frame. */
if (! NILP (frame))
tem = frame;
- else if (pop_up_frames || last_nonminibuf_frame == 0)
+ else if (pop_up_frames
+ || display_buffer_reuse_frames
+ || last_nonminibuf_frame == 0)
XSETFASTINT (tem, 0);
else
XSETFRAME (tem, last_nonminibuf_frame);
+
window = Fget_buffer_window (buffer, tem);
if (!NILP (window)
&& (NILP (not_this_window) || !EQ (window, selected_window)))
- {
- return display_buffer_1 (window);
- }
+ return display_buffer_1 (window);
/* Certain buffer names get special handling. */
if (!NILP (Vspecial_display_function) && NILP (swp))
"*Non-nil means `display-buffer' should make a separate frame.");
pop_up_frames = 0;
+ DEFVAR_BOOL ("display-buffer-reuse-frames", &display_buffer_reuse_frames,
+ "*Non-nil means `display-buffer' should reuse frames.
+If the buffer in question is already displayed in a frame, raise that frame.");
+ display_buffer_reuse_frames = 0;
+
DEFVAR_LISP ("pop-up-frame-function", &Vpop_up_frame_function,
"Function to call to handle automatic new frame creation.\n\
It is called with no arguments and should return a newly created frame.\n\