Mercurial > emacs
comparison src/window.c @ 9614:e466cdfd962e
(Fdisplay_buffer): If the other window is smaller
than its peer, even out their heights.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Thu, 20 Oct 1994 04:33:34 +0000 |
| parents | b36d5e88cccc |
| children | 48854151266c |
comparison
equal
deleted
inserted
replaced
| 9613:530b4511e5b3 | 9614:e466cdfd962e |
|---|---|
| 1944 && (XFASTINT (XWINDOW (window)->width) | 1944 && (XFASTINT (XWINDOW (window)->width) |
| 1945 == FRAME_WIDTH (XFRAME (WINDOW_FRAME (XWINDOW (window)))))) | 1945 == FRAME_WIDTH (XFRAME (WINDOW_FRAME (XWINDOW (window)))))) |
| 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. */ |
| 1952 if (!NILP (window) | 1954 if (!NILP (window) |
| 1953 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | 1955 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) |
| 1972 #else | 1974 #else |
| 1973 /* As a last resort, use a non minibuffer window. */ | 1975 /* As a last resort, use a non minibuffer window. */ |
| 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 |
| 1980 window = Fget_lru_window (Qnil); | 2000 window = Fget_lru_window (Qnil); |
| 1981 | 2001 |
