~ubuntu-branches/debian/sid/emacs24/sid

« back to all changes in this revision

Viewing changes to src/scroll.c

  • Committer: Package Import Robot
  • Author(s): Rob Browning
  • Date: 2014-10-25 14:37:43 UTC
  • mfrom: (13.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20141025143743-m9q5reoyyyjq3p2h
Tags: 24.4+1-4
Update emacsen-common dependency as per policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Calculate what line insertion or deletion to do, and do it
2
2
 
3
 
Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2013 Free Software
 
3
Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2014 Free Software
4
4
Foundation, Inc.
5
5
 
6
6
This file is part of GNU Emacs.
86
86
   new contents appears.  */
87
87
 
88
88
static void
89
 
calculate_scrolling (FRAME_PTR frame,
 
89
calculate_scrolling (struct frame *frame,
90
90
                     /* matrix is of size window_size + 1 on each side.  */
91
91
                     struct matrix_elt *matrix,
92
92
                     int window_size, int lines_below,
246
246
  struct matrix_elt *p;
247
247
  int i, j, k;
248
248
 
249
 
  /* Set to 1 if we have set a terminal window with
250
 
     set_terminal_window.  It's unsigned to work around GCC bug 48228.  */
251
 
  unsigned int terminal_window_p = 0;
 
249
  /* True if we have set a terminal window with set_terminal_window.  */
 
250
  bool terminal_window_p = 0;
252
251
 
253
252
  /* A queue for line insertions to be done.  */
254
253
  struct queue { int count, pos; };
423
422
   is the equivalent of draw_cost for the old line contents */
424
423
 
425
424
static void
426
 
calculate_direct_scrolling (FRAME_PTR frame,
 
425
calculate_direct_scrolling (struct frame *frame,
427
426
                            /* matrix is of size window_size + 1 on each side.  */
428
427
                            struct matrix_elt *matrix,
429
428
                            int window_size, int lines_below,
653
652
 
654
653
  /* A queue of deletions and insertions to be performed.  */
655
654
  struct alt_queue { int count, pos, window; };
656
 
  struct alt_queue *queue_start = (struct alt_queue *)
657
 
    alloca (window_size * sizeof *queue_start);
 
655
  struct alt_queue *queue_start = alloca (window_size * sizeof *queue_start);
658
656
  struct alt_queue *queue = queue_start;
659
657
 
660
 
  /* Set to 1 if a terminal window has been set with
661
 
     set_terminal_window: */
662
 
  int terminal_window_p = 0;
 
658
  /* True if a terminal window has been set with set_terminal_window.  */
 
659
  bool terminal_window_p = 0;
663
660
 
664
 
  /* A nonzero value of write_follows indicates that a write has been
665
 
     selected, allowing either an insert or a delete to be selected
666
 
     next.  When write_follows is zero, a delete cannot be selected
 
661
  /* If true, a write has been selected, allowing either an insert or a
 
662
     delete to be selected next.  If false, a delete cannot be selected
667
663
     unless j < i, and an insert cannot be selected unless i < j.
668
664
     This corresponds to a similar restriction (with the ordering
669
665
     reversed) in calculate_direct_scrolling, which is intended to
670
666
     ensure that lines marked as inserted will be blank. */
671
 
  int write_follows_p = 1;
 
667
  bool write_follows_p = 1;
672
668
 
673
669
  /* For each row in the new matrix what row of the old matrix it is.  */
674
670
  int *copy_from = alloca (window_size * sizeof *copy_from);
796
792
 
797
793
 
798
794
void
799
 
scrolling_1 (FRAME_PTR frame, int window_size, int unchanged_at_top,
 
795
scrolling_1 (struct frame *frame, int window_size, int unchanged_at_top,
800
796
             int unchanged_at_bottom, int *draw_cost, int *old_draw_cost,
801
797
             int *old_hash, int *new_hash, int free_at_end)
802
798
{
803
 
  struct matrix_elt *matrix;
804
 
  matrix = ((struct matrix_elt *)
805
 
            alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
 
799
  struct matrix_elt *matrix
 
800
    = alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix);
806
801
 
807
802
  if (FRAME_SCROLL_REGION_OK (frame))
808
803
    {
886
881
   overhead and multiply factor values */
887
882
 
888
883
static void
889
 
line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn,
 
884
line_ins_del (struct frame *frame, int ov1, int pf1, int ovn, int pfn,
890
885
              register int *ov, register int *mf)
891
886
{
892
887
  register int i;
904
899
}
905
900
 
906
901
static void
907
 
ins_del_costs (FRAME_PTR frame,
 
902
ins_del_costs (struct frame *frame,
908
903
               const char *one_line_string, const char *multi_string,
909
904
               const char *setup_string, const char *cleanup_string,
910
905
               int *costvec, int *ncostvec,
960
955
 */
961
956
 
962
957
void
963
 
do_line_insertion_deletion_costs (FRAME_PTR frame,
 
958
do_line_insertion_deletion_costs (struct frame *frame,
964
959
                                  const char *ins_line_string,
965
960
                                  const char *multi_ins_string,
966
961
                                  const char *del_line_string,