diff options
| author | Gerd Moellmann | 1999-09-23 22:17:37 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-09-23 22:17:37 +0000 |
| commit | 86c8e8237595aefe8ec7073d1318d6b5724c2d16 (patch) | |
| tree | 57c1b5f1d8f99326995b7a37a7dd09881dc3ad4a /src/window.c | |
| parent | 9ee8429940bc116755e87a3bd292749f0859bf5c (diff) | |
| download | emacs-86c8e8237595aefe8ec7073d1318d6b5724c2d16.tar.gz emacs-86c8e8237595aefe8ec7073d1318d6b5724c2d16.zip | |
(enlarge_window): Add window parameter instead of using
selected_window.
(Fdisplay_buffer): Call it with window parameter instead of
setting selected_window.
(Fenlarge_window, Fshrink_window): Ditto.
(shrink_mini_window): If there is no recorded height and position
info, resize mini-window to height 1.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/window.c b/src/window.c index 451b7ce2a23..dc25039aa8c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -60,7 +60,7 @@ static void foreach_window_1 P_ ((struct window *, void (*fn) (), int, int, | |||
| 60 | int, int)); | 60 | int, int)); |
| 61 | static void freeze_window_start P_ ((struct window *, int)); | 61 | static void freeze_window_start P_ ((struct window *, int)); |
| 62 | static int window_fixed_size_p P_ ((struct window *, int, int)); | 62 | static int window_fixed_size_p P_ ((struct window *, int, int)); |
| 63 | static void enlarge_window P_ ((int, int)); | 63 | static void enlarge_window P_ ((Lisp_Object, int, int)); |
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | /* This is the window in which the terminal's cursor should | 66 | /* This is the window in which the terminal's cursor should |
| @@ -2789,14 +2789,9 @@ If FRAME is nil, search only the selected frame\n\ | |||
| 2789 | { | 2789 | { |
| 2790 | int total = (XFASTINT (XWINDOW (other)->height) | 2790 | int total = (XFASTINT (XWINDOW (other)->height) |
| 2791 | + XFASTINT (XWINDOW (window)->height)); | 2791 | + XFASTINT (XWINDOW (window)->height)); |
| 2792 | Lisp_Object old_selected_window; | 2792 | enlarge_window (upper, |
| 2793 | old_selected_window = selected_window; | 2793 | total / 2 - XFASTINT (XWINDOW (upper)->height), |
| 2794 | |||
| 2795 | selected_window = upper; | ||
| 2796 | enlarge_window ((total / 2 | ||
| 2797 | - XFASTINT (XWINDOW (upper)->height)), | ||
| 2798 | 0); | 2794 | 0); |
| 2799 | selected_window = old_selected_window; | ||
| 2800 | } | 2795 | } |
| 2801 | } | 2796 | } |
| 2802 | } | 2797 | } |
| @@ -3030,7 +3025,7 @@ From program, optional second arg non-nil means grow sideways ARG columns.") | |||
| 3030 | register Lisp_Object arg, side; | 3025 | register Lisp_Object arg, side; |
| 3031 | { | 3026 | { |
| 3032 | CHECK_NUMBER (arg, 0); | 3027 | CHECK_NUMBER (arg, 0); |
| 3033 | enlarge_window (XINT (arg), !NILP (side)); | 3028 | enlarge_window (selected_window, XINT (arg), !NILP (side)); |
| 3034 | 3029 | ||
| 3035 | if (! NILP (Vwindow_configuration_change_hook)) | 3030 | if (! NILP (Vwindow_configuration_change_hook)) |
| 3036 | call1 (Vrun_hooks, Qwindow_configuration_change_hook); | 3031 | call1 (Vrun_hooks, Qwindow_configuration_change_hook); |
| @@ -3045,7 +3040,7 @@ From program, optional second arg non-nil means shrink sideways arg columns.") | |||
| 3045 | register Lisp_Object arg, side; | 3040 | register Lisp_Object arg, side; |
| 3046 | { | 3041 | { |
| 3047 | CHECK_NUMBER (arg, 0); | 3042 | CHECK_NUMBER (arg, 0); |
| 3048 | enlarge_window (-XINT (arg), !NILP (side)); | 3043 | enlarge_window (selected_window, -XINT (arg), !NILP (side)); |
| 3049 | 3044 | ||
| 3050 | if (! NILP (Vwindow_configuration_change_hook)) | 3045 | if (! NILP (Vwindow_configuration_change_hook)) |
| 3051 | call1 (Vrun_hooks, Qwindow_configuration_change_hook); | 3046 | call1 (Vrun_hooks, Qwindow_configuration_change_hook); |
| @@ -3083,10 +3078,11 @@ window_width (window) | |||
| 3083 | they will be deleted. */ | 3078 | they will be deleted. */ |
| 3084 | 3079 | ||
| 3085 | static void | 3080 | static void |
| 3086 | enlarge_window (delta, widthflag) | 3081 | enlarge_window (window, delta, widthflag) |
| 3082 | Lisp_Object window; | ||
| 3087 | int delta, widthflag; | 3083 | int delta, widthflag; |
| 3088 | { | 3084 | { |
| 3089 | Lisp_Object parent, window, next, prev; | 3085 | Lisp_Object parent, next, prev; |
| 3090 | struct window *p; | 3086 | struct window *p; |
| 3091 | int *sizep, maximum; | 3087 | int *sizep, maximum; |
| 3092 | int (*sizefun) P_ ((Lisp_Object)) | 3088 | int (*sizefun) P_ ((Lisp_Object)) |
| @@ -3099,7 +3095,6 @@ enlarge_window (delta, widthflag) | |||
| 3099 | check_min_window_sizes (); | 3095 | check_min_window_sizes (); |
| 3100 | 3096 | ||
| 3101 | /* Give up if this window cannot be resized. */ | 3097 | /* Give up if this window cannot be resized. */ |
| 3102 | window = selected_window; | ||
| 3103 | if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) | 3098 | if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) |
| 3104 | error ("Window is not resizable"); | 3099 | error ("Window is not resizable"); |
| 3105 | 3100 | ||
| @@ -3483,9 +3478,10 @@ grow_mini_window (w, delta) | |||
| 3483 | } | 3478 | } |
| 3484 | 3479 | ||
| 3485 | 3480 | ||
| 3486 | /* Shrink mini-window W back to its original size before the first | 3481 | /* Shrink mini-window W. If there is recorded info about window sizes |
| 3487 | call to grow_mini_window. Resize other windows on the same frame | 3482 | before a call to grow_mini_window, restore recorded window sizes. |
| 3488 | back to their original size. */ | 3483 | Otherwise, if the mini-window is higher than 1 line, resize it to 1 |
| 3484 | line. */ | ||
| 3489 | 3485 | ||
| 3490 | void | 3486 | void |
| 3491 | shrink_mini_window (w) | 3487 | shrink_mini_window (w) |
| @@ -3501,6 +3497,12 @@ shrink_mini_window (w) | |||
| 3501 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 3497 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 3502 | windows_or_buffers_changed = 1; | 3498 | windows_or_buffers_changed = 1; |
| 3503 | } | 3499 | } |
| 3500 | else if (XFASTINT (w->height) > 1) | ||
| 3501 | { | ||
| 3502 | Lisp_Object window; | ||
| 3503 | XSETWINDOW (window, w); | ||
| 3504 | enlarge_window (window, 1 - XFASTINT (w->height), 0); | ||
| 3505 | } | ||
| 3504 | } | 3506 | } |
| 3505 | 3507 | ||
| 3506 | 3508 | ||