diff options
author | Glenn Morris <[email protected]> | 2011-01-15 12:38:27 -0800 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2011-01-15 12:38:27 -0800 |
commit | d52969e8afaa19ed1acc01f4ff0bb651bf7869a7 (patch) | |
tree | a51a042adc70e362c982f1aec9e9e3d07097a85c /src | |
parent | 362b9d483c714a8fd87966ddbd8686850f870e34 (diff) | |
parent | 9f19b8ddfe3a46d8a5ae86b6c8d2394562d02843 (diff) |
Merge from emacs-23 branch, up to 2010-05-20T21:33:[email protected].
Note:
emacs-23 2010-05-20T01:32:[email protected] is rendered unnecessary by pre-existing 2010-05-20
trunk change.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 8 | ||||
-rw-r--r-- | src/window.c | 33 |
2 files changed, 28 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4d2aa00cbd..1cb53d1c6a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2011-01-15 Martin Rudalics <[email protected]> + + * window.c (inhibit_point_swap): New variable. + (Fselect_window): If inhibit_point_swap is nonzero, avoid swapping + point this time. + (Fset_window_configuration): Set inhibit_point_swap to 1 instead + of setting selected_window to nil (Bug#7728). + 2011-01-11 Tassilo Horn <[email protected]> * image.c (imagemagick_load_image, Finit_image_library): Free diff --git a/src/window.c b/src/window.c index 1487f3033f..e583e5ba61 100644 --- a/src/window.c +++ b/src/window.c @@ -158,6 +158,11 @@ static int sequence_number; static int window_initialized; +/* Set in `set-window-configuration' to prevent "swapping out point" + in the old selected window. */ + +static int inhibit_point_swap; + /* Hook to run when window config changes. */ static Lisp_Object Qwindow_configuration_change_hook; @@ -191,6 +196,10 @@ static int window_scroll_preserve_vpos; static int inhibit_frame_unsplittable; #endif /* 0 */ +extern EMACS_INT scroll_margin; + +extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; + /* If non-nil, then the `recenter' command with a nil argument the entire frame to be redrawn; the special value `tty' causes the frame to be redrawn only if it is a tty frame. */ @@ -3594,7 +3603,9 @@ selected window before each command. */) /* Store the current buffer's actual point into the old selected window. It belongs to that window, and when the window is not selected, must be in the window. */ - if (!NILP (selected_window)) + if (inhibit_point_swap) + inhibit_point_swap = 0; + else { ow = XWINDOW (selected_window); if (! NILP (ow->buffer)) @@ -5767,7 +5778,7 @@ zero means top of window, negative means relative to bottom of window. */) /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer when passed below to set_marker_both. */ error ("move-to-window-line called from unrelated buffer"); - + window = selected_window; start = marker_position (w->start); if (start < BEGV || start > ZV) @@ -6144,10 +6155,6 @@ the return value is nil. Otherwise the value is t. */) } FRAME_ROOT_WINDOW (f) = data->root_window; - /* Prevent "swapping out point" in the old selected window - using the buffer that has been restored into it. - We already swapped out point that from that window's old buffer. */ - selected_window = Qnil; /* Arrange *not* to restore point in the buffer that was current when the window configuration was saved. */ @@ -6156,6 +6163,11 @@ the return value is nil. Otherwise the value is t. */) make_number (old_point), XWINDOW (data->current_window)->buffer); + /* In the following call to `select-window, prevent "swapping + out point" in the old selected window using the buffer that + has been restored into it. We already swapped out that point + from that window's old buffer. */ + inhibit_point_swap = 1; Fselect_window (data->current_window, Qnil); XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window = selected_window; @@ -6165,13 +6177,6 @@ the return value is nil. Otherwise the value is t. */) && FRAME_LIVE_P (XFRAME (data->focus_frame)))) Fredirect_frame_focus (frame, data->focus_frame); -#if 0 /* I don't understand why this is needed, and it causes problems - when the frame's old selected window has been deleted. */ - if (f != selected_frame && FRAME_WINDOW_P (f)) - do_switch_frame (WINDOW_FRAME (XWINDOW (data->root_window)), - 0, 0, Qnil); -#endif - /* Set the screen height to the value it had before this function. */ if (previous_frame_lines != FRAME_LINES (f) || previous_frame_cols != FRAME_COLS (f)) @@ -7094,6 +7099,8 @@ syms_of_window (void) window_scroll_preserve_hpos = -1; window_scroll_preserve_vpos = -1; + inhibit_point_swap = 0; + DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, doc: /* Non-nil means call as function to display a help buffer. The function is called with one argument, the buffer to be displayed. |