On Wed, May 27, 2020 at 12:56 AM John Clark <[email protected]> wrote:
I'm going to assume you made a typo in your reference to A2, because A2 is > not involved in the proposed clone-preserving copy-and-paste. > Right. I meant A1 and A3. > Nevertheless, I think a further expansion on my original example is in > order, this time including nodes that are cloned internally to the source > tree to facilitate discussion of that case. I'll use different naming to > avoid confusion. > > Suppose I start with this: > > Node X > + Node X1 > + Node X2 > + Node X3 > > > I then build a new tree, called Node Y, with some children that are unique > and some that are clones of the children of Node X, resulting in the tree > as shown below. Note I've put comments in to clearly identify the clones. > We could call Node Y our "template": > > Node X > + Node X1 > + Node X2 > + Node X3 > Node Y > + Node Y1 # an "internal" clone of Y1 below > + Node Y2 > + Node Y1 # an "internal" clone of Y1 above > + Node Y3 > + Node X3 # an "external" clone of X3 which is under Node X > > Now I've built my "template", rooted at Node Y, I want to put it to use by > making a "copy preserving clones" of it. Now, as you rightly note, here > arises the question of what to do about clones that are purely local to the > source node. I've thought about it in the sense of the templating use case, > and this is what I believe the behaviour should be: > > Node X > + Node X1 > + Node X2 > + Node X3 > Node Y > + Node Y1 # an "internal" clone of Y1 below > + Node Y2 > + Node Y1 # an "internal" clone of Y1 above > + Node Y3 > + Node X3 # an "external" clone of X3 which is under Node X > Node Y > + Node Y1 # a copy, but an internal clone of Node Y1 (below) > + Node Y2 # a copy > + Node Y1 # a copy, but an internal clone of Node Y1 (above) > + Node Y3 # a copy > + Node X3 # an "external" clone of X3 which is under Node X > > > For brevity, I denote clones that are internal to the source tree only as > "local clones". In the templating use case, I think there's a strong case > to be made for NOT linking local clones under the source node in the the > copied tree. Doing so allows provisioning of clones internally in the > source "template" that define content that is shared around the children of > the template, but is likely to be different in deployments (copies) of that > template. > > I hope that makes sense. > Yes, that makes sense to me. It's a bit different from either of the two options I gave, but that shouldn't matter. It should be doable. Note: depending on where (and how!) you copy node Y, the external clone of X3 might not turn out to be a clone. This will happen if you don't copy Y to the original outline, but rather to an outline that doesn't contain a node X3 with the same gnx as the copied node X3. Edward -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3NRF3brXppvDBNYsx4PvF1n3OHsByKOKhUOJ72XEPvLQ%40mail.gmail.com.
