emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/window.c


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/src/window.c
Date: Tue, 04 Feb 2003 09:03:54 -0500

Index: emacs/src/window.c
diff -c emacs/src/window.c:1.434 emacs/src/window.c:1.435
*** emacs/src/window.c:1.434    Wed Jan  1 12:00:34 2003
--- emacs/src/window.c  Tue Feb  4 09:03:17 2003
***************
*** 451,461 ****
  
    CHECK_NUMBER (ncol);
    hscroll = max (0, XINT (ncol));
!   
    /* Prevent redisplay shortcuts when changing the hscroll.  */
    if (XINT (w->hscroll) != hscroll)
      XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
!   
    w->hscroll = make_number (hscroll);
    return ncol;
  }
--- 451,461 ----
  
    CHECK_NUMBER (ncol);
    hscroll = max (0, XINT (ncol));
! 
    /* Prevent redisplay shortcuts when changing the hscroll.  */
    if (XINT (w->hscroll) != hscroll)
      XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
! 
    w->hscroll = make_number (hscroll);
    return ncol;
  }
***************
*** 543,549 ****
  
    if (*x < x0 || *x >= x1)
      return ON_NOTHING;
!   
    /* In what's below, we subtract 1 when computing right_x because we
       want the rightmost pixel, which is given by left_pixel+width-1.  */
    if (w->pseudo_window_p)
--- 543,549 ----
  
    if (*x < x0 || *x >= x1)
      return ON_NOTHING;
! 
    /* In what's below, we subtract 1 when computing right_x because we
       want the rightmost pixel, which is given by left_pixel+width-1.  */
    if (w->pseudo_window_p)
***************
*** 578,584 ****
         as the vertical border.    If scroll bars on the left,
         return the right window.  */
        part = ON_MODE_LINE;
!       
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
        {
          if (abs (*x - x0) < grabbable_width)
--- 578,584 ----
         as the vertical border.    If scroll bars on the left,
         return the right window.  */
        part = ON_MODE_LINE;
! 
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
        {
          if (abs (*x - x0) < grabbable_width)
***************
*** 592,598 ****
           && *y >= top_y)
      {
        part = ON_HEADER_LINE;
!       
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
        {
          if (abs (*x - x0) < grabbable_width)
--- 592,598 ----
           && *y >= top_y)
      {
        part = ON_HEADER_LINE;
! 
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
        {
          if (abs (*x - x0) < grabbable_width)
***************
*** 626,632 ****
        {
          /* Other lines than the mode line don't include fringes and
             scroll bars on the left.  */
!       
          /* Convert X and Y to window-relative pixel coordinates.  */
          *x -= left_x;
          *y -= top_y;
--- 626,632 ----
        {
          /* Other lines than the mode line don't include fringes and
             scroll bars on the left.  */
! 
          /* Convert X and Y to window-relative pixel coordinates.  */
          *x -= left_x;
          *y -= top_y;
***************
*** 659,665 ****
        {
          /* Other lines than the mode line don't include fringes and
             scroll bars on the left.  */
!       
          /* Convert X and Y to window-relative pixel coordinates.  */
          *x -= left_x;
          *y -= top_y;
--- 659,665 ----
        {
          /* Other lines than the mode line don't include fringes and
             scroll bars on the left.  */
! 
          /* Convert X and Y to window-relative pixel coordinates.  */
          *x -= left_x;
          *y -= top_y;
***************
*** 744,750 ****
      case ON_TEXT:
        /* X and Y are now window relative pixel coordinates.  Convert
         them to canonical char units before returning them.  */
!       return Fcons (CANON_X_FROM_PIXEL_X (f, x), 
                    CANON_Y_FROM_PIXEL_Y (f, y));
  
      case ON_MODE_LINE:
--- 744,750 ----
      case ON_TEXT:
        /* X and Y are now window relative pixel coordinates.  Convert
         them to canonical char units before returning them.  */
!       return Fcons (CANON_X_FROM_PIXEL_X (f, x),
                    CANON_Y_FROM_PIXEL_Y (f, y));
  
      case ON_MODE_LINE:
***************
*** 758,770 ****
  
      case ON_LEFT_FRINGE:
        return Qleft_fringe;
!       
      case ON_RIGHT_FRINGE:
        return Qright_fringe;
  
      case ON_LEFT_MARGIN:
        return Qleft_margin;
!       
      case ON_RIGHT_MARGIN:
        return Qright_margin;
  
--- 758,770 ----
  
      case ON_LEFT_FRINGE:
        return Qleft_fringe;
! 
      case ON_RIGHT_FRINGE:
        return Qright_fringe;
  
      case ON_LEFT_MARGIN:
        return Qleft_margin;
! 
      case ON_RIGHT_MARGIN:
        return Qright_margin;
  
***************
*** 805,811 ****
        XSETWINDOW (*cw->window, w);
        continue_p = 0;
      }
!   
    return continue_p;
  }
  
--- 805,811 ----
        XSETWINDOW (*cw->window, w);
        continue_p = 0;
      }
! 
    return continue_p;
  }
  
***************
*** 839,845 ****
    window = Qnil;
    cw.window = &window, cw.x = &x, cw.y = &y; cw.part = part;
    foreach_window (f, check_window_containing, &cw);
!   
    /* If not found above, see if it's in the tool bar window, if a tool
       bar exists.  */
    if (NILP (window)
--- 839,845 ----
    window = Qnil;
    cw.window = &window, cw.x = &x, cw.y = &y; cw.part = part;
    foreach_window (f, check_window_containing, &cw);
! 
    /* If not found above, see if it's in the tool bar window, if a tool
       bar exists.  */
    if (NILP (window)
***************
*** 876,882 ****
    CHECK_NUMBER_OR_FLOAT (x);
    CHECK_NUMBER_OR_FLOAT (y);
  
!   return window_from_coordinates (f, 
                                  PIXEL_X_FROM_CANON_X (f, x),
                                  PIXEL_Y_FROM_CANON_Y (f, y),
                                  &part, 0);
--- 876,882 ----
    CHECK_NUMBER_OR_FLOAT (x);
    CHECK_NUMBER_OR_FLOAT (y);
  
!   return window_from_coordinates (f,
                                  PIXEL_X_FROM_CANON_X (f, x),
                                  PIXEL_Y_FROM_CANON_Y (f, y),
                                  &part, 0);
***************
*** 976,988 ****
          old_buffer = current_buffer;
          set_buffer_internal (b);
        }
!       
        start_display (&it, w, startp);
        move_it_vertically (&it, window_box_height (w));
        if (it.current_y < it.last_visible_y)
        move_it_past_eol (&it);
        value = make_number (IT_CHARPOS (it));
!       
        if (old_buffer)
        set_buffer_internal (old_buffer);
      }
--- 976,988 ----
          old_buffer = current_buffer;
          set_buffer_internal (b);
        }
! 
        start_display (&it, w, startp);
        move_it_vertically (&it, window_box_height (w));
        if (it.current_y < it.last_visible_y)
        move_it_past_eol (&it);
        value = make_number (IT_CHARPOS (it));
! 
        if (old_buffer)
        set_buffer_internal (old_buffer);
      }
***************
*** 1010,1016 ****
       the new value of point.  */
    if (!EQ (window, selected_window))
      ++windows_or_buffers_changed;
!   
    return pos;
  }
  
--- 1010,1016 ----
       the new value of point.  */
    if (!EQ (window, selected_window))
      ++windows_or_buffers_changed;
! 
    return pos;
  }
  
