[Top][All Lists]

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

Re: [patch] add interactive browse of revisions from vc *Annotate* buffe

From: Benjamin Rutt
Subject: Re: [patch] add interactive browse of revisions from vc *Annotate* buffers
Date: Tue, 20 Jan 2004 11:45:54 -0500
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v)

Stefan Monnier <address@hidden> writes:

> No.  In Emacs, we use chars rather than lines usually.
> I think his patch should be changed to not use lines but use chars instead,
> so it'll be simpler.  After all, char positions are just as likely to be
> more-or-less correct than line positions.  

I feel that the one time when line positions would be "more correct"
would be when there are only minor changes to a file during successive
revisions.  Then, you'll likely be able to spot what was added or
dropped between revisions by going back (P) and forth (N) a few times,
since the code where the line was on originally will probably move up
or down only a bit.  On the other hand, if we went with char
positions, then how closely the point follows the original line would
not be determined by how many lines were added, but rather the sum of
the lengths of the lines added.

Another drawback of using characters, let's say only a C string was
shortened during a commit, e.g.:  changing "someverylongstring..." to
"hi", then point might change lines even though the total # of lines
in the file didn't change.

> Or you could preserve "relative position in the file" (/ (- (point)
> (point-min)) (- (point-max) (point-min))) instead.

If we went with "relative position in the file", it would likely be
surprising if you were e.g.  browsing revision 1.1 whose annotate
buffer had only 10 lines, and you were on line 2 (still the
"Annotations for foo.c" line), then you browsed forward a few
revisions.  If the file grew a lot by then, all of a sudden you'd be
about 20% into the file, which could be a few hundred lines by that

This discussion brings up another point:  I'd also like to preserve
the column, since the annotate buffer can be very wide (it's usually >
80 columns, even if the original source code is < 80 columns).  If
you've spend the energy to h-scroll to the right, then I don't think I
should make you h-scroll again every time you browse another revision.

reply via email to

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