55 |
|
|
56 |
static int displayed_window_lines P_ ((struct window *)); |
static int displayed_window_lines P_ ((struct window *)); |
57 |
static struct window *decode_window P_ ((Lisp_Object)); |
static struct window *decode_window P_ ((Lisp_Object)); |
|
static Lisp_Object select_window_1 P_ ((Lisp_Object, int)); |
|
58 |
static int count_windows P_ ((struct window *)); |
static int count_windows P_ ((struct window *)); |
59 |
static int get_leaf_windows P_ ((struct window *, struct window **, int)); |
static int get_leaf_windows P_ ((struct window *, struct window **, int)); |
60 |
static void window_scroll P_ ((Lisp_Object, int, int, int)); |
static void window_scroll P_ ((Lisp_Object, int, int, int)); |
1298 |
delete the selected window on any other frame, we shouldn't do |
delete the selected window on any other frame, we shouldn't do |
1299 |
anything but set the frame's selected_window slot. */ |
anything but set the frame's selected_window slot. */ |
1300 |
if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) |
if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) |
1301 |
Fselect_window (swindow); |
Fselect_window (swindow, Qnil); |
1302 |
else |
else |
1303 |
FRAME_SELECTED_WINDOW (f) = swindow; |
FRAME_SELECTED_WINDOW (f) = swindow; |
1304 |
} |
} |
1697 |
for (; i < 0; ++i) |
for (; i < 0; ++i) |
1698 |
window = Fprevious_window (window, Qnil, all_frames); |
window = Fprevious_window (window, Qnil, all_frames); |
1699 |
|
|
1700 |
Fselect_window (window); |
Fselect_window (window, Qnil); |
1701 |
return Qnil; |
return Qnil; |
1702 |
} |
} |
1703 |
|
|
2781 |
return Qnil; |
return Qnil; |
2782 |
} |
} |
2783 |
|
|
2784 |
DEFUN ("select-window", Fselect_window, Sselect_window, 1, 1, 0, |
DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, |
2785 |
doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. |
doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. |
2786 |
If WINDOW is not already selected, also make WINDOW's buffer current. |
If WINDOW is not already selected, also make WINDOW's buffer current. |
2787 |
Also make WINDOW the frame's selected window. |
Also make WINDOW the frame's selected window. |
2788 |
|
Optional second arg NORECORD non-nil means |
2789 |
|
do not put this buffer at the front of the list of recently selected ones. |
2790 |
|
|
2791 |
Note that the main editor command loop |
Note that the main editor command loop |
2792 |
selects the buffer of the selected window before each command. */) |
selects the buffer of the selected window before each command. */) |
2793 |
(window) |
(window, norecord) |
2794 |
register Lisp_Object window; |
register Lisp_Object window, norecord; |
|
{ |
|
|
return select_window_1 (window, 1); |
|
|
} |
|
|
|
|
|
/* Note that selected_window can be nil |
|
|
when this is called from Fset_window_configuration. */ |
|
|
|
|
|
static Lisp_Object |
|
|
select_window_1 (window, recordflag) |
|
|
register Lisp_Object window; |
|
|
int recordflag; |
|
2795 |
{ |
{ |
2796 |
register struct window *w; |
register struct window *w; |
2797 |
register struct window *ow; |
register struct window *ow; |
2829 |
else |
else |
2830 |
sf->selected_window = window; |
sf->selected_window = window; |
2831 |
|
|
2832 |
if (recordflag) |
if (NILP (norecord)) |
2833 |
record_buffer (w->buffer); |
record_buffer (w->buffer); |
2834 |
Fset_buffer (w->buffer); |
Fset_buffer (w->buffer); |
2835 |
|
|
2853 |
windows_or_buffers_changed++; |
windows_or_buffers_changed++; |
2854 |
return window; |
return window; |
2855 |
} |
} |
2856 |
|
|
2857 |
|
static Lisp_Object |
2858 |
|
select_window_norecord (window) |
2859 |
|
Lisp_Object window; |
2860 |
|
{ |
2861 |
|
return Fselect_window (window, Qt); |
2862 |
|
} |
2863 |
|
|
2864 |
/* Deiconify the frame containing the window WINDOW, |
/* Deiconify the frame containing the window WINDOW, |
2865 |
unless it is the selected frame; |
unless it is the selected frame; |
3202 |
if (!NILP (tem)) |
if (!NILP (tem)) |
3203 |
{ |
{ |
3204 |
int count = SPECPDL_INDEX (); |
int count = SPECPDL_INDEX (); |
3205 |
Lisp_Object prev_window; |
Lisp_Object prev_window, prev_buffer; |
3206 |
prev_window = selected_window; |
prev_window = selected_window; |
3207 |
|
XSETBUFFER (prev_buffer, old); |
3208 |
|
|
3209 |
/* Select the window that was chosen, for running the hook. */ |
/* Select the window that was chosen, for running the hook. |
3210 |
/* Both this Fselect_window and the select_window_1 |
Note: Both Fselect_window and select_window_norecord may |
3211 |
below will (may) incorrectly set-buffer to the buffer |
set-buffer to the buffer displayed in the window, |
3212 |
displayed in the window. --stef */ |
so we need to save the current buffer. --stef */ |
3213 |
record_unwind_protect (Fselect_window, prev_window); |
record_unwind_protect (Fset_buffer, prev_buffer); |
3214 |
select_window_1 (window, 0); |
record_unwind_protect (select_window_norecord, prev_window); |
3215 |
|
Fselect_window (window, Qt); |
3216 |
Fset_buffer (w->buffer); |
Fset_buffer (w->buffer); |
3217 |
call1 (Vrun_hooks, Qtemp_buffer_show_hook); |
call1 (Vrun_hooks, Qtemp_buffer_show_hook); |
|
select_window_1 (prev_window, 0); |
|
3218 |
unbind_to (count, Qnil); |
unbind_to (count, Qnil); |
3219 |
} |
} |
3220 |
} |
} |
5218 |
make_number (old_point), |
make_number (old_point), |
5219 |
XWINDOW (data->current_window)->buffer); |
XWINDOW (data->current_window)->buffer); |
5220 |
|
|
5221 |
Fselect_window (data->current_window); |
Fselect_window (data->current_window, Qnil); |
5222 |
XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window |
XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window |
5223 |
= selected_window; |
= selected_window; |
5224 |
|
|