***************
*** 1093,1099 ****
    else if (BUFFERP (w->buffer))
      {
        struct buffer *b = XBUFFER (w->buffer);
!       
        if (DISP_TABLE_P (b->display_table))
        dp = XCHAR_TABLE (b->display_table);
        else if (DISP_TABLE_P (Vstandard_display_table))
--- 1093,1099 ----
    else if (BUFFERP (w->buffer))
      {
        struct buffer *b = XBUFFER (w->buffer);
! 
        if (DISP_TABLE_P (b->display_table))
        dp = XCHAR_TABLE (b->display_table);
        else if (DISP_TABLE_P (Vstandard_display_table))
***************
*** 1159,1165 ****
                         clip_to_bounds (BUF_BEGV_BYTE (b),
                                         marker_byte_position (w->pointm),
                                         BUF_ZV_BYTE (b)));
!   
    if (WINDOWP (b->last_selected_window)
        && w == XWINDOW (b->last_selected_window))
      b->last_selected_window = Qnil;
--- 1159,1165 ----
                         clip_to_bounds (BUF_BEGV_BYTE (b),
                                         marker_byte_position (w->pointm),
                                         BUF_ZV_BYTE (b)));
! 
    if (WINDOWP (b->last_selected_window)
        && w == XWINDOW (b->last_selected_window))
      b->last_selected_window = Qnil;
***************
*** 1441,1447 ****
          Vwindow_list = Fnconc (2, args);
        }
      }
!   
    return Vwindow_list;
  }
  
--- 1441,1447 ----
          Vwindow_list = Fnconc (2, args);
        }
      }
! 
    return Vwindow_list;
  }
  
***************
*** 1518,1531 ****
      *window = selected_window;
    else
      CHECK_LIVE_WINDOW (*window);
!   
    /* MINIBUF nil may or may not include minibuffers.  Decide if it
       does.  */
    if (NILP (*minibuf))
      *minibuf = minibuf_level ? minibuf_window : Qlambda;
    else if (!EQ (*minibuf, Qt))
      *minibuf = Qlambda;
!   
    /* Now *MINIBUF can be t => count all minibuffer windows, `lambda'
       => count none of them, or a specific minibuffer window (the
       active one) to count.  */
--- 1518,1531 ----
      *window = selected_window;
    else
      CHECK_LIVE_WINDOW (*window);
! 
    /* MINIBUF nil may or may not include minibuffers.  Decide if it
       does.  */
    if (NILP (*minibuf))
      *minibuf = minibuf_level ? minibuf_window : Qlambda;
    else if (!EQ (*minibuf, Qt))
      *minibuf = Qlambda;
! 
    /* Now *MINIBUF can be t => count all minibuffer windows, `lambda'
       => count none of them, or a specific minibuffer window (the
       active one) to count.  */
***************
*** 1543,1549 ****
      ;
    else if (!EQ (*all_frames, Qt))
      *all_frames = Qnil;
!   
    /* Now *ALL_FRAMES is t meaning search all frames, nil meaning
       search just current frame, `visible' meaning search just visible
       frames, 0 meaning search visible and iconified frames, or a
--- 1543,1549 ----
      ;
    else if (!EQ (*all_frames, Qt))
      *all_frames = Qnil;
! 
    /* Now *ALL_FRAMES is t meaning search all frames, nil meaning
       search just current frame, `visible' meaning search just visible
       frames, 0 meaning search visible and iconified frames, or a
***************
*** 1563,1579 ****
       int next_p;
  {
    decode_next_window_args (&window, &minibuf, &all_frames);
!   
    /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
       return the first window on the frame.  */
    if (FRAMEP (all_frames)
        && !EQ (all_frames, XWINDOW (window)->frame))
      return Fframe_first_window (all_frames);
!   
    if (next_p)
      {
        Lisp_Object list;
!       
        /* Find WINDOW in the list of all windows.  */
        list = Fmemq (window, window_list ());
  
--- 1563,1579 ----
       int next_p;
  {
    decode_next_window_args (&window, &minibuf, &all_frames);
! 
    /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
       return the first window on the frame.  */
    if (FRAMEP (all_frames)
        && !EQ (all_frames, XWINDOW (window)->frame))
      return Fframe_first_window (all_frames);
! 
    if (next_p)
      {
        Lisp_Object list;
! 
        /* Find WINDOW in the list of all windows.  */
        list = Fmemq (window, window_list ());
  
***************
*** 1597,1603 ****
    else
      {
        Lisp_Object candidate, list;
!       
        /* Scan through the list of windows for candidates.  If there are
         candidate windows in front of WINDOW, the last one of these
         is the one we want.  If there are candidates following WINDOW
--- 1597,1603 ----
    else
      {
        Lisp_Object candidate, list;
! 
        /* Scan through the list of windows for candidates.  If there are
         candidate windows in front of WINDOW, the last one of these
         is the one we want.  If there are candidates following WINDOW
***************
*** 1703,1709 ****
  
    CHECK_NUMBER (arg);
    window = selected_window;
!   
    for (i = XINT (arg); i > 0; --i)
      window = Fnext_window (window, Qnil, all_frames);
    for (; i < 0; ++i)
--- 1703,1709 ----
  
    CHECK_NUMBER (arg);
    window = selected_window;
! 
    for (i = XINT (arg); i > 0; --i)
      window = Fnext_window (window, Qnil, all_frames);
    for (; i < 0; ++i)
***************
*** 1748,1758 ****
  
    decode_next_window_args (&window, &minibuf, &all_frames);
    list = Qnil;
!   
    for (tail = window_list (); CONSP (tail); tail = XCDR (tail))
      if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
        list = Fcons (XCAR (tail), list);
!   
    return Fnreverse (list);
  }
  
--- 1748,1758 ----
  
    decode_next_window_args (&window, &minibuf, &all_frames);
    list = Qnil;
! 
    for (tail = window_list (); CONSP (tail); tail = XCDR (tail))
      if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
        list = Fcons (XCAR (tail), list);
! 
    return Fnreverse (list);
  }
  
***************
*** 1787,1793 ****
    Lisp_Object window, windows, best_window, frame_arg;
    struct frame *f;
    struct gcpro gcpro1;
!   
    /* If we're only looping through windows on a particular frame,
       frame points to that frame.  If we're looping through windows
       on all frames, frame is 0.  */
--- 1787,1793 ----
    Lisp_Object window, windows, best_window, frame_arg;
    struct frame *f;
    struct gcpro gcpro1;
! 
    /* If we're only looping through windows on a particular frame,
       frame points to that frame.  If we're looping through windows
       on all frames, frame is 0.  */
***************
*** 1797,1803 ****
      f = SELECTED_FRAME ();
    else
      f = NULL;
!   
    if (f)
      frame_arg = Qlambda;
    else if (XFASTINT (frames) == 0)
--- 1797,1803 ----
      f = SELECTED_FRAME ();
    else
      f = NULL;
! 
    if (f)
      frame_arg = Qlambda;
    else if (XFASTINT (frames) == 0)
***************
*** 1826,1835 ****
    for (; CONSP (windows); windows = CDR (windows))
      {
        struct window *w;
!       
        window = XCAR (windows);
        w = XWINDOW (window);
!       
        /* Note that we do not pay attention here to whether the frame
         is visible, since Fwindow_list skips non-visible frames if
         that is desired, under the control of frame_arg.  */
--- 1826,1835 ----
    for (; CONSP (windows); windows = CDR (windows))
      {
        struct window *w;
! 
        window = XCAR (windows);
        w = XWINDOW (window);
! 
        /* Note that we do not pay attention here to whether the frame
         is visible, since Fwindow_list skips non-visible frames if
         that is desired, under the control of frame_arg.  */
***************
*** 1891,1897 ****
                           && EQ (XWINDOW (XCAR (windows))->frame,
                                  XWINDOW (XCAR (XCDR (windows)))->frame))
                      windows = XCDR (windows);
!                   
                    /* Now we can safely delete the frame.  */
                    Fdelete_frame (w->frame, Qnil);
                  }
--- 1891,1897 ----
                           && EQ (XWINDOW (XCAR (windows))->frame,
                                  XWINDOW (XCAR (XCDR (windows)))->frame))
                      windows = XCDR (windows);
! 
                    /* Now we can safely delete the frame.  */
                    Fdelete_frame (w->frame, Qnil);
                  }
***************
*** 1916,1922 ****
              /* Ignore dedicated windows and minibuffers.  */
              if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
                break;
!             
              if (NILP (best_window))
                best_window = window;
              else
--- 1916,1922 ----
              /* Ignore dedicated windows and minibuffers.  */
              if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
                break;
! 
              if (NILP (best_window))
                best_window = window;
              else
***************
*** 1934,1943 ****
              {
                Lisp_Object buffer;
                struct frame *f = XFRAME (w->frame);
!               
                /* Find another buffer to show in this window.  */
                buffer = Fother_buffer (obj, Qnil, w->frame);
!               
                /* If this window is dedicated, and in a frame of its own,
                   kill the frame.  */
                if (EQ (window, FRAME_ROOT_WINDOW (f))
--- 1934,1943 ----
              {
                Lisp_Object buffer;
                struct frame *f = XFRAME (w->frame);
! 
                /* Find another buffer to show in this window.  */
                buffer = Fother_buffer (obj, Qnil, w->frame);
! 
                /* If this window is dedicated, and in a frame of its own,
                   kill the frame.  */
                if (EQ (window, FRAME_ROOT_WINDOW (f))
***************
*** 1950,1956 ****
                           && EQ (XWINDOW (XCAR (windows))->frame,
                                  XWINDOW (XCAR (XCDR (windows)))->frame))
                      windows = XCDR (windows);
!                   
                    /* Now we can safely delete the frame.  */
                    Fdelete_frame (w->frame, Qnil);
                  }
--- 1950,1956 ----
                           && EQ (XWINDOW (XCAR (windows))->frame,
                                  XWINDOW (XCAR (XCDR (windows)))->frame))
                      windows = XCDR (windows);
! 
                    /* Now we can safely delete the frame.  */
                    Fdelete_frame (w->frame, Qnil);
                  }
***************
*** 2136,2142 ****
        CHECK_BUFFER (buffer);
        window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame);
      }
!   
    return Qnil;
  }
  
--- 2136,2142 ----
        CHECK_BUFFER (buffer);
        window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame);
      }
! 
    return Qnil;
  }
  
***************
*** 2212,2218 ****
      = ((FRAME_MINIBUF_ONLY_P (frame) || ! FRAME_HAS_MINIBUF_P (frame))
         ? MIN_SAFE_WINDOW_HEIGHT
         : 2 * MIN_SAFE_WINDOW_HEIGHT);
!   
    if (FRAME_TOP_MARGIN (frame) > 0)
      min_height += FRAME_TOP_MARGIN (frame);
  
--- 2212,2218 ----
      = ((FRAME_MINIBUF_ONLY_P (frame) || ! FRAME_HAS_MINIBUF_P (frame))
         ? MIN_SAFE_WINDOW_HEIGHT
         : 2 * MIN_SAFE_WINDOW_HEIGHT);
! 
    if (FRAME_TOP_MARGIN (frame) > 0)
      min_height += FRAME_TOP_MARGIN (frame);
  
