On Wed, Jun 10, 2009 at 10:31 PM, Ville M. Vainio<[email protected]> wrote:

> You'll add that functionality to archivedPosition and
> resolveArchivedPosition ;-)
>
> I'd do it myself, but I'm probably done with coding today (it's late &
> slept only ~ 4 hours last night, that's why my mails are gibberish
> today). Or, I can add it tomorrow if you are busy w/ other defects.

I worked on this a bit, then realized how futile this halfway measure
is. Let's do a "proper" fix after 4.6 (which breaks compatibility).

Here's my idea for the proper fix.

- The problem: find position for a node, while storing gnx's. The
problem is that because of clones, same tnode can be reached from
multiple paths (and therefore there are multiple positions for it).

- Solution 1: gnx1.gnx2.gnxX (tracing the whole path from root to position)
  - Drawback - verbose.
  - Scripts-->@thin leoScripts.txt-->Prototypes-->pos_to_archive, archive_to_pos

Solution 2: finding the minimal description of the position

- Find all tnodes with gnxX
- Walk up the tree each of them, lock-stepped (from leaves towards root)
- When the "wanted" path has unique gnx, append it to archived position.

So basically, if the whole path was

gnx1 -> gnx2 -> gnx3 ->gnx4 ->gnx5

The archived representation could be gnx5.gnx2. (if gnx 4, gnx3 were
same on all paths leading to node).

Solution 3: HASHES!

- store gnx5 + hash of (gnx1 + gnx2 + gnx3 + gnx4).
- Find all nodes with gnx5
- check all paths leading to it, pick one where hash matches.

-- 
Ville M. Vainio
http://tinyurl.com/vainio

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to