On Tue, Jul 02, 2013 at 01:15:47PM +0200, Abd? Roig-Maranges wrote:
Hi Abd?,
First of all, thanks for the time you've taken for further improving things
after my comments.
Post by Abdó Roig-MarangesPost by Marwan TanagerBisection and the jumplist are just entirely unrelated
No they are not. The state during bisection (lower and upper bound) are stored
as the last two jumps before current in the jumplist.
When I said that bisection and the jumplist mechanism are unrelated, I did that
in the sense that they are there for entirely different and unrelated purposes.
The fact that the bisection code can be hacked to take advantage from the info
on the jumplist is a different story.
Post by Abdó Roig-MarangesPost by Marwan TanagerI don't think that it's a good idea to change the jumplist internal data
structure as a side effect of bisection, it just doesn't make sense.
In yesterday's patch I did not touch your improved jumplist. I just change two
lines in the bisection code (sc_bisect) and exposed zathura_jumplist_save (to
rewrite jumps in sc_bisect). I'm going an other route with the attached patches,
though.
I know you haven't changed the jumplist code, and I wouldn't be upset if you
have. My only objection is with the perceived inconsistency that the user
would experience as a result of your change. Just because it makes life easier
for the developer, is not a good excuse for introducing behavioral
inconsistencies to the user. All the user cares about in an application like
this, is just the way things look and feel.
Post by Abdó Roig-MarangesPost by Marwan TanagerAFAICS, nothing is broken as far as bisection itself is concerned
Your jumplist code is fine (I did not touch it beside from exposing
zathura_jumplist_save). What was broken was the middle case in the bisection
code (lines 859 and 886 in shortcuts.c). The problem is related to this bisect
-1 ......... 0 .........-2 .....................
Here pages increase from left to right and the numbers represent jumps (0 is
current jump).
Bisecting to the right with the broken bisect (the one after your jumplist code)
would lead to
-2 ........ -1 .........-3 .....0.................
This case (and its mirror, jumping left) are the only troublesome cases.
The thing is that the bisection code uses the jumplist to keep the lower and
^^^^
Post by Abdó Roig-Marangesupper bounds of the current bisect step as the last two jumps in the jumplist. I
didn't want to add a new "bisect mode" with more state...
Also I like the idea that bisect always uses the last two jumps as there is no
need for a "bisect initialization" telling zathura the initial bounds.
This explains it all, and this is exactly the point that I don't agree with you
on. The problem lies in that you piggyback your bisection code on top of the
jumplist code and tries to tailor it for serving bisecting which is beyond it's
scope. Think of the jumplist as just an _abstract_ mechanism that acts as a
_recorder_ for the user jumps during the session, regardless of the actions
that resulted in those jumps.
Post by Abdó Roig-MarangesThere are two ways to make sure the two jumps before current are always the
1. Slightly rewrite history as done in the first patch I sent yesterday.
2. Insert new jumps when needed, as done in the attached patches.
I would prefer it to be done in some third way that doesn't depend on changing
the jumplist contents.
Post by Abdó Roig-MarangesI agree that loosing history is bad. The attached patches do not loose jump
history, but they mess a little with jump order (inserts a jump before last from
time to time).
In the case above
-1 ......... 0 .........-2 .....................
Bisecting to the right from 0 will now lead to
-2
-3 ......... -1 ....0....-4 .......................
It just inserts the upper bound before the current jump in the jump history and
then bisects. This way, the -1 and -2 jumps after a bisect step are still the
bounds for the bisection algorithm.
Like I said above, I think it would be better to just make things work right
without depending on the jumplist. If there is no other way, though, then I
think it would be OK to do it this way, as a last resort.
Quite frankly, Abd?, the only thing I agree with you the most in this second
patch, is that you made zathura_jumplist_save static back again. It was just
looking horrible when it was exposed :-) (doesn't make sense at all, and
appears as coming from nowhere)
BTW, I don't have a say in what's included and what's not. This is up to the
project maintainers. I was just expressing my opinion. So, don't feel like
someone is rejecting your patch; this is not mine to say.
--
Marwan