emacs-diffs
[Top][All Lists]
Advanced

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

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


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

Index: emacs/src/scroll.c
diff -c emacs/src/scroll.c:1.27 emacs/src/scroll.c:1.28
*** emacs/src/scroll.c:1.27     Thu Nov 14 09:16:14 2002
--- emacs/src/scroll.c  Tue Feb  4 09:03:13 2003
***************
*** 232,244 ****
  /* Perform insert-lines and delete-lines operations on CURRENT_MATRIX
     according to the costs in MATRIX, using the general scrolling
     method that is used if the terminal does not support the setting of
!    scroll windows (scroll_region_ok == 0).  
  
     WINDOW_SIZE is the number of lines being considered for scrolling
     and UNCHANGED_AT_TOP is the vpos of the first line being
     considered.  These two arguments can specify any contiguous range
     of lines.  */
!  
  static void
  do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
       struct glyph_matrix *current_matrix;
--- 232,244 ----
  /* Perform insert-lines and delete-lines operations on CURRENT_MATRIX
     according to the costs in MATRIX, using the general scrolling
     method that is used if the terminal does not support the setting of
!    scroll windows (scroll_region_ok == 0).
  
     WINDOW_SIZE is the number of lines being considered for scrolling
     and UNCHANGED_AT_TOP is the vpos of the first line being
     considered.  These two arguments can specify any contiguous range
     of lines.  */
! 
  static void
  do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
       struct glyph_matrix *current_matrix;
***************
*** 258,264 ****
    struct queue *queue_start
      = (struct queue *) alloca (current_matrix->nrows * sizeof (struct queue));
    struct queue *queue = queue_start;
!   
    char *retained_p = (char *) alloca (window_size * sizeof (char));
    int *copy_from = (int *) alloca (window_size * sizeof (int));
  
--- 258,264 ----
    struct queue *queue_start
      = (struct queue *) alloca (current_matrix->nrows * sizeof (struct queue));
    struct queue *queue = queue_start;
! 
    char *retained_p = (char *) alloca (window_size * sizeof (char));
    int *copy_from = (int *) alloca (window_size * sizeof (int));
  
***************
*** 283,289 ****
    while (i > 0 || j > 0)
      {
        p = matrix + i * (window_size + 1) + j;
!       
        if (p->insertcost < p->writecost && p->insertcost < p->deletecost)
        {
          /* Insert should be done at vpos i-1, plus maybe some before.
--- 283,289 ----
    while (i > 0 || j > 0)
      {
        p = matrix + i * (window_size + 1) + j;
! 
        if (p->insertcost < p->writecost && p->insertcost < p->deletecost)
        {
          /* Insert should be done at vpos i-1, plus maybe some before.
***************
*** 365,371 ****
            }
        }
        while (queue > queue_start);
!         
      }
  
    for (k = 0; k < window_size; ++k)
--- 365,371 ----
            }
        }
        while (queue > queue_start);
! 
      }
  
    for (k = 0; k < window_size; ++k)
***************
*** 377,383 ****
  
    /* Some sanity checks if GLYPH_DEBUG != 0.  */
    CHECK_MATRIX (current_matrix);
!   
    if (terminal_window_p)
      set_terminal_window (0);
  }
--- 377,383 ----
  
    /* Some sanity checks if GLYPH_DEBUG != 0.  */
    CHECK_MATRIX (current_matrix);
! 
    if (terminal_window_p)
      set_terminal_window (0);
  }
***************
*** 562,568 ****
                   To reduce the cumulative effects of rounding error, we
                   vary the position at which the difference is computed. */
                cost1 += first_insert_cost[-j] - first_insert_cost[1-j] +
