From xemacs-m  Tue Jan  7 20:16:02 1997
Received: from corona.pixar.com (corona.pixar.com [138.72.20.84])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with SMTP
	  id UAA07477; Tue, 7 Jan 1997 20:16:01 -0600 (CST)
Received: by corona.pixar.com (Smail3.1.29.1 #2)
	id m0vhnWf-00015jC; Tue, 7 Jan 97 18:13 PST
Sender: retnuh@pixar.com (Hunter Kelly)
Sender: retnuh@corona
To: Chuck Thompson <cthomp@xemacs.org>
Cc: greg@alphatech.com, xemacs-beta@xemacs.org (XEmacs beta list)
Subject: Re: scrollbars
References: <199701080122.TAA07173@xemacs.cs.uiuc.edu>
Mime-Version: 1.0 (generated by tm-edit 7.100)
Content-Type: text/plain; charset=US-ASCII
From: Hunter Kelly <retnuh@corona.pixar.com>
Date: 07 Jan 1997 18:13:56 -0800
In-Reply-To: Chuck Thompson's message of Tue, 07 Jan 1997 19:22:31 -0600
Message-ID: <yvtn2uk6hi3.fsf@corona.pixar.com>
Lines: 34
X-Mailer: Red Gnus v0.79/XEmacs 19.15

Chuck Thompson <cthomp@xemacs.org> writes:
>     Greg> Something that's always bugged me is that it seems the size
>     Greg> of the scrollbar and the scrolling are based on character
>     Greg> positions instead of lines.
> 
> Emacs / XEmacs is not a line based editor.  Period.  If it was
> scrollbars would have never been anything but line based in the first
> place.  Probably.
> 
> It is actually fairly easily to implement (at first look) if you
> either don't care about performance or run XEmacs on a Cray.  It is
> not quite as trivial as it looks at a glance since they should really
> be based on the number of display lines, not the number of newlines.
> With variable height lines and variable width characters that becomes
> difficult to do.  Something like the Motif text widget is easy.  Keep
> a running count of the number of lines and an additional counter which
> is incremented for each line wrap which is always easily calculatable
> since it is always caused by the same number of characters.

Hmmm.  What I'm about to suggest is obviously not "correct", but it
may be close enough to make most people happy.  Couldn't we do
something like figure out the number of newlines, and then make some
kind of guess at the average height of each line?  This will obviously
make buffers with many different size fonts scroll a little funny, but
it already scrolls a little funny.  And I would hazard a guess that
over 90% of the time, people are editing text in very similarly sized
fonts, if not the same font.

Would doing the above still be too much of a performance hit?
Any comments?

> 			-Chuck

Hunter

