diff options
| author | Stefan Monnier | 2003-05-17 21:19:55 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-17 21:19:55 +0000 |
| commit | 14d87dc9edddc9429c6d8ebc5a2226c5ab5fdcc9 (patch) | |
| tree | eb75125bdab1c42b23d67068fecd4cbe9a965a5e /src | |
| parent | f1321dc307e63c17ce838e0b32e2708fd351f1df (diff) | |
| download | emacs-14d87dc9edddc9429c6d8ebc5a2226c5ab5fdcc9.tar.gz emacs-14d87dc9edddc9429c6d8ebc5a2226c5ab5fdcc9.zip | |
(Fselect_window): Add optional `norecord' arg.
(select_window_1): Fold into Fselect_window.
(select_window_norecord): New function.
(temp_output_buffer_show): Use it. Preserve current buffer.
(delete_window, Fother_window, Fset_window_configuration):
Pass nil as new arg to Fselect_window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 41 | ||||
| -rw-r--r-- | src/window.c | 54 |
2 files changed, 63 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f507196c38c..c6c89a01cc0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,7 +1,41 @@ | |||
| 1 | 2003-05-17 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * window.c (Fselect_window): Add optional `norecord' arg. | ||
| 4 | (select_window_1): Fold into Fselect_window. | ||
| 5 | (select_window_norecord): New function. | ||
| 6 | (temp_output_buffer_show): Use it. Preserve current buffer. | ||
| 7 | |||
| 8 | * window.h (Fselect_window): Update declaration. | ||
| 9 | |||
| 10 | * window.c (delete_window, Fother_window, Fset_window_configuration): | ||
| 11 | * minibuf.c (read_minibuf): | ||
| 12 | * macterm.c (x_new_focus_frame): | ||
| 13 | * frame.c (do_switch_frame, Fset_frame_selected_window, Fdelete_frame): | ||
| 14 | * callint.c (Fcall_interactively): | ||
| 15 | * xterm.c (x_new_focus_frame): Pass nil as new arg to Fselect_window. | ||
| 16 | |||
| 17 | * buffer.c (Fpop_to_buffer): Pass norecord to Fselect_window. | ||
| 18 | |||
| 1 | 2003-05-17 David Kastrup <dak@gnu.org> | 19 | 2003-05-17 David Kastrup <dak@gnu.org> |
| 2 | 20 | ||
| 3 | * process.c (read_process_output): Back out change from 2003-03-09. | 21 | * process.c (read_process_output): Back out change from 2003-03-09. |
| 4 | 22 | ||
| 23 | 2003-05-17 Stefan Monnier <monnier@cs.yale.edu> | ||
| 24 | |||
| 25 | * editfns.c (get_pos_property): Don't assume that `object' = nil. | ||
| 26 | |||
| 27 | * textprop.c (text_property_stickiness): New arg `buffer'. | ||
| 28 | |||
| 29 | * intervals.h (text_property_stickiness): New arg `buffer'. | ||
| 30 | (get_pos_property): Declare. | ||
| 31 | |||
| 32 | * intervals.c (get_local_map): Use get_pos_property, to obey | ||
| 33 | stickiness and empty overlays. | ||
| 34 | (create_root_interval, graft_intervals_into_buffer): Use BEG. | ||
| 35 | (merge_properties, intervals_equal, merge_properties_sticky): | ||
| 36 | Use XCAR, XCDR. | ||
| 37 | (adjust_for_invis_intang): Pass new arg to text_property_stickiness. | ||
| 38 | |||
| 5 | 2003-05-17 Richard M. Stallman <rms@gnu.org> | 39 | 2003-05-17 Richard M. Stallman <rms@gnu.org> |
| 6 | 40 | ||
| 7 | * minibuf.c (read_minibuf): If buffer is empty, record the default | 41 | * minibuf.c (read_minibuf): If buffer is empty, record the default |
| @@ -36,11 +70,10 @@ | |||
| 36 | 70 | ||
| 37 | * alloc.c (Fgarbage_collect): Cast pointers into specpdl | 71 | * alloc.c (Fgarbage_collect): Cast pointers into specpdl |
| 38 | to avoid GCC warning. | 72 | to avoid GCC warning. |
| 39 | 73 | ||
| 40 | 2003-05-16 Ralph Schleicher <rs@nunatak.allgaeu.org> (tiny change) | 74 | 2003-05-16 Ralph Schleicher <rs@nunatak.allgaeu.org> (tiny change) |
| 41 | 75 | ||
| 42 | * fileio.c (Fdelete_file): Handle symlinks pointing to | 76 | * fileio.c (Fdelete_file): Handle symlinks pointing to directories. |
| 43 | directories. | ||
| 44 | 77 | ||
| 45 | 2003-05-15 Stefan Monnier <monnier@cs.yale.edu> | 78 | 2003-05-15 Stefan Monnier <monnier@cs.yale.edu> |
| 46 | 79 | ||
| @@ -66,7 +99,7 @@ | |||
| 66 | * bytecode.c: Include window.h. | 99 | * bytecode.c: Include window.h. |
| 67 | * emacs.c: Include window.h. | 100 | * emacs.c: Include window.h. |
| 68 | 101 | ||
| 69 | * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char keys. | 102 | * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char key. |
| 70 | (keyremap): Add `parent' field. | 103 | (keyremap): Add `parent' field. |
| 71 | (keyremap_step): Use it. Remove `parent' argument. | 104 | (keyremap_step): Use it. Remove `parent' argument. |
| 72 | (read_key_sequence): Setup and use the new `parent' field. | 105 | (read_key_sequence): Setup and use the new `parent' field. |
diff --git a/src/window.c b/src/window.c index 8b179cb29e9..22e66e4fbf1 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -55,7 +55,6 @@ extern Lisp_Object Qleft_margin, Qright_margin; | |||
| 55 | 55 | ||
| 56 | static int displayed_window_lines P_ ((struct window *)); | 56 | static int displayed_window_lines P_ ((struct window *)); |
| 57 | static struct window *decode_window P_ ((Lisp_Object)); | 57 | static struct window *decode_window P_ ((Lisp_Object)); |
| 58 | static Lisp_Object select_window_1 P_ ((Lisp_Object, int)); | ||
| 59 | static int count_windows P_ ((struct window *)); | 58 | static int count_windows P_ ((struct window *)); |
| 60 | static int get_leaf_windows P_ ((struct window *, struct window **, int)); | 59 | static int get_leaf_windows P_ ((struct window *, struct window **, int)); |
| 61 | static void window_scroll P_ ((Lisp_Object, int, int, int)); | 60 | static void window_scroll P_ ((Lisp_Object, int, int, int)); |
| @@ -1299,7 +1298,7 @@ delete_window (window) | |||
| 1299 | delete the selected window on any other frame, we shouldn't do | 1298 | delete the selected window on any other frame, we shouldn't do |
| 1300 | anything but set the frame's selected_window slot. */ | 1299 | anything but set the frame's selected_window slot. */ |
| 1301 | if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) | 1300 | if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) |
| 1302 | Fselect_window (swindow); | 1301 | Fselect_window (swindow, Qnil); |
| 1303 | else | 1302 | else |
| 1304 | FRAME_SELECTED_WINDOW (f) = swindow; | 1303 | FRAME_SELECTED_WINDOW (f) = swindow; |
| 1305 | } | 1304 | } |
| @@ -1698,7 +1697,7 @@ argument ALL_FRAMES is non-nil, cycle through all frames. */) | |||
| 1698 | for (; i < 0; ++i) | 1697 | for (; i < 0; ++i) |
| 1699 | window = Fprevious_window (window, Qnil, all_frames); | 1698 | window = Fprevious_window (window, Qnil, all_frames); |
| 1700 | 1699 | ||
| 1701 | Fselect_window (window); | 1700 | Fselect_window (window, Qnil); |
| 1702 | return Qnil; | 1701 | return Qnil; |
| 1703 | } | 1702 | } |
| 1704 | 1703 | ||
| @@ -2782,26 +2781,17 @@ BUFFER can be a buffer or buffer name. */) | |||
| 2782 | return Qnil; | 2781 | return Qnil; |
| 2783 | } | 2782 | } |
| 2784 | 2783 | ||
| 2785 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 1, 0, | 2784 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, |
| 2786 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. | 2785 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. |
| 2787 | If WINDOW is not already selected, also make WINDOW's buffer current. | 2786 | If WINDOW is not already selected, also make WINDOW's buffer current. |
| 2788 | Also make WINDOW the frame's selected window. | 2787 | 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. | ||
| 2789 | 2790 | ||
| 2790 | Note that the main editor command loop | 2791 | Note that the main editor command loop |
| 2791 | selects the buffer of the selected window before each command. */) | 2792 | selects the buffer of the selected window before each command. */) |
| 2792 | (window) | 2793 | (window, norecord) |
| 2793 | register Lisp_Object window; | 2794 | register Lisp_Object window, norecord; |
| 2794 | { | ||
| 2795 | return select_window_1 (window, 1); | ||
| 2796 | } | ||
| 2797 | |||
| 2798 | /* Note that selected_window can be nil | ||
| 2799 | when this is called from Fset_window_configuration. */ | ||
| 2800 | |||
| 2801 | static Lisp_Object | ||
| 2802 | select_window_1 (window, recordflag) | ||
| 2803 | register Lisp_Object window; | ||
| 2804 | int recordflag; | ||
| 2805 | { | 2795 | { |
| 2806 | register struct window *w; | 2796 | register struct window *w; |
| 2807 | register struct window *ow; | 2797 | register struct window *ow; |
| @@ -2839,7 +2829,7 @@ select_window_1 (window, recordflag) | |||
| 2839 | else | 2829 | else |
| 2840 | sf->selected_window = window; | 2830 | sf->selected_window = window; |
| 2841 | 2831 | ||
| 2842 | if (recordflag) | 2832 | if (NILP (norecord)) |
| 2843 | record_buffer (w->buffer); | 2833 | record_buffer (w->buffer); |
| 2844 | Fset_buffer (w->buffer); | 2834 | Fset_buffer (w->buffer); |
| 2845 | 2835 | ||
| @@ -2863,6 +2853,13 @@ select_window_1 (window, recordflag) | |||
| 2863 | windows_or_buffers_changed++; | 2853 | windows_or_buffers_changed++; |
| 2864 | return window; | 2854 | return window; |
| 2865 | } | 2855 | } |
| 2856 | |||
| 2857 | static Lisp_Object | ||
| 2858 | select_window_norecord (window) | ||
| 2859 | Lisp_Object window; | ||
| 2860 | { | ||
| 2861 | return Fselect_window (window, Qt); | ||
| 2862 | } | ||
| 2866 | 2863 | ||
| 2867 | /* Deiconify the frame containing the window WINDOW, | 2864 | /* Deiconify the frame containing the window WINDOW, |
| 2868 | unless it is the selected frame; | 2865 | unless it is the selected frame; |
| @@ -3205,18 +3202,19 @@ temp_output_buffer_show (buf) | |||
| 3205 | if (!NILP (tem)) | 3202 | if (!NILP (tem)) |
| 3206 | { | 3203 | { |
| 3207 | int count = SPECPDL_INDEX (); | 3204 | int count = SPECPDL_INDEX (); |
| 3208 | Lisp_Object prev_window; | 3205 | Lisp_Object prev_window, prev_buffer; |
| 3209 | prev_window = selected_window; | 3206 | prev_window = selected_window; |
| 3210 | 3207 | XSETBUFFER (prev_buffer, old); | |
| 3211 | /* Select the window that was chosen, for running the hook. */ | 3208 | |
| 3212 | /* Both this Fselect_window and the select_window_1 | 3209 | /* Select the window that was chosen, for running the hook. |
| 3213 | below will (may) incorrectly set-buffer to the buffer | 3210 | Note: Both Fselect_window and select_window_norecord may |
| 3214 | displayed in the window. --stef */ | 3211 | set-buffer to the buffer displayed in the window, |
| 3215 | record_unwind_protect (Fselect_window, prev_window); | 3212 | so we need to save the current buffer. --stef */ |
| 3216 | select_window_1 (window, 0); | 3213 | record_unwind_protect (Fset_buffer, prev_buffer); |
| 3214 | record_unwind_protect (select_window_norecord, prev_window); | ||
| 3215 | Fselect_window (window, Qt); | ||
| 3217 | Fset_buffer (w->buffer); | 3216 | Fset_buffer (w->buffer); |
| 3218 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); | 3217 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); |
| 3219 | select_window_1 (prev_window, 0); | ||
| 3220 | unbind_to (count, Qnil); | 3218 | unbind_to (count, Qnil); |
| 3221 | } | 3219 | } |
| 3222 | } | 3220 | } |
| @@ -5220,7 +5218,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5220 | make_number (old_point), | 5218 | make_number (old_point), |
| 5221 | XWINDOW (data->current_window)->buffer); | 5219 | XWINDOW (data->current_window)->buffer); |
| 5222 | 5220 | ||
| 5223 | Fselect_window (data->current_window); | 5221 | Fselect_window (data->current_window, Qnil); |
| 5224 | XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window | 5222 | XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window |
| 5225 | = selected_window; | 5223 | = selected_window; |
| 5226 | 5224 | ||