[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/scroll.c
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/src/scroll.c |
Date: |
Sat, 24 May 2003 18:03:31 -0400 |
Index: emacs/src/scroll.c
diff -c emacs/src/scroll.c:1.28 emacs/src/scroll.c:1.29
*** emacs/src/scroll.c:1.28 Tue Feb 4 09:03:13 2003
--- emacs/src/scroll.c Sat May 24 18:03:31 2003
***************
*** 96,102 ****
int free_at_end;
{
register int i, j;
! int frame_height = FRAME_HEIGHT (frame);
register struct matrix_elt *p, *p1;
register int cost, cost1;
--- 96,102 ----
int free_at_end;
{
register int i, j;
! int frame_lines = FRAME_LINES (frame);
register struct matrix_elt *p, *p1;
register int cost, cost1;
***************
*** 105,122 ****
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
int *first_insert_cost
! = &FRAME_INSERT_COST (frame)[frame_height - 1 - lines_moved];
int *first_delete_cost
! = &FRAME_DELETE_COST (frame)[frame_height - 1 - lines_moved];
int *next_insert_cost
! = &FRAME_INSERTN_COST (frame)[frame_height - 1 - lines_moved];
int *next_delete_cost
! = &FRAME_DELETEN_COST (frame)[frame_height - 1 - lines_moved];
/* Discourage long scrolls on fast lines.
Don't scroll nearly a full frame height unless it saves
at least 1/4 second. */
! int extra_cost = baud_rate / (10 * 4 * FRAME_HEIGHT (frame));
if (baud_rate <= 0)
extra_cost = 1;
--- 105,122 ----
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
int *first_insert_cost
! = &FRAME_INSERT_COST (frame)[frame_lines - 1 - lines_moved];
int *first_delete_cost
! = &FRAME_DELETE_COST (frame)[frame_lines - 1 - lines_moved];
int *next_insert_cost
! = &FRAME_INSERTN_COST (frame)[frame_lines - 1 - lines_moved];
int *next_delete_cost
! = &FRAME_DELETEN_COST (frame)[frame_lines - 1 - lines_moved];
/* Discourage long scrolls on fast lines.
Don't scroll nearly a full frame height unless it saves
at least 1/4 second. */
! int extra_cost = baud_rate / (10 * 4 * FRAME_LINES (frame));
if (baud_rate <= 0)
extra_cost = 1;
***************
*** 438,464 ****
int free_at_end;
{
register int i, j;
! int frame_height = FRAME_HEIGHT (frame);
register struct matrix_elt *p, *p1;
register int cost, cost1, delta;
/* first_insert_cost[-I] is the cost of doing the first insert-line
at a position I lines above the bottom line in the scroll window. */
int *first_insert_cost
! = &FRAME_INSERT_COST (frame)[frame_height - 1];
int *first_delete_cost
! = &FRAME_DELETE_COST (frame)[frame_height - 1];
int *next_insert_cost
! = &FRAME_INSERTN_COST (frame)[frame_height - 1];
int *next_delete_cost
! = &FRAME_DELETEN_COST (frame)[frame_height - 1];
int scroll_overhead;
/* Discourage long scrolls on fast lines.
Don't scroll nearly a full frame height unless it saves
at least 1/4 second. */
! int extra_cost = baud_rate / (10 * 4 * FRAME_HEIGHT (frame));
if (baud_rate <= 0)
extra_cost = 1;
--- 438,464 ----
int free_at_end;
{
register int i, j;
! int frame_lines = FRAME_LINES (frame);
register struct matrix_elt *p, *p1;
register int cost, cost1, delta;
/* first_insert_cost[-I] is the cost of doing the first insert-line
at a position I lines above the bottom line in the scroll window. */
int *first_insert_cost
! = &FRAME_INSERT_COST (frame)[frame_lines - 1];
int *first_delete_cost
! = &FRAME_DELETE_COST (frame)[frame_lines - 1];
int *next_insert_cost
! = &FRAME_INSERTN_COST (frame)[frame_lines - 1];
int *next_delete_cost
! = &FRAME_DELETEN_COST (frame)[frame_lines - 1];
int scroll_overhead;
/* Discourage long scrolls on fast lines.
Don't scroll nearly a full frame height unless it saves
at least 1/4 second. */
! int extra_cost = baud_rate / (10 * 4 * FRAME_LINES (frame));
if (baud_rate <= 0)
extra_cost = 1;
***************
*** 909,915 ****
will not be involved in actual motion. */
int limit = to;
int offset;
! int height = FRAME_HEIGHT (frame);
if (amount == 0)
return 0;
--- 909,915 ----
will not be involved in actual motion. */
int limit = to;
int offset;
! int height = FRAME_LINES (frame);
if (amount == 0)
return 0;
***************
*** 947,957 ****
register int *ov, *mf;
{
register int i;
! register int frame_height = FRAME_HEIGHT (frame);
register int insert_overhead = ov1 * 10;
register int next_insert_cost = ovn * 10;
! for (i = frame_height-1; i >= 0; i--)
{
mf[i] = next_insert_cost / 10;
next_insert_cost += pfn;
--- 947,957 ----
register int *ov, *mf;
{
register int i;
! register int frame_lines = FRAME_LINES (frame);
register int insert_overhead = ov1 * 10;
register int next_insert_cost = ovn * 10;
! for (i = frame_lines-1; i >= 0; i--)
{
mf[i] = next_insert_cost / 10;
next_insert_cost += pfn;
***************
*** 1000,1011 ****
only) and those that must repeatedly insert one line.
The cost to insert N lines at line L is
! [tt.t_ILov + (frame_height + 1 - L) * tt.t_ILpf] +
! N * [tt.t_ILnov + (frame_height + 1 - L) * tt.t_ILnpf]
ILov represents the basic insert line overhead. ILpf is the padding
required to allow the terminal time to move a line: insertion at line
! L changes (frame_height + 1 - L) lines.
The first bracketed expression above is the overhead; the second is
the multiply factor. Both are dependent only on the position at
--- 1000,1011 ----
only) and those that must repeatedly insert one line.
The cost to insert N lines at line L is
! [tt.t_ILov + (frame_lines + 1 - L) * tt.t_ILpf] +
! N * [tt.t_ILnov + (frame_lines + 1 - L) * tt.t_ILnpf]
ILov represents the basic insert line overhead. ILpf is the padding
required to allow the terminal time to move a line: insertion at line
! L changes (frame_lines + 1 - L) lines.
The first bracketed expression above is the overhead; the second is
the multiply factor. Both are dependent only on the position at
***************
*** 1035,1061 ****
{
FRAME_INSERT_COST (frame) =
(int *) xrealloc (FRAME_INSERT_COST (frame),
! FRAME_HEIGHT (frame) * sizeof (int));
FRAME_DELETEN_COST (frame) =
(int *) xrealloc (FRAME_DELETEN_COST (frame),
! FRAME_HEIGHT (frame) * sizeof (int));
FRAME_INSERTN_COST (frame) =
(int *) xrealloc (FRAME_INSERTN_COST (frame),
! FRAME_HEIGHT (frame) * sizeof (int));
FRAME_DELETE_COST (frame) =
(int *) xrealloc (FRAME_DELETE_COST (frame),
! FRAME_HEIGHT (frame) * sizeof (int));
}
else
{
FRAME_INSERT_COST (frame) =
! (int *) xmalloc (FRAME_HEIGHT (frame) * sizeof (int));
FRAME_DELETEN_COST (frame) =
! (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));
}
ins_del_costs (frame,
--- 1035,1061 ----
{
FRAME_INSERT_COST (frame) =
(int *) xrealloc (FRAME_INSERT_COST (frame),
! FRAME_LINES (frame) * sizeof (int));
FRAME_DELETEN_COST (frame) =
(int *) xrealloc (FRAME_DELETEN_COST (frame),
! FRAME_LINES (frame) * sizeof (int));
FRAME_INSERTN_COST (frame) =
(int *) xrealloc (FRAME_INSERTN_COST (frame),
! FRAME_LINES (frame) * sizeof (int));
FRAME_DELETE_COST (frame) =
(int *) xrealloc (FRAME_DELETE_COST (frame),
! FRAME_LINES (frame) * sizeof (int));
}
else
{
FRAME_INSERT_COST (frame) =
! (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));
FRAME_DELETEN_COST (frame) =
! (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));
FRAME_INSERTN_COST (frame) =
! (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));
FRAME_DELETE_COST (frame) =
! (int *) xmalloc (FRAME_LINES (frame) * sizeof (int));
}
ins_del_costs (frame,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/scroll.c,
Kim F. Storm <=