home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / emacs / src / srcdist.lbr / WINDOW.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-13  |  768 b   |  31 lines

  1. /*
  2.  * Window management.
  3.  * Some of the functions are internal,
  4.  * and some are attached to keys that the
  5.  * user actually types.
  6.  */
  7. #include    "stdio.h"
  8. #include    "ed.h"
  9.  
  10. /*
  11.  * Pick a window for a pop-up.
  12.  * Split the screen if there is only
  13.  * one window. Pick the uppermost window that
  14.  * isn't the current window. An LRU algorithm
  15.  * might be better. Return a pointer, or
  16.  * NULL on error.
  17.  */
  18. WINDOW    *
  19. wpopup()
  20. {
  21.     register WINDOW    *wp;
  22.  
  23.     if (wheadp->w_wndp == NULL)        /* Only 1 window    */
  24.     /* && splitwind(FALSE, 0) == FALSE)     /* and it won't split    */
  25.         return (NULL);
  26.     wp = wheadp;                /* Find window to use    */
  27.     while (wp!=NULL && wp==curwp)
  28.         wp = wp->w_wndp;
  29.     return (wp);
  30. }
  31.