aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2011-01-22 11:36:45 -0800
committerGlenn Morris2011-01-22 11:36:45 -0800
commit7c82f3e23e37cc848a38b1f8be7149fd672a6393 (patch)
treee721d1d5361deeb04278045331d74e9c7f8b00f0 /src
parent80094035aff85d827e1ef65627974b34ad9fa8df (diff)
parentbd2a4b24c4a591240862704737b5bc696ff67cbf (diff)
downloademacs-7c82f3e23e37cc848a38b1f8be7149fd672a6393.tar.gz
emacs-7c82f3e23e37cc848a38b1f8be7149fd672a6393.zip
Merge from emacs-23
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c56
2 files changed, 37 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fcf8218d670..355376a886b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12011-01-22 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (select_window): New function.
4 (Fselect_window): Call it.
5 (inhibit_point_swap): Variable deleted.
6 (Fset_window_configuration): Call select_window directly.
7
12011-01-22 Jan Djärv <jan.h.d@swipnet.se> 82011-01-22 Jan Djärv <jan.h.d@swipnet.se>
2 9
3 * nsterm.m (constrainFrameRect): Only constrain the first time called. 10 * nsterm.m (constrainFrameRect): Only constrain the first time called.
diff --git a/src/window.c b/src/window.c
index 22e3f3d8818..2feaa275517 100644
--- a/src/window.c
+++ b/src/window.c
@@ -79,12 +79,13 @@ static Lisp_Object next_window (Lisp_Object, Lisp_Object,
79static void decode_next_window_args (Lisp_Object *, Lisp_Object *, 79static void decode_next_window_args (Lisp_Object *, Lisp_Object *,
80 Lisp_Object *); 80 Lisp_Object *);
81static void foreach_window (struct frame *, 81static void foreach_window (struct frame *,
82 int (* fn) (struct window *, void *), 82 int (* fn) (struct window *, void *),
83 void *); 83 void *);
84static int foreach_window_1 (struct window *, 84static int foreach_window_1 (struct window *,
85 int (* fn) (struct window *, void *), 85 int (* fn) (struct window *, void *),
86 void *); 86 void *);
87static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); 87static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
88static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
88 89
89/* This is the window in which the terminal's cursor should 90/* This is the window in which the terminal's cursor should
90 be left when nothing is being done with it. This must 91 be left when nothing is being done with it. This must
@@ -126,11 +127,6 @@ static int sequence_number;
126 127
127static int window_initialized; 128static int window_initialized;
128 129
129/* Set in `set-window-configuration' to prevent "swapping out point"
130 in the old selected window. */
131
132static int inhibit_point_swap;
133
134/* Hook to run when window config changes. */ 130/* Hook to run when window config changes. */
135 131
136static Lisp_Object Qwindow_configuration_change_hook; 132static Lisp_Object Qwindow_configuration_change_hook;
@@ -3497,20 +3493,14 @@ This function runs `window-scroll-functions' before running
3497 return Qnil; 3493 return Qnil;
3498} 3494}
3499 3495
3500/* Note that selected_window can be nil when this is called from 3496/* If select_window is called with inhibit_point_swap non-zero it will
3501 Fset_window_configuration. */ 3497 not store point of the old selected window's buffer back into that
3498 window's pointm slot. This is needed by Fset_window_configuration to
3499 avoid that the display routine is called with selected_window set to
3500 Qnil causing a subsequent crash. */
3502 3501
3503DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, 3502static Lisp_Object
3504 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. 3503select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
3505If WINDOW is not already selected, make WINDOW's buffer current
3506and make WINDOW the frame's selected window. Return WINDOW.
3507Optional second arg NORECORD non-nil means do not put this buffer
3508at the front of the list of recently selected ones and do not
3509make this window the most recently selected one.
3510
3511Note that the main editor command loop selects the buffer of the
3512selected window before each command. */)
3513 (register Lisp_Object window, Lisp_Object norecord)
3514{ 3504{
3515 register struct window *w; 3505 register struct window *w;
3516 register struct window *ow; 3506 register struct window *ow;
@@ -3550,9 +3540,7 @@ selected window before each command. */)
3550 /* Store the current buffer's actual point into the 3540 /* Store the current buffer's actual point into the
3551 old selected window. It belongs to that window, 3541 old selected window. It belongs to that window,
3552 and when the window is not selected, must be in the window. */ 3542 and when the window is not selected, must be in the window. */
3553 if (inhibit_point_swap) 3543 if (!inhibit_point_swap)
3554 inhibit_point_swap = 0;
3555 else
3556 { 3544 {
3557 ow = XWINDOW (selected_window); 3545 ow = XWINDOW (selected_window);
3558 if (! NILP (ow->buffer)) 3546 if (! NILP (ow->buffer))
@@ -3586,6 +3574,25 @@ selected window before each command. */)
3586 return window; 3574 return window;
3587} 3575}
3588 3576
3577
3578/* Note that selected_window can be nil when this is called from
3579 Fset_window_configuration. */
3580
3581DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
3582 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer.
3583If WINDOW is not already selected, make WINDOW's buffer current
3584and make WINDOW the frame's selected window. Return WINDOW.
3585Optional second arg NORECORD non-nil means do not put this buffer
3586at the front of the list of recently selected ones and do not
3587make this window the most recently selected one.
3588
3589Note that the main editor command loop selects the buffer of the
3590selected window before each command. */)
3591 (register Lisp_Object window, Lisp_Object norecord)
3592{
3593 select_window (window, norecord, 0);
3594}
3595
3589static Lisp_Object 3596static Lisp_Object
3590select_window_norecord (Lisp_Object window) 3597select_window_norecord (Lisp_Object window)
3591{ 3598{
@@ -6114,8 +6121,7 @@ the return value is nil. Otherwise the value is t. */)
6114 out point" in the old selected window using the buffer that 6121 out point" in the old selected window using the buffer that
6115 has been restored into it. We already swapped out that point 6122 has been restored into it. We already swapped out that point
6116 from that window's old buffer. */ 6123 from that window's old buffer. */
6117 inhibit_point_swap = 1; 6124 select_window (data->current_window, Qnil, 1);
6118 Fselect_window (data->current_window, Qnil);
6119 XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window 6125 XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
6120 = selected_window; 6126 = selected_window;
6121 6127
@@ -7046,8 +7052,6 @@ syms_of_window (void)
7046 window_scroll_preserve_hpos = -1; 7052 window_scroll_preserve_hpos = -1;
7047 window_scroll_preserve_vpos = -1; 7053 window_scroll_preserve_vpos = -1;
7048 7054
7049 inhibit_point_swap = 0;
7050
7051 DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function, 7055 DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function,
7052 doc: /* Non-nil means call as function to display a help buffer. 7056 doc: /* Non-nil means call as function to display a help buffer.
7053The function is called with one argument, the buffer to be displayed. 7057The function is called with one argument, the buffer to be displayed.