Commit b7354ddf authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(window_loop): Pass new arg to Fother_buffer.

(select_window_1): New subroutine, from Fselect_window.
(Fselect_window): Use select_window_1.
(temp_output_buffer_show): Use select_window_1.
parent f967223b
......@@ -39,6 +39,8 @@ Lisp_Object Qwindowp, Qwindow_live_p;
static struct window *decode_window P_ ((Lisp_Object));
static Lisp_Object select_window_1 P_ ((Lisp_Object, int));
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
always be a leaf window, and its buffer is selected by
......@@ -1439,7 +1441,8 @@ window_loop (type, obj, mini, frames)
if (NILP (XWINDOW (w)->parent))
Lisp_Object new_buffer;
new_buffer = Fother_buffer (obj, Qnil);
new_buffer = Fother_buffer (obj, Qnil,
XWINDOW (w)->frame);
if (NILP (new_buffer))
= Fget_buffer_create (build_string ("*scratch*"));
......@@ -1474,7 +1477,7 @@ window_loop (type, obj, mini, frames)
/* Find another buffer to show in this window. */
Lisp_Object another_buffer;
another_buffer = Fother_buffer (obj, Qnil);
another_buffer = Fother_buffer (obj, Qnil, XWINDOW (w)->frame);
if (NILP (another_buffer))
= Fget_buffer_create (build_string ("*scratch*"));
......@@ -1974,6 +1977,14 @@ Note that the main editor command loop\n\
selects the buffer of the selected window before each command.")
register Lisp_Object window;
return select_window_1 (window, 1);
static Lisp_Object
select_window_1 (window, recordflag)
register Lisp_Object window;
int recordflag;
register struct window *w;
register struct window *ow = XWINDOW (selected_window);
......@@ -2007,7 +2018,8 @@ selects the buffer of the selected window before each command.")
selected_frame->selected_window = window;
record_buffer (w->buffer);
if (recordflag)
record_buffer (w->buffer);
Fset_buffer (w->buffer);
XBUFFER (w->buffer)->last_selected_window = window;
......@@ -2030,7 +2042,7 @@ selects the buffer of the selected window before each command.")
return window;
/* Deiconify the frame containing the window WINDOW,
unless it is the selected frame;
then return WINDOW.
......@@ -2361,14 +2373,17 @@ temp_output_buffer_show (buf)
if (!NILP (tem))
int count = specpdl_ptr - specpdl;
Lisp_Object prev_window;
prev_window = selected_window;
/* Select the window that was chosen, for running the hook. */
record_unwind_protect (Fset_window_configuration,
Fcurrent_window_configuration (Qnil));
Fselect_window (window);
select_window_1 (window, 0);
Fset_buffer (w->buffer);
call1 (Vrun_hooks, Qtemp_buffer_show_hook);
select_window_1 (prev_window, 0);
unbind_to (count, Qnil);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment