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: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/src/window.c
Date: Thu, 03 Nov 2005 16:13:58 -0500

Index: emacs/src/window.c
diff -c emacs/src/window.c:1.525 emacs/src/window.c:1.526
*** emacs/src/window.c:1.525    Thu Nov  3 17:11:50 2005
--- emacs/src/window.c  Thu Nov  3 21:13:57 2005
***************
*** 3872,3886 ****
         doc: /* Make current window ARG lines bigger.
  From program, optional second arg non-nil means grow sideways ARG columns.
  Interactively, if an argument is not given, make the window one line bigger.
  
  Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size
  of the siblings above or to the left of the selected window.  Only
  siblings to the right or below are changed.  */)
!      (arg, side, preserve_before)
!      register Lisp_Object arg, side, preserve_before;
  {
    CHECK_NUMBER (arg);
!   enlarge_window (selected_window, XINT (arg), !NILP (side),
                  !NILP (preserve_before));
  
    if (! NILP (Vwindow_configuration_change_hook))
--- 3872,3887 ----
         doc: /* Make current window ARG lines bigger.
  From program, optional second arg non-nil means grow sideways ARG columns.
  Interactively, if an argument is not given, make the window one line bigger.
+ If HORIZONTAL is non-nil, enlarge horizontally instead of vertically.
  
  Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size
  of the siblings above or to the left of the selected window.  Only
  siblings to the right or below are changed.  */)
!      (arg, horizontal, preserve_before)
!      register Lisp_Object arg, horizontal, preserve_before;
  {
    CHECK_NUMBER (arg);
!   enlarge_window (selected_window, XINT (arg), !NILP (horizontal),
                  !NILP (preserve_before));
  
    if (! NILP (Vwindow_configuration_change_hook))
***************
*** 3928,3967 ****
  
  
  #define CURBEG(w) \
!   *(widthflag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line))
  
  #define CURSIZE(w) \
!   *(widthflag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines))
  
  
! /* Enlarge WINDOW by DELTA.  WIDTHFLAG non-zero means
!    increase its width.  Siblings of the selected window are resized to
!    fulfill the size request.  If they become too small in the process,
!    they will be deleted.
  
     If PRESERVE_BEFORE is nonzero, that means don't alter
     the siblings to the left or above WINDOW.  */
  
  static void
! enlarge_window (window, delta, widthflag, preserve_before)
       Lisp_Object window;
!      int delta, widthflag, preserve_before;
  {
    Lisp_Object parent, next, prev;
    struct window *p;
    Lisp_Object *sizep;
    int maximum;
    int (*sizefun) P_ ((Lisp_Object))
!     = widthflag ? window_width : window_height;
    void (*setsizefun) P_ ((Lisp_Object, int, int))
!     = (widthflag ? set_window_width : set_window_height);
  
    /* Check values of window_min_width and window_min_height for
       validity.  */
    check_min_window_sizes ();
  
    /* Give up if this window cannot be resized.  */
!   if (window_fixed_size_p (XWINDOW (window), widthflag, 1))
      error ("Window is not resizable");
  
    /* Find the parent of the selected window.  */
--- 3929,3971 ----
  
  
  #define CURBEG(w) \
!   *(horiz_flag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line))
  
  #define CURSIZE(w) \
!   *(horiz_flag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines))
! 
  
+ /* Enlarge WINDOW by DELTA.
+    HORIZ_FLAG nonzero means enlarge it horizontally;
+    zero means do it vertically.
  
!    Siblings of the selected window are resized to fulfill the size
!    request.  If they become too small in the process, they will be
!    deleted.
  
     If PRESERVE_BEFORE is nonzero, that means don't alter
     the siblings to the left or above WINDOW.  */
  
  static void
! enlarge_window (window, delta, horiz_flag, preserve_before)
       Lisp_Object window;
!      int delta, horiz_flag, preserve_before;
  {
    Lisp_Object parent, next, prev;
    struct window *p;
    Lisp_Object *sizep;
    int maximum;
    int (*sizefun) P_ ((Lisp_Object))
!     = horiz_flag ? window_width : window_height;
    void (*setsizefun) P_ ((Lisp_Object, int, int))
!     = (horiz_flag ? set_window_width : set_window_height);
  
    /* Check values of window_min_width and window_min_height for
       validity.  */
    check_min_window_sizes ();
  
    /* Give up if this window cannot be resized.  */
!   if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1))
      error ("Window is not resizable");
  
    /* Find the parent of the selected window.  */
***************
*** 3972,3983 ****
  
        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;
--- 3976,3987 ----
  
        if (NILP (parent))
        {
!         if (horiz_flag)
            error ("No other window to side of this one");
          break;
        }
  
!       if (horiz_flag
          ? !NILP (XWINDOW (parent)->hchild)
          : !NILP (XWINDOW (parent)->vchild))
        break;
***************
*** 4003,4009 ****
        else
          maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next)
                                         - window_min_size (XWINDOW (p->next),
!                                                           widthflag, 0, 0))
                      : (delta = 0));
        }
      else
--- 4007,4013 ----
        else
          maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next)
                                         - window_min_size (XWINDOW (p->next),
!                                                           horiz_flag, 0, 0))
                      : (delta = 0));
        }
      else
***************
*** 4011,4021 ****
                  /* This is a main window followed by a minibuffer.  */
                  : !NILP (p->next) ? ((*sizefun) (p->next)
                                       - window_min_size (XWINDOW (p->next),
!                                                         widthflag, 0, 0))
                  /* This is a minibuffer following a main window.  */
                  : !NILP (p->prev) ? ((*sizefun) (p->prev)
                                       - window_min_size (XWINDOW (p->prev),
!                                                         widthflag, 0, 0))
                  /* This is a frame with only one window, a minibuffer-only
                     or a minibufferless frame.  */
                  : (delta = 0));
--- 4015,4025 ----
                  /* This is a main window followed by a minibuffer.  */
                  : !NILP (p->next) ? ((*sizefun) (p->next)
                                       - window_min_size (XWINDOW (p->next),
!                                                         horiz_flag, 0, 0))
                  /* This is a minibuffer following a main window.  */
                  : !NILP (p->prev) ? ((*sizefun) (p->prev)
                                       - window_min_size (XWINDOW (p->prev),
!                                                         horiz_flag, 0, 0))
                  /* This is a frame with only one window, a minibuffer-only
                     or a minibufferless frame.  */
                  : (delta = 0));
***************
*** 4027,4033 ****
        delta = maxdelta;
    }
  
!   if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 
0, 0))
      {
        delete_window (window);
        return;
--- 4031,4037 ----
        delta = maxdelta;
    }
  
!   if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), horiz_flag, 
0, 0))
      {
        delete_window (window);
        return;
***************
*** 4040,4050 ****
    maximum = 0;
    for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
      maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
!                                                   widthflag, 0, 0);
    if (! preserve_before)
      for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
        maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
!                                                     widthflag, 0, 0);
  
    /* If we can get it all from them without deleting them, do so.  */
    if (delta <= maximum)
--- 4044,4054 ----
    maximum = 0;
    for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
      maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
!                                                   horiz_flag, 0, 0);
    if (! preserve_before)
      for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
        maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
!                                                     horiz_flag, 0, 0);
  
    /* If we can get it all from them without deleting them, do so.  */
    if (delta <= maximum)
***************
*** 4066,4072 ****
            {
              int this_one = ((*sizefun) (next)
                              - window_min_size (XWINDOW (next),
!                                                widthflag, 0, &fixed_p));
              if (!fixed_p)
                {
                  if (this_one > delta)
--- 4070,4076 ----
            {
              int this_one = ((*sizefun) (next)
                              - window_min_size (XWINDOW (next),
!                                                horiz_flag, 0, &fixed_p));
              if (!fixed_p)
                {
                  if (this_one > delta)
***************
*** 4088,4094 ****
            {
              int this_one = ((*sizefun) (prev)
                              - window_min_size (XWINDOW (prev),
!                                                widthflag, 0, &fixed_p));
              if (!fixed_p)
                {
                  if (this_one > delta)
--- 4092,4098 ----
            {
              int this_one = ((*sizefun) (prev)
                              - window_min_size (XWINDOW (prev),
!                                                horiz_flag, 0, &fixed_p));
              if (!fixed_p)
                {
                  if (this_one > delta)
***************
*** 4191,4200 ****
          int n = 1;
  
          for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
!           if (!window_fixed_size_p (XWINDOW (s), widthflag, 0))
              ++n;
          for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
!           if (!window_fixed_size_p (XWINDOW (s), widthflag, 0))
              ++n;
  
          delta1 = n * delta;
--- 4195,4204 ----
          int n = 1;
  
          for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
!           if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
              ++n;
          for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
!           if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
              ++n;
  
          delta1 = n * delta;




reply via email to

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