***************
*** 2236,2246 ****
  {
    int fixed_p;
    struct window *c;
!   
    if (!NILP (w->hchild))
      {
        c = XWINDOW (w->hchild);
!       
        if (width_p)
        {
          /* A horiz. combination is fixed-width if all of if its
--- 2236,2246 ----
  {
    int fixed_p;
    struct window *c;
! 
    if (!NILP (w->hchild))
      {
        c = XWINDOW (w->hchild);
! 
        if (width_p)
        {
          /* A horiz. combination is fixed-width if all of if its
***************
*** 2261,2267 ****
    else if (!NILP (w->vchild))
      {
        c = XWINDOW (w->vchild);
!       
        if (width_p)
        {
          /* A vert. combination is fixed-width if one of if its
--- 2261,2267 ----
    else if (!NILP (w->vchild))
      {
        c = XWINDOW (w->vchild);
! 
        if (width_p)
        {
          /* A vert. combination is fixed-width if one of if its
***************
*** 2287,2293 ****
        {
          struct buffer *old = current_buffer;
          Lisp_Object val;
!       
          current_buffer = XBUFFER (w->buffer);
          val = find_symbol_value (Qwindow_size_fixed);
          current_buffer = old;
--- 2287,2293 ----
        {
          struct buffer *old = current_buffer;
          Lisp_Object val;
! 
          current_buffer = XBUFFER (w->buffer);
          val = find_symbol_value (Qwindow_size_fixed);
          current_buffer = old;
***************
*** 2296,2302 ****
          if (!EQ (val, Qunbound))
            {
              fixed_p = !NILP (val);
!             
              if (fixed_p
                  && ((EQ (val, Qheight) && width_p)
                      || (EQ (val, Qwidth) && !width_p)))
--- 2296,2302 ----
          if (!EQ (val, Qunbound))
            {
              fixed_p = !NILP (val);
! 
              if (fixed_p
                  && ((EQ (val, Qheight) && width_p)
                      || (EQ (val, Qwidth) && !width_p)))
***************
*** 2309,2315 ****
        if (!fixed_p && check_siblings_p && WINDOWP (w->parent))
        {
          Lisp_Object child;
!         
          for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev)
            if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
              break;
--- 2309,2315 ----
        if (!fixed_p && check_siblings_p && WINDOWP (w->parent))
        {
          Lisp_Object child;
! 
          for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev)
            if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
              break;
***************
*** 2328,2334 ****
  
    return fixed_p;
  }
!   
  
  /* Return the minimum size of window W, not taking fixed-width windows
     into account.  WIDTH_P non-zero means return the minimum width,
--- 2328,2334 ----
  
    return fixed_p;
  }
! 
  
  /* Return the minimum size of window W, not taking fixed-width windows
     into account.  WIDTH_P non-zero means return the minimum width,
***************
*** 2342,2353 ****
  {
    struct window *c;
    int size;
!   
    if (!NILP (w->hchild))
      {
        c = XWINDOW (w->hchild);
        size = 0;
!       
        if (width_p)
        {
          /* The min width of a horizontal combination is
--- 2342,2353 ----
  {
    struct window *c;
    int size;
! 
    if (!NILP (w->hchild))
      {
        c = XWINDOW (w->hchild);
        size = 0;
! 
        if (width_p)
        {
          /* The min width of a horizontal combination is
***************
*** 2374,2380 ****
      {
        c = XWINDOW (w->vchild);
        size = 0;
!       
        if (width_p)
        {
          /* The min width of a vertical combination is
--- 2374,2380 ----
      {
        c = XWINDOW (w->vchild);
        size = 0;
! 
        if (width_p)
        {
          /* The min width of a vertical combination is
***************
*** 2433,2447 ****
      fixed_p = 0;
    else
      fixed_p = window_fixed_size_p (w, width_p, 1);
!   
    if (fixed)
      *fixed = fixed_p;
!   
    if (fixed_p)
      size = width_p ? XFASTINT (w->width) : XFASTINT (w->height);
    else
      size = window_min_size_1 (w, width_p);
!       
    return size;
  }
  
--- 2433,2447 ----
      fixed_p = 0;
    else
      fixed_p = window_fixed_size_p (w, width_p, 1);
! 
    if (fixed)
      *fixed = fixed_p;
! 
    if (fixed_p)
      size = width_p ? XFASTINT (w->width) : XFASTINT (w->height);
    else
      size = window_min_size_1 (w, width_p);
! 
    return size;
  }
  
***************
*** 2470,2476 ****
  
    check_min_window_sizes ();
    size = max (0, size);
!   
    /* If the window has been "too small" at one point,
       don't delete it for being "too small" in the future.
       Preserve it as long as that is at all possible.  */
--- 2470,2476 ----
  
    check_min_window_sizes ();
    size = max (0, size);
! 
    /* If the window has been "too small" at one point,
       don't delete it for being "too small" in the future.
       Preserve it as long as that is at all possible.  */
***************
*** 2495,2501 ****
        min_size = width_p ? MIN_SAFE_WINDOW_WIDTH : MIN_SAFE_WINDOW_HEIGHT;
        else
        min_size = width_p ? window_min_width : window_min_height;
!       
        if (size < min_size)
        {
          delete_window (window);
--- 2495,2501 ----
        min_size = width_p ? MIN_SAFE_WINDOW_WIDTH : MIN_SAFE_WINDOW_HEIGHT;
        else
        min_size = width_p ? window_min_width : window_min_height;
! 
        if (size < min_size)
        {
          delete_window (window);
***************
*** 2547,2557 ****
        for (child = *forward; !NILP (child); child = c->next, ++nchildren)
        {
          int child_size;
!         
          c = XWINDOW (child);
          child_size = width_p ? XINT (c->width) : XINT (c->height);
          total += child_size;
!         
          if (window_fixed_size_p (c, width_p, 0))
            {
              fixed_size += child_size;
--- 2547,2557 ----
        for (child = *forward; !NILP (child); child = c->next, ++nchildren)
        {
          int child_size;
! 
          c = XWINDOW (child);
          child_size = width_p ? XINT (c->width) : XINT (c->height);
          total += child_size;
! 
          if (window_fixed_size_p (c, width_p, 0))
            {
              fixed_size += child_size;
***************
*** 2576,2582 ****
        for (child = *forward; !NILP (child); child = c->next)
        {
          int new_size, old_size;
!         
          c = XWINDOW (child);
          old_size = width_p ? XFASTINT (c->width) : XFASTINT (c->height);
          new_size = old_size;
--- 2576,2582 ----
        for (child = *forward; !NILP (child); child = c->next)
        {
          int new_size, old_size;
! 
          c = XWINDOW (child);
          old_size = width_p ? XFASTINT (c->width) : XFASTINT (c->height);
          new_size = old_size;
***************
*** 2594,2600 ****
              new_size = old_size + each + extra;
              extra = 0;
            }
!         
          /* Set new height.  Note that size_window also propagates
             edge positions to children, so it's not a no-op if we
             didn't change the child's size.  */
--- 2594,2600 ----
              new_size = old_size + each + extra;
              extra = 0;
            }
! 
          /* Set new height.  Note that size_window also propagates
             edge positions to children, so it's not a no-op if we
             didn't change the child's size.  */
***************
*** 2607,2613 ****
  
        /* We should have covered the parent exactly with child windows.  */
        xassert (size == last_pos - first_pos);
!       
        /* Now delete any children that became too small.  */
        if (!nodelete_p)
        for (child = *forward; !NILP (child); child = c->next)
--- 2607,2613 ----
  
        /* We should have covered the parent exactly with child windows.  */
        xassert (size == last_pos - first_pos);
! 
        /* Now delete any children that became too small.  */
        if (!nodelete_p)
        for (child = *forward; !NILP (child); child = c->next)
***************
*** 2779,2785 ****
  
  /* Note that selected_window can be nil
     when this is called from Fset_window_configuration.  */
!  
  static Lisp_Object
  select_window_1 (window, recordflag)
       register Lisp_Object window;
--- 2779,2785 ----
  
  /* Note that selected_window can be nil
     when this is called from Fset_window_configuration.  */
! 
  static Lisp_Object
  select_window_1 (window, recordflag)
       register Lisp_Object window;
***************
*** 2862,2870 ****
  {
    Lisp_Object frame = XWINDOW (window)->frame;
    FRAME_PTR f = XFRAME (frame);
!   
    FRAME_SAMPLE_VISIBILITY (f);
!   
    if (!EQ (frame, selected_frame))
      {
        if (FRAME_ICONIFIED_P (f))
--- 2862,2870 ----
  {
    Lisp_Object frame = XWINDOW (window)->frame;
    FRAME_PTR f = XFRAME (frame);
! 
    FRAME_SAMPLE_VISIBILITY (f);
! 
    if (!EQ (frame, selected_frame))
      {
        if (FRAME_ICONIFIED_P (f))
***************
*** 2872,2878 ****
        else if (FRAME_VISIBLE_P (f))
        Fraise_frame (frame);
      }
!   
    return window;
  }
  
--- 2872,2878 ----
        else if (FRAME_VISIBLE_P (f))
        Fraise_frame (frame);
      }
! 
    return window;
  }
  
***************
*** 2908,2914 ****
        return XCDR (car);
      }
    return Qnil;
! }  
  
  DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0,
         doc: /* Returns non-nil if a new buffer named BUFFER-NAME would use 
the same window.
--- 2908,2914 ----
        return XCDR (car);
      }
    return Qnil;
! }
  
  DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0,
         doc: /* Returns non-nil if a new buffer named BUFFER-NAME would use 
the same window.
***************
*** 3011,3017 ****
      XSETFASTINT (tem, 0);
    else
      XSETFRAME (tem, last_nonminibuf_frame);
!   
    window = Fget_buffer_window (buffer, tem);
    if (!NILP (window)
        && (NILP (not_this_window) || !EQ (window, selected_window)))
--- 3011,3017 ----
      XSETFASTINT (tem, 0);
    else
      XSETFRAME (tem, last_nonminibuf_frame);
! 
    window = Fget_buffer_window (buffer, tem);
    if (!NILP (window)
        && (NILP (not_this_window) || !EQ (window, selected_window)))
***************
*** 3418,3424 ****
    return XFASTINT (p->width);
  }
  
!       
  #define CURBEG(w) \
    *(widthflag ? &(XWINDOW (w)->left) : &(XWINDOW (w)->top))
  
--- 3418,3424 ----
    return XFASTINT (p->width);
  }
  
! 
  #define CURBEG(w) \
    *(widthflag ? &(XWINDOW (w)->left) : &(XWINDOW (w)->top))
  
***************
*** 3461,3479 ****
      {
        p = XWINDOW (window);
        parent = p->parent;
!       
        if (NILP (parent))
        {
          if (widthflag)
            error ("No other window to side of this one");
          break;
        }
!       
        if (widthflag
          ? !NILP (XWINDOW (parent)->hchild)
          : !NILP (XWINDOW (parent)->vchild))
        break;
!       
        window = parent;
      }
  
--- 3461,3479 ----
      {
        p = XWINDOW (window);
        parent = p->parent;
! 
        if (NILP (parent))
        {
          if (widthflag)
            error ("No other window to side of this one");
          break;
        }
! 
        if (widthflag
          ? !NILP (XWINDOW (parent)->hchild)
          : !NILP (XWINDOW (parent)->vchild))
        break;
! 
        window = parent;
      }
  
***************
*** 3563,3581 ****
                {
                  if (this_one > delta)
                    this_one = delta;
!                 
                  (*setsizefun) (next, (*sizefun) (next) - this_one, 0);
                  (*setsizefun) (window, XINT (*sizep) + this_one, 0);
  
                  delta -= this_one;
                }
!             
              next = XWINDOW (next)->next;
            }
!         
          if (delta == 0)
            break;
!         
          if (!preserve_before && ! NILP (prev))
            {
              int this_one = ((*sizefun) (prev)
--- 3563,3581 ----
                {
                  if (this_one > delta)
                    this_one = delta;
! 
                  (*setsizefun) (next, (*sizefun) (next) - this_one, 0);
                  (*setsizefun) (window, XINT (*sizep) + this_one, 0);
  
                  delta -= this_one;
                }
! 
              next = XWINDOW (next)->next;
            }
! 
          if (delta == 0)
            break;
! 
          if (!preserve_before && ! NILP (prev))
            {
              int this_one = ((*sizefun) (prev)
***************
*** 3585,3599 ****
                {
                  if (this_one > delta)
                    this_one = delta;
!                 
                  first_affected = prev;
!                 
                  (*setsizefun) (prev, (*sizefun) (prev) - this_one, 0);
                  (*setsizefun) (window, XINT (*sizep) + this_one, 0);
  
                  delta -= this_one;
                }
!             
              prev = XWINDOW (prev)->prev;
            }
        }
--- 3585,3599 ----
                {
                  if (this_one > delta)
                    this_one = delta;
! 
                  first_affected = prev;
! 
                  (*setsizefun) (prev, (*sizefun) (prev) - this_one, 0);
                  (*setsizefun) (window, XINT (*sizep) + this_one, 0);
  
                  delta -= this_one;
                }
! 
              prev = XWINDOW (prev)->prev;
            }
        }
***************
*** 3657,3663 ****
  
             The function size_window will compute the new height h'
             of the window from delta1 as:
!            
             e = delta1/n
             x = delta1 - delta1/n * n for the 1st resizable child
             h' = h + e + x
--- 3657,3663 ----
  
             The function size_window will compute the new height h'
             of the window from delta1 as:
! 
             e = delta1/n
             x = delta1 - delta1/n * n for the 1st resizable child
             h' = h + e + x
***************
*** 3665,3675 ****
             where n is the number of children that can be resized.
             We can ignore x by choosing a delta1 that is a multiple of
             n.  We want the height of this window to come out as
!            
             h' = h + delta
  
             So, delta1 must be
!            
             h + e = h + delta
             delta1/n = delta
             delta1 = n * delta.
--- 3665,3675 ----
             where n is the number of children that can be resized.
             We can ignore x by choosing a delta1 that is a multiple of
             n.  We want the height of this window to come out as
! 
             h' = h + delta
  
             So, delta1 must be
! 
             h + e = h + delta
             delta1/n = delta
             delta1 = n * delta.
***************
*** 3731,3737 ****
      RESTORE_ORIG_SIZES
  };
  
! static int save_restore_orig_size P_ ((struct window *, 
                                         enum save_restore_action));
  
  /* Shrink windows rooted in window W to HEIGHT.  Take the space needed
--- 3731,3737 ----
      RESTORE_ORIG_SIZES
  };
  
! static int save_restore_orig_size P_ ((struct window *,
                                         enum save_restore_action));
  
  /* Shrink windows rooted in window W to HEIGHT.  Take the space needed
***************
*** 3773,3779 ****
        int last_top;
  
        last_child = Qnil;
!       
        /* Find the last child.  We are taking space from lowest windows
         first, so we iterate over children from the last child
         backwards.  */
--- 3773,3779 ----
        int last_top;
  
        last_child = Qnil;
! 
        /* Find the last child.  We are taking space from lowest windows
         first, so we iterate over children from the last child
         backwards.  */
***************
*** 3784,3790 ****
        for (child = last_child; delta && !NILP (child); child = c->prev)
        {
          int this_one;
!         
          c = XWINDOW (child);
          this_one = XFASTINT (c->height) - MIN_SAFE_WINDOW_HEIGHT;
  
--- 3784,3790 ----
        for (child = last_child; delta && !NILP (child); child = c->prev)
        {
          int this_one;
! 
          c = XWINDOW (child);
          this_one = XFASTINT (c->height) - MIN_SAFE_WINDOW_HEIGHT;
  
***************
*** 3814,3820 ****
     If ACTION is CHECK_ORIG_SIZES, check if orig_top and orig_height
     members are valid for all windows in the window tree.  Value is
     non-zero if they are valid.
!    
     If ACTION is SAVE_ORIG_SIZES, save members top and height in
     orig_top and orig_height for all windows in the tree.
  
--- 3814,3820 ----
     If ACTION is CHECK_ORIG_SIZES, check if orig_top and orig_height
     members are valid for all windows in the window tree.  Value is
     non-zero if they are valid.
! 
     If ACTION is SAVE_ORIG_SIZES, save members top and height in
     orig_top and orig_height for all windows in the tree.
  
***************
*** 3840,3846 ****
          if (!save_restore_orig_size (XWINDOW (w->vchild), action))
            success_p = 0;
        }
!       
        switch (action)
        {
        case CHECK_ORIG_SIZES:
--- 3840,3846 ----
          if (!save_restore_orig_size (XWINDOW (w->vchild), action))
            success_p = 0;
        }
! 
        switch (action)
        {
        case CHECK_ORIG_SIZES:
***************
*** 3885,3894 ****
  {
    struct frame *f = XFRAME (w->frame);
    struct window *root;
!   
    xassert (MINI_WINDOW_P (w));
    xassert (delta >= 0);
!          
    /* Check values of window_min_width and window_min_height for
       validity.  */
    check_min_window_sizes ();
--- 3885,3894 ----
  {
    struct frame *f = XFRAME (w->frame);
    struct window *root;
! 
    xassert (MINI_WINDOW_P (w));
    xassert (delta >= 0);
! 
    /* Check values of window_min_width and window_min_height for
       validity.  */
    check_min_window_sizes ();
***************
*** 3904,3910 ****
           min_height.  */
        delta = max (0, XFASTINT (root->height) - min_height);
      }
!     
    if (delta)
      {
        /* Save original window sizes and positions, if not already done.  */
--- 3904,3910 ----
           min_height.  */
        delta = max (0, XFASTINT (root->height) - min_height);
      }
! 
    if (delta)
      {
        /* Save original window sizes and positions, if not already done.  */
***************
*** 3919,3925 ****
        w->height = make_number (XFASTINT (w->height) + delta);
        XSETFASTINT (w->last_modified, 0);
        XSETFASTINT (w->last_overlay_modified, 0);
!       
        adjust_glyphs (f);
      }
  }
--- 3919,3925 ----
        w->height = make_number (XFASTINT (w->height) + delta);
        XSETFASTINT (w->last_modified, 0);
        XSETFASTINT (w->last_overlay_modified, 0);
! 
        adjust_glyphs (f);
      }
  }
***************
*** 4085,4091 ****
    int vscrolled = 0;
  
    SET_TEXT_POS_FROM_MARKER (start, w->start);
!   
    /* If PT is not visible in WINDOW, move back one half of
       the screen.  Allow PT to be partially visible, otherwise
       something like (scroll-down 1) with PT in the line before
--- 4085,4091 ----
    int vscrolled = 0;
  
    SET_TEXT_POS_FROM_MARKER (start, w->start);
! 
    /* If PT is not visible in WINDOW, move back one half of
       the screen.  Allow PT to be partially visible, otherwise
       something like (scroll-down 1) with PT in the line before
***************
*** 4099,4105 ****
        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
        it.current_y = it.last_visible_y;
        move_it_vertically (&it, - window_box_height (w) / 2);
!       
        /* The function move_iterator_vertically may move over more than
         the specified y-distance.  If it->w is small, e.g. a
         mini-buffer window, we may end up in front of the window's
--- 4099,4105 ----
        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
        it.current_y = it.last_visible_y;
        move_it_vertically (&it, - window_box_height (w) / 2);
! 
        /* The function move_iterator_vertically may move over more than
         the specified y-distance.  If it->w is small, e.g. a
         mini-buffer window, we may end up in front of the window's
***************
*** 4207,4215 ****
         window-scroll-functions.  */
        w->force_start = Qt;
      }
!   
    it.current_y = it.vpos = 0;
!   
    /* Preserve the screen position if we must.  */
    if (preserve_y >= 0)
      {
--- 4207,4215 ----
         window-scroll-functions.  */
        w->force_start = Qt;
      }
! 
    it.current_y = it.vpos = 0;
! 
    /* Preserve the screen position if we must.  */
    if (preserve_y >= 0)
      {
***************
*** 4250,4256 ****
          /* Save our position, in case it's correct.  */
          charpos = IT_CHARPOS (it);
          bytepos = IT_BYTEPOS (it);
!       
          /* See if point is on a partially visible line at the end.  */
          move_it_by_lines (&it, 1, 1);
          if (it.current_y > it.last_visible_y)
--- 4250,4256 ----
          /* Save our position, in case it's correct.  */
          charpos = IT_CHARPOS (it);
          bytepos = IT_BYTEPOS (it);
! 
          /* See if point is on a partially visible line at the end.  */
          move_it_by_lines (&it, 1, 1);
          if (it.current_y > it.last_visible_y)
***************
*** 4584,4590 ****
    Lisp_Object result;
    int hscroll;
    struct window *w = XWINDOW (selected_window);
!   
    if (NILP (arg))
      XSETFASTINT (arg, window_internal_width (w) - 2);
    else
--- 4584,4590 ----
    Lisp_Object result;
    int hscroll;
    struct window *w = XWINDOW (selected_window);
! 
    if (NILP (arg))
      XSETFASTINT (arg, window_internal_width (w) - 2);
    else
***************
*** 4614,4620 ****
    Lisp_Object result;
    int hscroll;
    struct window *w = XWINDOW (selected_window);
!   
    if (NILP (arg))
      XSETFASTINT (arg, window_internal_width (w) - 2);
    else
--- 4614,4620 ----
    Lisp_Object result;
    int hscroll;
    struct window *w = XWINDOW (selected_window);
! 
    if (NILP (arg))
      XSETFASTINT (arg, window_internal_width (w) - 2);
    else
***************
*** 4622,4628 ****
  
    hscroll = XINT (w->hscroll) - XINT (arg);
    result = Fset_window_hscroll (selected_window, make_number (hscroll));
!   
    if (interactive_p (0))
      w->min_hscroll = w->hscroll;
  
--- 4622,4628 ----
  
    hscroll = XINT (w->hscroll) - XINT (arg);
    result = Fset_window_hscroll (selected_window, make_number (hscroll));
! 
    if (interactive_p (0))
      w->min_hscroll = w->hscroll;
  
***************
*** 4754,4760 ****
        {
          struct it it;
          struct text_pos pt;
!         
          SET_TEXT_POS (pt, PT, PT_BYTE);
          start_display (&it, w, pt);
          move_it_vertically (&it, - window_box_height (w) / 2);
--- 4754,4760 ----
        {
          struct it it;
          struct text_pos pt;
! 
          SET_TEXT_POS (pt, PT, PT_BYTE);
          start_display (&it, w, pt);
          move_it_vertically (&it, - window_box_height (w) / 2);
***************
*** 4766,4772 ****
          struct it it;
          struct text_pos pt;
          int y0, y1, h, nlines;
!         
          SET_TEXT_POS (pt, PT, PT_BYTE);
          start_display (&it, w, pt);
          y0 = it.current_y;
--- 4766,4772 ----
          struct it it;
          struct text_pos pt;
          int y0, y1, h, nlines;
! 
          SET_TEXT_POS (pt, PT, PT_BYTE);
          start_display (&it, w, pt);
          y0 = it.current_y;
***************
*** 4783,4789 ****
             the end of the buffer, count in some empty lines.  */
          if (it.vpos < nlines)
            y1 += (nlines - it.vpos) * CANON_Y_UNIT (it.f);
!         
          h = window_box_height (w) - (y1 - y0);
  
          start_display (&it, w, pt);
--- 4783,4789 ----
             the end of the buffer, count in some empty lines.  */
          if (it.vpos < nlines)
            y1 += (nlines - it.vpos) * CANON_Y_UNIT (it.f);
! 
          h = window_box_height (w) - (y1 - y0);
  
          start_display (&it, w, pt);
***************
*** 4808,4814 ****
        arg = make_number (ht / 2);
        else if (XINT (arg) < 0)
        arg = make_number (XINT (arg) + ht);
!       
        pos = *vmotion (PT, - XINT (arg), w);
        charpos = pos.bufpos;
        bytepos = pos.bytepos;
--- 4808,4814 ----
        arg = make_number (ht / 2);
        else if (XINT (arg) < 0)
        arg = make_number (XINT (arg) + ht);
! 
        pos = *vmotion (PT, - XINT (arg), w);
        charpos = pos.bufpos;
        bytepos = pos.bytepos;
***************
*** 4817,4830 ****
    /* Set the new window start.  */
    set_marker_both (w->start, w->buffer, charpos, bytepos);
    w->window_end_valid = Qnil;
!   
    w->optional_new_start = Qt;
  
    if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n')
      w->start_at_line_beg = Qt;
    else
      w->start_at_line_beg = Qnil;
!   
    set_buffer_internal (obuf);
    return Qnil;
  }
--- 4817,4830 ----
    /* Set the new window start.  */
    set_marker_both (w->start, w->buffer, charpos, bytepos);
    w->window_end_valid = Qnil;
! 
    w->optional_new_start = Qt;
  
    if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n')
      w->start_at_line_beg = Qt;
    else
      w->start_at_line_beg = Qnil;
! 
    set_buffer_internal (obuf);
    return Qnil;
  }
***************
*** 5000,5006 ****
  
    frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
    f = XFRAME (frame);
!   
    /* If f is a dead frame, don't bother rebuilding its window tree.
       However, there is other stuff we should still try to do below.  */
    if (FRAME_LIVE_P (f))
--- 5000,5006 ----
  
    frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
    f = XFRAME (frame);
! 
    /* If f is a dead frame, don't bother rebuilding its window tree.
       However, there is other stuff we should still try to do below.  */
    if (FRAME_LIVE_P (f))
***************
*** 5057,5063 ****
        FRAME_WINDOW_SIZES_CHANGED (f) = 1;
  
        /* Problem: Freeing all matrices and later allocating them again
!        is a serious redisplay flickering problem.  What we would 
         really like to do is to free only those matrices not reused
         below.   */
        root_window = XWINDOW (FRAME_ROOT_WINDOW (f));
--- 5057,5063 ----
        FRAME_WINDOW_SIZES_CHANGED (f) = 1;
  
        /* Problem: Freeing all matrices and later allocating them again
!        is a serious redisplay flickering problem.  What we would
         really like to do is to free only those matrices not reused
         below.   */
        root_window = XWINDOW (FRAME_ROOT_WINDOW (f));
***************
*** 5192,5198 ****
        set_marker_restricted (XWINDOW (data->current_window)->pointm,
                               make_number (old_point),
                               XWINDOW (data->current_window)->buffer);
!                 
        Fselect_window (data->current_window);
        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
        = selected_window;
--- 5192,5198 ----
        set_marker_restricted (XWINDOW (data->current_window)->pointm,
                               make_number (old_point),
                               XWINDOW (data->current_window)->buffer);
! 
        Fselect_window (data->current_window);
        XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
        = selected_window;
***************
*** 5231,5244 ****
          if (NILP (leaf_windows[i]->buffer))
            {
              /* Assert it's not reused as a combination.  */
!             xassert (NILP (leaf_windows[i]->hchild) 
                       && NILP (leaf_windows[i]->vchild));
              free_window_matrices (leaf_windows[i]);
            }
          else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
            ++n;
        }
!       
        adjust_glyphs (f);
  
        UNBLOCK_INPUT;
--- 5231,5244 ----
          if (NILP (leaf_windows[i]->buffer))
            {
              /* Assert it's not reused as a combination.  */
!             xassert (NILP (leaf_windows[i]->hchild)
                       && NILP (leaf_windows[i]->vchild));
              free_window_matrices (leaf_windows[i]);
            }
          else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
            ++n;
        }
! 
        adjust_glyphs (f);
  
        UNBLOCK_INPUT;
***************
*** 5314,5320 ****
  }
  
  
! /* Fill vector FLAT with leaf windows under W, starting at index I.  
     Value is last index + 1.  */
  
  static int
--- 5314,5320 ----
  }
  
  
! /* Fill vector FLAT with leaf windows under W, starting at index I.
     Value is last index + 1.  */
  
  static int
***************
*** 5329,5335 ****
        i = get_leaf_windows (XWINDOW (w->hchild), flat, i);
        else if (!NILP (w->vchild))
        i = get_leaf_windows (XWINDOW (w->vchild), flat, i);
!       else 
        flat[i++] = w;
  
        w = NILP (w->next) ? 0 : XWINDOW (w->next);
--- 5329,5335 ----
        i = get_leaf_windows (XWINDOW (w->hchild), flat, i);
        else if (!NILP (w->vchild))
        i = get_leaf_windows (XWINDOW (w->vchild), flat, i);
!       else
        flat[i++] = w;
  
        w = NILP (w->next) ? 0 : XWINDOW (w->next);
***************
*** 5541,5547 ****
       XSETFASTINT (left, 0);
    if (INTEGERP (left) && XFASTINT (left) == 0)
      left = Qnil;
!   
    if ((INTEGERP (right) && XINT (right) < 0)
        || (FLOATP (right) && XFLOAT_DATA (right) <= 0))
      XSETFASTINT (right, 0);
--- 5541,5547 ----
       XSETFASTINT (left, 0);
    if (INTEGERP (left) && XFASTINT (left) == 0)
      left = Qnil;
! 
    if ((INTEGERP (right) && XINT (right) < 0)
        || (FLOATP (right) && XFLOAT_DATA (right) <= 0))
      XSETFASTINT (right, 0);
***************
*** 5587,5600 ****
    Lisp_Object result;
    struct frame *f;
    struct window *w;
!   
    if (NILP (window))
      window = selected_window;
    else
      CHECK_WINDOW (window);
    w = XWINDOW (window);
    f = XFRAME (w->frame);
!   
    if (FRAME_WINDOW_P (f))
      result = CANON_Y_FROM_PIXEL_Y (f, -w->vscroll);
    else
--- 5587,5600 ----
    Lisp_Object result;
    struct frame *f;
    struct window *w;
! 
    if (NILP (window))
      window = selected_window;
    else
      CHECK_WINDOW (window);
    w = XWINDOW (window);
    f = XFRAME (w->frame);
! 
    if (FRAME_WINDOW_P (f))
      result = CANON_Y_FROM_PIXEL_Y (f, -w->vscroll);
    else
***************
*** 5613,5632 ****
  {
    struct window *w;
    struct frame *f;
!   
    if (NILP (window))
      window = selected_window;
    else
      CHECK_WINDOW (window);
    CHECK_NUMBER_OR_FLOAT (vscroll);
!   
    w = XWINDOW (window);
    f = XFRAME (w->frame);
  
    if (FRAME_WINDOW_P (f))
      {
        int old_dy = w->vscroll;
!       
        w->vscroll = - CANON_Y_UNIT (f) * XFLOATINT (vscroll);
        w->vscroll = min (w->vscroll, 0);
  
--- 5613,5632 ----
  {
    struct window *w;
    struct frame *f;
! 
    if (NILP (window))
      window = selected_window;
    else
      CHECK_WINDOW (window);
    CHECK_NUMBER_OR_FLOAT (vscroll);
! 
    w = XWINDOW (window);
    f = XFRAME (w->frame);
  
    if (FRAME_WINDOW_P (f))
      {
        int old_dy = w->vscroll;
! 
        w->vscroll = - CANON_Y_UNIT (f) * XFLOATINT (vscroll);
        w->vscroll = min (w->vscroll, 0);
  
***************
*** 5634,5647 ****
         area becomes larger than before.  */
        if (w->vscroll < 0 && w->vscroll < old_dy)
        adjust_glyphs (f);
!       
        /* Prevent redisplay shortcuts.  */
        XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
      }
!   
    return Fwindow_vscroll (window);
  }
!        
  
  /* Call FN for all leaf windows on frame F.  FN is called with the
     first argument being a pointer to the leaf window, and with
--- 5634,5647 ----
         area becomes larger than before.  */
        if (w->vscroll < 0 && w->vscroll < old_dy)
        adjust_glyphs (f);
! 
        /* Prevent redisplay shortcuts.  */
        XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
      }
! 
    return Fwindow_vscroll (window);
  }
! 
  
  /* Call FN for all leaf windows on frame F.  FN is called with the
     first argument being a pointer to the leaf window, and with
***************
*** 5669,5684 ****
       void *user_data;
  {
    int cont;
!   
    for (cont = 1; w && cont;)
      {
        if (!NILP (w->hchild))
        cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data);
        else if (!NILP (w->vchild))
        cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data);
!       else 
        cont = fn (w, user_data);
!       
        w = NILP (w->next) ? 0 : XWINDOW (w->next);
      }
  
--- 5669,5684 ----
       void *user_data;
  {
    int cont;
! 
    for (cont = 1; w && cont;)
      {
        if (!NILP (w->hchild))
        cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data);
        else if (!NILP (w->vchild))
        cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data);
!       else
        cont = fn (w, user_data);
! 
        w = NILP (w->next) ? 0 : XWINDOW (w->next);
      }
  
***************
*** 5701,5707 ****
          && ! NILP (Vminibuf_scroll_window)
          && w == XWINDOW (Vminibuf_scroll_window)))
      freeze_p = NULL;
!   
    w->frozen_window_start_p = freeze_p != NULL;
    return 1;
  }
--- 5701,5707 ----
          && ! NILP (Vminibuf_scroll_window)
          && w == XWINDOW (Vminibuf_scroll_window)))
      freeze_p = NULL;
! 
    w->frozen_window_start_p = freeze_p != NULL;
    return 1;
  }
***************
*** 5740,5746 ****
      wrong_type_argument (Qwindow_configuration_p, c1);
    if (!WINDOW_CONFIGURATIONP (c2))
      wrong_type_argument (Qwindow_configuration_p, c2);
!   
    d1 = (struct save_window_data *) XVECTOR (c1);
    d2 = (struct save_window_data *) XVECTOR (c2);
    sw1 = XVECTOR (d1->saved_windows);
--- 5740,5746 ----
      wrong_type_argument (Qwindow_configuration_p, c1);
    if (!WINDOW_CONFIGURATIONP (c2))
      wrong_type_argument (Qwindow_configuration_p, c2);
! 
    d1 = (struct save_window_data *) XVECTOR (c1);
    d2 = (struct save_window_data *) XVECTOR (c2);
    sw1 = XVECTOR (d1->saved_windows);
***************
*** 5871,5877 ****
  {
    Qwindow_size_fixed = intern ("window-size-fixed");
    staticpro (&Qwindow_size_fixed);
!   
    staticpro (&Qwindow_configuration_change_hook);
    Qwindow_configuration_change_hook
      = intern ("window-configuration-change-hook");
--- 5871,5877 ----
  {
    Qwindow_size_fixed = intern ("window-size-fixed");
    staticpro (&Qwindow_size_fixed);
! 
    staticpro (&Qwindow_configuration_change_hook);
    Qwindow_configuration_change_hook
      = intern ("window-configuration-change-hook");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]