diff options
| author | Glenn Morris | 2011-01-22 11:36:45 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-01-22 11:36:45 -0800 |
| commit | 7c82f3e23e37cc848a38b1f8be7149fd672a6393 (patch) | |
| tree | e721d1d5361deeb04278045331d74e9c7f8b00f0 /src | |
| parent | 80094035aff85d827e1ef65627974b34ad9fa8df (diff) | |
| parent | bd2a4b24c4a591240862704737b5bc696ff67cbf (diff) | |
| download | emacs-7c82f3e23e37cc848a38b1f8be7149fd672a6393.tar.gz emacs-7c82f3e23e37cc848a38b1f8be7149fd672a6393.zip | |
Merge from emacs-23
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/window.c | 56 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-01-22 Jan Djärv <jan.h.d@swipnet.se> | 8 | 2011-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, | |||
| 79 | static void decode_next_window_args (Lisp_Object *, Lisp_Object *, | 79 | static void decode_next_window_args (Lisp_Object *, Lisp_Object *, |
| 80 | Lisp_Object *); | 80 | Lisp_Object *); |
| 81 | static void foreach_window (struct frame *, | 81 | static void foreach_window (struct frame *, |
| 82 | int (* fn) (struct window *, void *), | 82 | int (* fn) (struct window *, void *), |
| 83 | void *); | 83 | void *); |
| 84 | static int foreach_window_1 (struct window *, | 84 | static int foreach_window_1 (struct window *, |
| 85 | int (* fn) (struct window *, void *), | 85 | int (* fn) (struct window *, void *), |
| 86 | void *); | 86 | void *); |
| 87 | static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); | 87 | static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); |
| 88 | static 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 | ||
| 127 | static int window_initialized; | 128 | static int window_initialized; |
| 128 | 129 | ||
| 129 | /* Set in `set-window-configuration' to prevent "swapping out point" | ||
| 130 | in the old selected window. */ | ||
| 131 | |||
| 132 | static int inhibit_point_swap; | ||
| 133 | |||
| 134 | /* Hook to run when window config changes. */ | 130 | /* Hook to run when window config changes. */ |
| 135 | 131 | ||
| 136 | static Lisp_Object Qwindow_configuration_change_hook; | 132 | static 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 | ||
| 3503 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, | 3502 | static Lisp_Object |
| 3504 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. | 3503 | select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) |
| 3505 | If WINDOW is not already selected, make WINDOW's buffer current | ||
| 3506 | and make WINDOW the frame's selected window. Return WINDOW. | ||
| 3507 | Optional second arg NORECORD non-nil means do not put this buffer | ||
| 3508 | at the front of the list of recently selected ones and do not | ||
| 3509 | make this window the most recently selected one. | ||
| 3510 | |||
| 3511 | Note that the main editor command loop selects the buffer of the | ||
| 3512 | selected 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 | |||
| 3581 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, | ||
| 3582 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. | ||
| 3583 | If WINDOW is not already selected, make WINDOW's buffer current | ||
| 3584 | and make WINDOW the frame's selected window. Return WINDOW. | ||
| 3585 | Optional second arg NORECORD non-nil means do not put this buffer | ||
| 3586 | at the front of the list of recently selected ones and do not | ||
| 3587 | make this window the most recently selected one. | ||
| 3588 | |||
| 3589 | Note that the main editor command loop selects the buffer of the | ||
| 3590 | selected window before each command. */) | ||
| 3591 | (register Lisp_Object window, Lisp_Object norecord) | ||
| 3592 | { | ||
| 3593 | select_window (window, norecord, 0); | ||
| 3594 | } | ||
| 3595 | |||
| 3589 | static Lisp_Object | 3596 | static Lisp_Object |
| 3590 | select_window_norecord (Lisp_Object window) | 3597 | select_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. |
| 7053 | The function is called with one argument, the buffer to be displayed. | 7057 | The function is called with one argument, the buffer to be displayed. |