On 5/27/20, vitalije <vitali...@gmail.com> wrote:
> @Differance
>
> On Wednesday, May 27, 2020 at 11:56:57 AM UTC+2, Differance wrote:
>>
>> Couldn't a paste-as-template just traverse the tree and make new
>> clones where they already are clones and just copy as new nodes
>> everywhere else?
>>
>> Might it be an easy enough rule to say that:
>
> It is easier said than done. When you copy an outline part, Leo stores on
> the clipboard selected nodes along with their gnx fields. When pasting
> those gnx fields can be re-assigned to new values (when doing an ordinary
> paste command) or they can be left unchanged (when doing
> paste-retaining-clones). Nodes for which all clone instances are inside the
> copied tree have all the information (required to keep them as clones of
> each other) inside the clipboard content. However, nodes that have clones
> outside the copied outline have parents that the clipboard content doesn't
> know at all. Therefore some required information is lost. The
> paste-as-template command will have hard time to distinguish which of these
> nodes should be retained and which should be re-instantiated.


See my suggested template-with-encapsulated-clones vs
template-with-global-clones suggestion I just put on one of Edward's
comments.  It seems to me that "encapsulating" means make a new vnode
for all sets of more than one clone-node within the tree that point to
the same vnode.  The alternative is about not worrying about what
vnode they link to, just make a new clone that's "global."

I don't fully follow the details you're giving, but I also think
there's some sort of attempt to figure out logic based on tree
structure, with parent nodes, how many places they are in the outline,
considering the original node, etc., at work in your description of
the problem.

Speaking roughly, I think regardless of the structure of the tree
you've put in the clipboard, you can identify some that are clones of
each other within the tree -- can't you look at vnodes to see the
clones?  Then generate a new vnode for those sets of nodes pointing at
the same vnode, regardless of where and how many other places nodes
linked to that vnode occur in the leo outline?

This pair of template operations seems to be a good conceptual
approach to giving users the ability to take charge of how they want
the cloning to happen.

Sounds like the clipboard copy is built from gnx's and doesn't have
immediate info regarding vnodes.  But surely the vnodes can be
identified.  Then isn't the complexity eliminated?

I will read you more carefully to see whether I'm missing something.
Might it be simpler than you think?  Anyway, I'll pipe up again if I
get a better clue and find it necessary to straighten myself out.  :-)


Seth

> It is not possible to use just the gnx value to distinguish which nodes
> were previously clones because all of the copied nodes might have the
> original node still present in the outline or in the undo data and every
> node will look like it should be cloned.
>
> It isn't possible either to just use the number of parents of the existing
> nodes to see if they should be retained because children of clones don't
> need to have more than one parent node, but they still can be found on
> several places in the outline and therefore they should be cloned.
>
> Using marked bit of each node can help to simplify this task of
> distinguishing which nodes should retain their identity and which should
> not.
>
> Vitalije
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/eae72108-af6e-48a2-879e-43672a5614b4%40googlegroups.com.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAJkfFBwjDqbgJVdC5Z9gL0SFmEMZK__nn4oFXEd3%3D6emwk9_3Q%40mail.gmail.com.

Reply via email to