!                 (delta-1) * (next_insert_cost[-j] - next_insert_cost[1-j]); 
              }
            else
              {
--- 562,568 ----
                   To reduce the cumulative effects of rounding error, we
                   vary the position at which the difference is computed. */
                cost1 += first_insert_cost[-j] - first_insert_cost[1-j] +
!                 (delta-1) * (next_insert_cost[-j] - next_insert_cost[1-j]);
              }
            else
              {
***************
*** 570,576 ****
                cost += scroll_overhead + first_delete_cost[-delta] +
                  (delta-1) * (next_delete_cost[-delta] + extra_cost);
                cost1 += first_delete_cost[-i] - first_delete_cost[1-i] +
!                 (delta-1) * ( next_delete_cost[-i] - next_delete_cost[1-i]); 
              }
            if (cost1 < cost)
              {
--- 570,576 ----
                cost += scroll_overhead + first_delete_cost[-delta] +
                  (delta-1) * (next_delete_cost[-delta] + extra_cost);
                cost1 += first_delete_cost[-i] - first_delete_cost[1-i] +
!                 (delta-1) * ( next_delete_cost[-i] - next_delete_cost[1-i]);
              }
            if (cost1 < cost)
              {
***************
*** 641,647 ****
     and UNCHANGED_AT_TOP is the vpos of the first line being
     considered.  These two arguments can specify any contiguous range
     of lines.
!  
     In the direct scrolling method, a new scroll window is selected
     before each insertion or deletion, so that groups of lines can be
     scrolled directly to their final vertical positions.  This method
--- 641,647 ----
     and UNCHANGED_AT_TOP is the vpos of the first line being
     considered.  These two arguments can specify any contiguous range
     of lines.
! 
     In the direct scrolling method, a new scroll window is selected
     before each insertion or deletion, so that groups of lines can be
     scrolled directly to their final vertical positions.  This method
***************
*** 701,711 ****
       without also decrementing i, this corresponds to omitting these
       lines in the new rows, i.e. rows are deleted.  */
    i = j = window_size;
!   
    while (i > 0 || j > 0)
      {
        p = cost_matrix + i * (window_size + 1) + j;
!       
        if (p->insertcost < p->writecost
          && p->insertcost < p->deletecost
          && (write_follows_p || i < j))
--- 701,711 ----
       without also decrementing i, this corresponds to omitting these
       lines in the new rows, i.e. rows are deleted.  */
    i = j = window_size;
! 
    while (i > 0 || j > 0)
      {
        p = cost_matrix + i * (window_size + 1) + j;
! 
        if (p->insertcost < p->writecost
          && p->insertcost < p->deletecost
          && (write_follows_p || i < j))
***************
*** 717,723 ****
          queue->window = i;
          queue->pos = i - p->insertcount;
          ++queue;
!         
          i -= p->insertcount;
          write_follows_p = 0;
        }
--- 717,723 ----
          queue->window = i;
          queue->pos = i - p->insertcount;
          ++queue;
! 
          i -= p->insertcount;
          write_follows_p = 0;
        }
***************
*** 736,742 ****
             place they belong.  */
          int n_to_write = p->writecount;
          write_follows_p = 1;
!         xassert (n_to_write > 0); 
  
          if (i > j)
            {
--- 736,742 ----
             place they belong.  */
          int n_to_write = p->writecount;
          write_follows_p = 1;
!         xassert (n_to_write > 0);
  
          if (i > j)
            {
***************
*** 822,828 ****
      {
        calculate_direct_scrolling (frame, matrix, window_size,
                                  unchanged_at_bottom,
!                                 draw_cost, old_draw_cost, 
                                  old_hash, new_hash, free_at_end);
        do_direct_scrolling (frame->current_matrix,
                           matrix, window_size, unchanged_at_top);
--- 822,828 ----
      {
        calculate_direct_scrolling (frame, matrix, window_size,
                                  unchanged_at_bottom,
!                                 draw_cost, old_draw_cost,
                                  old_hash, new_hash, free_at_end);
        do_direct_scrolling (frame->current_matrix,
                           matrix, window_size, unchanged_at_top);
***************
*** 1054,1060 ****
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
        FRAME_INSERTN_COST (frame) =
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
!       FRAME_DELETE_COST (frame) = 
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
      }
  
--- 1054,1060 ----
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
        FRAME_INSERTN_COST (frame) =
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
!       FRAME_DELETE_COST (frame) =
        (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
      }
  




reply via email to

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