diff options
| author | Glenn Morris | 2011-01-15 12:38:27 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-01-15 12:38:27 -0800 |
| commit | d52969e8afaa19ed1acc01f4ff0bb651bf7869a7 (patch) | |
| tree | a51a042adc70e362c982f1aec9e9e3d07097a85c /src | |
| parent | 362b9d483c714a8fd87966ddbd8686850f870e34 (diff) | |
| parent | 9f19b8ddfe3a46d8a5ae86b6c8d2394562d02843 (diff) | |
| download | emacs-d52969e8afaa19ed1acc01f4ff0bb651bf7869a7.tar.gz emacs-d52969e8afaa19ed1acc01f4ff0bb651bf7869a7.zip | |
Merge from emacs-23 branch, up to 2010-05-20T21:33:58Z!juri@jurta.org.
Note:
emacs-23 2010-05-20T01:32:08Z!lekktu@gmail.com 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 4d2aa00cbd3..1cb53d1c6a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-01-15 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.c (inhibit_point_swap): New variable. | ||
| 4 | (Fselect_window): If inhibit_point_swap is nonzero, avoid swapping | ||
| 5 | point this time. | ||
| 6 | (Fset_window_configuration): Set inhibit_point_swap to 1 instead | ||
| 7 | of setting selected_window to nil (Bug#7728). | ||
| 8 | |||
| 1 | 2011-01-11 Tassilo Horn <tassilo@member.fsf.org> | 9 | 2011-01-11 Tassilo Horn <tassilo@member.fsf.org> |
| 2 | 10 | ||
| 3 | * image.c (imagemagick_load_image, Finit_image_library): Free | 11 | * image.c (imagemagick_load_image, Finit_image_library): Free |
diff --git a/src/window.c b/src/window.c index 1487f3033fe..e583e5ba615 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -158,6 +158,11 @@ static int sequence_number; | |||
| 158 | 158 | ||
| 159 | static int window_initialized; | 159 | static int window_initialized; |
| 160 | 160 | ||
| 161 | /* Set in `set-window-configuration' to prevent "swapping out point" | ||
| 162 | in the old selected window. */ | ||
| 163 | |||
| 164 | static int inhibit_point_swap; | ||
| 165 | |||
| 161 | /* Hook to run when window config changes. */ | 166 | /* Hook to run when window config changes. */ |
| 162 | 167 | ||
| 163 | static Lisp_Object Qwindow_configuration_change_hook; | 168 | static Lisp_Object Qwindow_configuration_change_hook; |
| @@ -191,6 +196,10 @@ static int window_scroll_preserve_vpos; | |||
| 191 | static int inhibit_frame_unsplittable; | 196 | static int inhibit_frame_unsplittable; |
| 192 | #endif /* 0 */ | 197 | #endif /* 0 */ |
| 193 | 198 | ||
| 199 | extern EMACS_INT scroll_margin; | ||
| 200 | |||
| 201 | extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; | ||
| 202 | |||
| 194 | /* If non-nil, then the `recenter' command with a nil argument | 203 | /* If non-nil, then the `recenter' command with a nil argument |
| 195 | the entire frame to be redrawn; the special value `tty' causes the | 204 | the entire frame to be redrawn; the special value `tty' causes the |
| 196 | frame to be redrawn only if it is a tty frame. */ | 205 | frame to be redrawn only if it is a tty frame. */ |
| @@ -3594,7 +3603,9 @@ selected window before each command. */) | |||
| 3594 | /* Store the current buffer's actual point into the | 3603 | /* Store the current buffer's actual point into the |
| 3595 | old selected window. It belongs to that window, | 3604 | old selected window. It belongs to that window, |
| 3596 | and when the window is not selected, must be in the window. */ | 3605 | and when the window is not selected, must be in the window. */ |
| 3597 | if (!NILP (selected_window)) | 3606 | if (inhibit_point_swap) |
| 3607 | inhibit_point_swap = 0; | ||
| 3608 | else | ||
| 3598 | { | 3609 | { |
| 3599 | ow = XWINDOW (selected_window); | 3610 | ow = XWINDOW (selected_window); |
| 3600 | if (! NILP (ow->buffer)) | 3611 | if (! NILP (ow->buffer)) |
| @@ -5767,7 +5778,7 @@ zero means top of window, negative means relative to bottom of window. */) | |||
| 5767 | /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer | 5778 | /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer |
| 5768 | when passed below to set_marker_both. */ | 5779 | when passed below to set_marker_both. */ |
| 5769 | error ("move-to-window-line called from unrelated buffer"); | 5780 | error ("move-to-window-line called from unrelated buffer"); |
| 5770 | 5781 | ||
| 5771 | window = selected_window; | 5782 | window = selected_window; |
| 5772 | start = marker_position (w->start); | 5783 | start = marker_position (w->start); |
| 5773 | if (start < BEGV || start > ZV) | 5784 | if (start < BEGV || start > ZV) |
| @@ -6144,10 +6155,6 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6144 | } | 6155 | } |
| 6145 | 6156 | ||
| 6146 | FRAME_ROOT_WINDOW (f) = data->root_window; | 6157 | FRAME_ROOT_WINDOW (f) = data->root_window; |
| 6147 | /* Prevent "swapping out point" in the old selected window | ||
| 6148 | using the buffer that has been restored into it. | ||
| 6149 | We already swapped out point that from that window's old buffer. */ | ||
| 6150 | selected_window = Qnil; | ||
| 6151 | 6158 | ||
| 6152 | /* Arrange *not* to restore point in the buffer that was | 6159 | /* Arrange *not* to restore point in the buffer that was |
| 6153 | current when the window configuration was saved. */ | 6160 | current when the window configuration was saved. */ |
| @@ -6156,6 +6163,11 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6156 | make_number (old_point), | 6163 | make_number (old_point), |
| 6157 | XWINDOW (data->current_window)->buffer); | 6164 | XWINDOW (data->current_window)->buffer); |
| 6158 | 6165 | ||
| 6166 | /* In the following call to `select-window, prevent "swapping | ||
| 6167 | out point" in the old selected window using the buffer that | ||
| 6168 | has been restored into it. We already swapped out that point | ||
| 6169 | from that window's old buffer. */ | ||
| 6170 | inhibit_point_swap = 1; | ||
| 6159 | Fselect_window (data->current_window, Qnil); | 6171 | Fselect_window (data->current_window, Qnil); |
| 6160 | XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window | 6172 | XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window |
| 6161 | = selected_window; | 6173 | = selected_window; |
| @@ -6165,13 +6177,6 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6165 | && FRAME_LIVE_P (XFRAME (data->focus_frame)))) | 6177 | && FRAME_LIVE_P (XFRAME (data->focus_frame)))) |
| 6166 | Fredirect_frame_focus (frame, data->focus_frame); | 6178 | Fredirect_frame_focus (frame, data->focus_frame); |
| 6167 | 6179 | ||
| 6168 | #if 0 /* I don't understand why this is needed, and it causes problems | ||
| 6169 | when the frame's old selected window has been deleted. */ | ||
| 6170 | if (f != selected_frame && FRAME_WINDOW_P (f)) | ||
| 6171 | do_switch_frame (WINDOW_FRAME (XWINDOW (data->root_window)), | ||
| 6172 | 0, 0, Qnil); | ||
| 6173 | #endif | ||
| 6174 | |||
| 6175 | /* Set the screen height to the value it had before this function. */ | 6180 | /* Set the screen height to the value it had before this function. */ |
| 6176 | if (previous_frame_lines != FRAME_LINES (f) | 6181 | if (previous_frame_lines != FRAME_LINES (f) |
| 6177 | || previous_frame_cols != FRAME_COLS (f)) | 6182 | || previous_frame_cols != FRAME_COLS (f)) |
| @@ -7094,6 +7099,8 @@ syms_of_window (void) | |||
| 7094 | window_scroll_preserve_hpos = -1; | 7099 | window_scroll_preserve_hpos = -1; |
| 7095 | window_scroll_preserve_vpos = -1; | 7100 | window_scroll_preserve_vpos = -1; |
| 7096 | 7101 | ||
| 7102 | inhibit_point_swap = 0; | ||
| 7103 | |||
| 7097 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, | 7104 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, |
| 7098 | doc: /* Non-nil means call as function to display a help buffer. | 7105 | doc: /* Non-nil means call as function to display a help buffer. |
| 7099 | The function is called with one argument, the buffer to be displayed. | 7106 | The function is called with one argument, the buffer to be displayed. |