faster paging in JOVE

Ken Mitchum km at cadre.ARPA
Wed Sep 18 07:45:34 AEST 1985


After a summer off doing what I'm paid to do, I have again returned to Jove.
I have made many changes, which I will try to document on the net at some
point. Here is an easy one you might want:


----------------------------------------------------------------------------

1) The commands "next-page" and "prev-page" work very slowly in the
Jove/msdos as originally written, especially when using the 43 line screen.
The problem is that line inserts/deletes, while being quicker than screen
rewrites in most situations, are actually slower to figure out while moving
to the next page. The real solution is to recode DoIDline() in disp.c.
However, the following kludge works just as well, and takes little brains:

   A) Partway through DoIDline() in disp.c, replace the following lines:


	if (!CanScroll)
		CanScroll =1;
		return;		/* We should never have been called! */


	with:

	if (!CanScroll) {
#ifndef UNIX		
		CanScroll =1;
#endif		
		return;		/* We should never have been called! */
	}

	B) Replace the functions NextPage() and PrevPage() in draw.c with
these versions:

NextPage()
{
	LINE	*newline;

	if (exp_p)
		UpScroll();
	else {
		newline = next_line(curwind->w_top, curwind->w_height +
			curwind->w_height/3);
		curwind->w_line = newline;
		DotTo(newline, 0);
#ifndef UNIX
		CanScroll = 0;
#endif
	}
}

PrevPage()
{
	LINE	*newline;

	if (exp_p)
		DownScroll();
	else {
		newline = prev_line(curwind->w_top, curwind->w_height/3);
		curwind->w_line = newline;
		DotTo(newline, 0);
#ifndef UNIX
		CanScroll = 0;
#endif
	}
}

---------------------------------------------------------------------

2) I have rewritten "temp.c" and am in the process of extending Jove's
line storage to a virtual scheme using both memory and a tempfile. The
result requires more memory, but is faster, particularly when using Jove
with a floppy-based system. In addition, there is no code from "vi"
involved. I will post information on this in the future.


  -Ken Mitchum
  (km at cadre.arpa)



More information about the Comp.sources.unix mailing list