diff options
| author | Richard M. Stallman | 1998-05-22 20:03:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-22 20:03:28 +0000 |
| commit | b7354ddfcdd51e4af946e2baad2695999beaff17 (patch) | |
| tree | 55c70885ec30a2c2fa985232dd04a5d2ce7ea8c3 /src | |
| parent | f967223b11108117aadc260ad3cd7e92499e9d53 (diff) | |
| download | emacs-b7354ddfcdd51e4af946e2baad2695999beaff17.tar.gz emacs-b7354ddfcdd51e4af946e2baad2695999beaff17.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c index 1069e71da54..817eb9fdc5b 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -39,6 +39,8 @@ Lisp_Object Qwindowp, Qwindow_live_p; | |||
| 39 | 39 | ||
| 40 | static struct window *decode_window P_ ((Lisp_Object)); | 40 | static struct window *decode_window P_ ((Lisp_Object)); |
| 41 | 41 | ||
| 42 | static Lisp_Object select_window_1 P_ ((Lisp_Object, int)); | ||
| 43 | |||
| 42 | /* This is the window in which the terminal's cursor should | 44 | /* This is the window in which the terminal's cursor should |
| 43 | be left when nothing is being done with it. This must | 45 | be left when nothing is being done with it. This must |
| 44 | always be a leaf window, and its buffer is selected by | 46 | always be a leaf window, and its buffer is selected by |
| @@ -1439,7 +1441,8 @@ window_loop (type, obj, mini, frames) | |||
| 1439 | if (NILP (XWINDOW (w)->parent)) | 1441 | if (NILP (XWINDOW (w)->parent)) |
| 1440 | { | 1442 | { |
| 1441 | Lisp_Object new_buffer; | 1443 | Lisp_Object new_buffer; |
| 1442 | new_buffer = Fother_buffer (obj, Qnil); | 1444 | new_buffer = Fother_buffer (obj, Qnil, |
| 1445 | XWINDOW (w)->frame); | ||
| 1443 | if (NILP (new_buffer)) | 1446 | if (NILP (new_buffer)) |
| 1444 | new_buffer | 1447 | new_buffer |
| 1445 | = Fget_buffer_create (build_string ("*scratch*")); | 1448 | = Fget_buffer_create (build_string ("*scratch*")); |
| @@ -1474,7 +1477,7 @@ window_loop (type, obj, mini, frames) | |||
| 1474 | /* Find another buffer to show in this window. */ | 1477 | /* Find another buffer to show in this window. */ |
| 1475 | Lisp_Object another_buffer; | 1478 | Lisp_Object another_buffer; |
| 1476 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (w))); | 1479 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (w))); |
| 1477 | another_buffer = Fother_buffer (obj, Qnil); | 1480 | another_buffer = Fother_buffer (obj, Qnil, XWINDOW (w)->frame); |
| 1478 | if (NILP (another_buffer)) | 1481 | if (NILP (another_buffer)) |
| 1479 | another_buffer | 1482 | another_buffer |
| 1480 | = Fget_buffer_create (build_string ("*scratch*")); | 1483 | = Fget_buffer_create (build_string ("*scratch*")); |
| @@ -1975,6 +1978,14 @@ selects the buffer of the selected window before each command.") | |||
| 1975 | (window) | 1978 | (window) |
| 1976 | register Lisp_Object window; | 1979 | register Lisp_Object window; |
| 1977 | { | 1980 | { |
| 1981 | return select_window_1 (window, 1); | ||
| 1982 | } | ||
| 1983 | |||
| 1984 | static Lisp_Object | ||
| 1985 | select_window_1 (window, recordflag) | ||
| 1986 | register Lisp_Object window; | ||
| 1987 | int recordflag; | ||
| 1988 | { | ||
| 1978 | register struct window *w; | 1989 | register struct window *w; |
| 1979 | register struct window *ow = XWINDOW (selected_window); | 1990 | register struct window *ow = XWINDOW (selected_window); |
| 1980 | 1991 | ||
| @@ -2007,7 +2018,8 @@ selects the buffer of the selected window before each command.") | |||
| 2007 | else | 2018 | else |
| 2008 | selected_frame->selected_window = window; | 2019 | selected_frame->selected_window = window; |
| 2009 | 2020 | ||
| 2010 | record_buffer (w->buffer); | 2021 | if (recordflag) |
| 2022 | record_buffer (w->buffer); | ||
| 2011 | Fset_buffer (w->buffer); | 2023 | Fset_buffer (w->buffer); |
| 2012 | 2024 | ||
| 2013 | XBUFFER (w->buffer)->last_selected_window = window; | 2025 | XBUFFER (w->buffer)->last_selected_window = window; |
| @@ -2030,7 +2042,7 @@ selects the buffer of the selected window before each command.") | |||
| 2030 | windows_or_buffers_changed++; | 2042 | windows_or_buffers_changed++; |
| 2031 | return window; | 2043 | return window; |
| 2032 | } | 2044 | } |
| 2033 | 2045 | ||
| 2034 | /* Deiconify the frame containing the window WINDOW, | 2046 | /* Deiconify the frame containing the window WINDOW, |
| 2035 | unless it is the selected frame; | 2047 | unless it is the selected frame; |
| 2036 | then return WINDOW. | 2048 | then return WINDOW. |
| @@ -2361,14 +2373,17 @@ temp_output_buffer_show (buf) | |||
| 2361 | if (!NILP (tem)) | 2373 | if (!NILP (tem)) |
| 2362 | { | 2374 | { |
| 2363 | int count = specpdl_ptr - specpdl; | 2375 | int count = specpdl_ptr - specpdl; |
| 2376 | Lisp_Object prev_window; | ||
| 2377 | prev_window = selected_window; | ||
| 2364 | 2378 | ||
| 2365 | /* Select the window that was chosen, for running the hook. */ | 2379 | /* Select the window that was chosen, for running the hook. */ |
| 2366 | record_unwind_protect (Fset_window_configuration, | 2380 | record_unwind_protect (Fset_window_configuration, |
| 2367 | Fcurrent_window_configuration (Qnil)); | 2381 | Fcurrent_window_configuration (Qnil)); |
| 2368 | 2382 | ||
| 2369 | Fselect_window (window); | 2383 | select_window_1 (window, 0); |
| 2370 | Fset_buffer (w->buffer); | 2384 | Fset_buffer (w->buffer); |
| 2371 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); | 2385 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); |
| 2386 | select_window_1 (prev_window, 0); | ||
| 2372 | unbind_to (count, Qnil); | 2387 | unbind_to (count, Qnil); |
| 2373 | } | 2388 | } |
| 2374 | } | 2389 | } |