Mercurial > emacs
comparison src/window.c @ 1049:25046e48ce9a
* window.c (coordinates_in_window): Do not assume that all
one-line windows are the minibuffer, or that all minibuffers are
one line high. Use MINI_WINDOW_P.
* window.c (change_window_height): If the size of the window will
shrink below the minimum, this code would only try to delete it if
it had a parent. Well, even if the window doesn't have a parent,
you want Fdelete_window to signal an error, since you're trying to
resize one of the undeleteable windows into nothingness. So call
Fdelete_window even if the window doesn't have a parent.
* window.c (MINSIZE): Add kludge so that the minibuffer is always
allowed to shrink to one line in height.
(MINSIZE, CURBEG, CURSIZE): Change these so that their argument
are always Lisp_Objects, not struct window *'s.
(change_window_height): Changed accordingly.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sat, 29 Aug 1992 03:14:44 +0000 |
parents | 817b0ce337d7 |
children | 55e605674fb1 |
comparison
equal
deleted
inserted
replaced
1048:9899cb2199af | 1049:25046e48ce9a |
---|---|
331 || *y < top || *y >= top + window_height) | 331 || *y < top || *y >= top + window_height) |
332 return 0; | 332 return 0; |
333 | 333 |
334 /* Is the character is the mode line? */ | 334 /* Is the character is the mode line? */ |
335 if (*y == top + window_height - 1 | 335 if (*y == top + window_height - 1 |
336 && window_height > 1) /* 1 line => minibuffer */ | 336 && ! MINI_WINDOW_P (w)) |
337 return 2; | 337 return 2; |
338 | 338 |
339 /* Is the character in the right border? */ | 339 /* Is the character in the right border? */ |
340 if (*x == left + width - 1 | 340 if (*x == left + width - 1 |
341 && left + width != FRAME_WIDTH (XFRAME (w->frame))) | 341 && left + width != FRAME_WIDTH (XFRAME (w->frame))) |
1829 { | 1829 { |
1830 register struct window *p = XWINDOW (window); | 1830 register struct window *p = XWINDOW (window); |
1831 return XFASTINT (p->width); | 1831 return XFASTINT (p->width); |
1832 } | 1832 } |
1833 | 1833 |
1834 #define MINSIZE(w) \ | 1834 #define MINSIZE(w) \ |
1835 (widthflag ? window_min_width : window_min_height) | 1835 (widthflag \ |
1836 ? window_min_width \ | |
1837 : (MINI_WINDOW_P (XWINDOW (w)) ? 1 : window_min_height)) | |
1836 | 1838 |
1837 #define CURBEG(w) \ | 1839 #define CURBEG(w) \ |
1838 *(widthflag ? (int *) &(w)->left : (int *) &(w)->top) | 1840 *(widthflag ? (int *) &(XWINDOW (w)->left) : (int *) &(XWINDOW (w)->top)) |
1839 | 1841 |
1840 #define CURSIZE(w) \ | 1842 #define CURSIZE(w) \ |
1841 *(widthflag ? (int *) &(w)->width : (int *) &(w)->height) | 1843 *(widthflag ? (int *) &(XWINDOW (w)->width) : (int *) &(XWINDOW (w)->height)) |
1842 | 1844 |
1843 /* Unlike set_window_height, this function | 1845 /* Unlike set_window_height, this function |
1844 also changes the heights of the siblings so as to | 1846 also changes the heights of the siblings so as to |
1845 keep everything consistent. */ | 1847 keep everything consistent. */ |
1846 | 1848 |
1874 : !NILP (XWINDOW (parent)->vchild)) | 1876 : !NILP (XWINDOW (parent)->vchild)) |
1875 break; | 1877 break; |
1876 window = parent; | 1878 window = parent; |
1877 } | 1879 } |
1878 | 1880 |
1879 sizep = &CURSIZE (p); | 1881 sizep = &CURSIZE (window); |
1880 | 1882 |
1881 if (*sizep + delta < MINSIZE (p) | 1883 if (*sizep + delta < MINSIZE (window)) |
1882 && !NILP (XWINDOW (window)->parent)) | |
1883 { | 1884 { |
1884 Fdelete_window (window); | 1885 Fdelete_window (window); |
1885 return; | 1886 return; |
1886 } | 1887 } |
1887 | 1888 |
1908 if (!NILP (p->next) && | 1909 if (!NILP (p->next) && |
1909 (*sizefun) (p->next) - delta >= MINSIZE (p->next)) | 1910 (*sizefun) (p->next) - delta >= MINSIZE (p->next)) |
1910 { | 1911 { |
1911 (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); | 1912 (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); |
1912 (*setsizefun) (window, *sizep + delta, 0); | 1913 (*setsizefun) (window, *sizep + delta, 0); |
1913 CURBEG (XWINDOW (p->next)) += delta; | 1914 CURBEG (p->next) += delta; |
1914 /* This does not change size of p->next, | 1915 /* This does not change size of p->next, |
1915 but it propagates the new top edge to its children */ | 1916 but it propagates the new top edge to its children */ |
1916 (*setsizefun) (p->next, (*sizefun) (p->next), 0); | 1917 (*setsizefun) (p->next, (*sizefun) (p->next), 0); |
1917 } | 1918 } |
1918 else if (!NILP (p->prev) && | 1919 else if (!NILP (p->prev) && |
1919 (*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) | 1920 (*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) |
1920 { | 1921 { |
1921 (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); | 1922 (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); |
1922 CURBEG (p) -= delta; | 1923 CURBEG (window) -= delta; |
1923 (*setsizefun) (window, *sizep + delta, 0); | 1924 (*setsizefun) (window, *sizep + delta, 0); |
1924 } | 1925 } |
1925 else | 1926 else |
1926 { | 1927 { |
1927 register int delta1; | 1928 register int delta1; |
1939 else | 1940 else |
1940 delta1 = (delta * opht * 100) / ((opht - *sizep - delta) * 100); | 1941 delta1 = (delta * opht * 100) / ((opht - *sizep - delta) * 100); |
1941 | 1942 |
1942 /* Add delta1 lines or columns to this window, and to the parent, | 1943 /* Add delta1 lines or columns to this window, and to the parent, |
1943 keeping things consistent while not affecting siblings. */ | 1944 keeping things consistent while not affecting siblings. */ |
1944 CURSIZE (XWINDOW (parent)) = opht + delta1; | 1945 CURSIZE (parent) = opht + delta1; |
1945 (*setsizefun) (window, *sizep + delta1, 0); | 1946 (*setsizefun) (window, *sizep + delta1, 0); |
1946 | 1947 |
1947 /* Squeeze out delta1 lines or columns from our parent, | 1948 /* Squeeze out delta1 lines or columns from our parent, |
1948 shriking this window and siblings proportionately. | 1949 shriking this window and siblings proportionately. |
1949 This brings parent back to correct size. | 1950 This brings parent back to correct size. |