diff options
| author | Richard M. Stallman | 1994-10-20 04:33:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-20 04:33:34 +0000 |
| commit | 1942f68fa421e1e41b56558e9254d493f8afb6ef (patch) | |
| tree | 758dded7c1e9cb4b2f5f377949b9dc50dc0446bc /src/window.c | |
| parent | 8148baf912290dccd9691e0df509bdf4312c8be6 (diff) | |
| download | emacs-1942f68fa421e1e41b56558e9254d493f8afb6ef.tar.gz emacs-1942f68fa421e1e41b56558e9254d493f8afb6ef.zip | |
(Fdisplay_buffer): If the other window is smaller
than its peer, even out their heights.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index c6c95e68405..96588a8623d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1946,6 +1946,8 @@ Returns the window displaying BUFFER.") | |||
| 1946 | window = Fsplit_window (window, Qnil, Qnil); | 1946 | window = Fsplit_window (window, Qnil, Qnil); |
| 1947 | else | 1947 | else |
| 1948 | { | 1948 | { |
| 1949 | Lisp_Object upper, lower, other; | ||
| 1950 | |||
| 1949 | window = Fget_lru_window (frames); | 1951 | window = Fget_lru_window (frames); |
| 1950 | /* If the LRU window is selected, and big enough, | 1952 | /* If the LRU window is selected, and big enough, |
| 1951 | and can be split, split it. */ | 1953 | and can be split, split it. */ |
| @@ -1974,6 +1976,24 @@ Returns the window displaying BUFFER.") | |||
| 1974 | if (NILP (window)) | 1976 | if (NILP (window)) |
| 1975 | window = Fframe_first_window (Fselected_frame ()); | 1977 | window = Fframe_first_window (Fselected_frame ()); |
| 1976 | #endif | 1978 | #endif |
| 1979 | /* If window appears above or below another, | ||
| 1980 | even out their heights. */ | ||
| 1981 | if (!NILP (XWINDOW (window)->prev)) | ||
| 1982 | other = upper = XWINDOW (window)->prev, lower = window; | ||
| 1983 | if (!NILP (XWINDOW (window)->next)) | ||
| 1984 | other = lower = XWINDOW (window)->next, upper = window; | ||
| 1985 | if (!NILP (other) | ||
| 1986 | /* Check that OTHER and WINDOW are vertically arrayed. */ | ||
| 1987 | && XWINDOW (other)->top != XWINDOW (window)->top | ||
| 1988 | && XWINDOW (other)->height > XWINDOW (window)->height) | ||
| 1989 | { | ||
| 1990 | int total = XWINDOW (other)->height + XWINDOW (window)->height; | ||
| 1991 | struct window *old_selected_window = selected_window; | ||
| 1992 | |||
| 1993 | selected_window = XWINDOW (upper); | ||
| 1994 | change_window_height (total / 2 - XWINDOW (upper)->height, 0); | ||
| 1995 | selected_window = old_selected_window; | ||
| 1996 | } | ||
| 1977 | } | 1997 | } |
| 1978 | } | 1998 | } |
| 1979 | else | 1999 | else |