changeset 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 9899cb2199af
children 133bad38bde1
files src/window.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Sat Aug 29 03:07:24 1992 +0000
+++ b/src/window.c	Sat Aug 29 03:14:44 1992 +0000
@@ -333,7 +333,7 @@
 
   /* Is the character is the mode line?  */
   if (*y == top + window_height - 1
-      && window_height > 1)	/* 1 line => minibuffer */
+      && ! MINI_WINDOW_P (w))
     return 2;
   
   /* Is the character in the right border?  */
@@ -1831,14 +1831,16 @@
   return XFASTINT (p->width);
 }
 
-#define MINSIZE(w) \
-  (widthflag ? window_min_width : window_min_height)
+#define MINSIZE(w)						\
+  (widthflag							\
+   ? window_min_width						\
+   : (MINI_WINDOW_P (XWINDOW (w)) ? 1 : window_min_height))
 
 #define CURBEG(w) \
-  *(widthflag ? (int *) &(w)->left : (int *) &(w)->top)
+  *(widthflag ? (int *) &(XWINDOW (w)->left) : (int *) &(XWINDOW (w)->top))
 
 #define CURSIZE(w) \
-  *(widthflag ? (int *) &(w)->width : (int *) &(w)->height)
+  *(widthflag ? (int *) &(XWINDOW (w)->width) : (int *) &(XWINDOW (w)->height))
 
 /* Unlike set_window_height, this function
    also changes the heights of the siblings so as to
@@ -1876,10 +1878,9 @@
       window = parent;
     }
 
-  sizep = &CURSIZE (p);
-
-  if (*sizep + delta < MINSIZE (p)
-      && !NILP (XWINDOW (window)->parent))
+  sizep = &CURSIZE (window);
+
+  if (*sizep + delta < MINSIZE (window))
     {
       Fdelete_window (window);
       return;
@@ -1910,7 +1911,7 @@
     {
       (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0);
       (*setsizefun) (window, *sizep + delta, 0);
-      CURBEG (XWINDOW (p->next)) += delta;
+      CURBEG (p->next) += delta;
       /* This does not change size of p->next,
 	 but it propagates the new top edge to its children */
       (*setsizefun) (p->next, (*sizefun) (p->next), 0);
@@ -1919,7 +1920,7 @@
 	   (*sizefun) (p->prev) - delta >= MINSIZE (p->prev))
     {
       (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0);
-      CURBEG (p) -= delta;
+      CURBEG (window) -= delta;
       (*setsizefun) (window, *sizep + delta, 0);
     }
   else
@@ -1941,7 +1942,7 @@
 
       /* Add delta1 lines or columns to this window, and to the parent,
 	 keeping things consistent while not affecting siblings.  */
-      CURSIZE (XWINDOW (parent)) = opht + delta1;
+      CURSIZE (parent) = opht + delta1;
       (*setsizefun) (window, *sizep + delta1, 0);
 
       /* Squeeze out delta1 lines or columns from our parent,