[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ediff highlighting bug fix
From: |
Simon Liddington |
Subject: |
Re: ediff highlighting bug fix |
Date: |
Tue, 3 Jul 2001 10:41:57 +0100 (BST) |
On Mon, 2 Jul 2001, Kevin Rodgers wrote:
> Simon Liddington wrote:
> > I traced the problem and found that the priority for the overlay was
> > becoming very large and then negative. This was due to two things.
> >
> > 1) ediff-highest-priority was adding together all the overlay priorities
> > for the diff region not just giving a max value.
> ...
> > * ediff-init.el (ediff-highest-priority): Returns 1 + max of all
> > overlay priorities not 1 + sum of all overlay priorities.
>
> Nice work. But can I ask why you effectively do
>
> (1+ (nth 0 (sort ... '>)))
>
> instead of
>
> (1+ (apply 'max ...))
>
> That greatly simplifies the patch, since it's just a matter of replacing
> `+' with `max'.
>
> (I say effectively, since you actually used a series of `setq's -- yuck :-)
It's just that I'm not that used to lisp (particularly lists - I 1st
tried to do max on the list itself!!) and actually started off by
doing something quite different and then ended up simplifying it as I
got it to work. As you might expect it converged with the original
code except I didn't spot the final simplification you suggest. Though
my brain must have been processing it in the background because I did
wonder whether max would work with apply yesterday (when I was out
sailing actually!!!).
I tried just changing + for max and checked it still worked which it
did but I spotted that the priority was still increasing. This time it
is due to the fine diffs being calculated before unselecting the old
and selecting the new diff. I also spotted a bug in
ediff-unselect-difference (see Changelog).
So, new patches are attached and here's the extra Changlog entry:
2001-07-03 Simon Liddington <sjl@zepler.org>
* ediff-util.el (ediff-next-difference,ediff-previous-difference):
Turn off fine diffs after calculating so that overlay priority
does not keep increasing.
* ediff-util.el (ediff-unselect-difference): Fixed unhighlight of
fine diffs to unhighlight requested diff (was current diff).
-----------------------------------------------------------------------
| Simon Liddington | Tel (home): +44 23 8023 7935 |
| sjl@zepler.org | Tel (work): +44 23 8068 3521 |
-----------------------------------------------------------------------
ediff-init.el.patch
Description: Text document
ediff-util.el.patch
Description: Text document