aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-08-29 03:14:44 +0000
committerJim Blandy1992-08-29 03:14:44 +0000
commit05c2896ac5b24f1c7f7ca18e76f59eb2291b9049 (patch)
tree973e3adf3ca5aaa9654a7e8c342aa26acb5e07ab /src
parente04a4e0dcf11972ab406026746e70e6be8e788f4 (diff)
downloademacs-05c2896ac5b24f1c7f7ca18e76f59eb2291b9049.tar.gz
emacs-05c2896ac5b24f1c7f7ca18e76f59eb2291b9049.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/window.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c
index d998f62b430..a5a5563fabb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -333,7 +333,7 @@ coordinates_in_window (w, x, y)
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? */
@@ -1831,14 +1831,16 @@ window_width (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
@@ -1876,10 +1878,9 @@ change_window_height (delta, widthflag)
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;
@@ -1910,7 +1911,7 @@ change_window_height (delta, widthflag)
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);
@@ -1919,7 +1920,7 @@ change_window_height (delta, widthflag)
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
@@ -1941,7 +1942,7 @@ change_window_height (delta, widthflag)
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,