Copying a node with clone status preserved

50 views
Skip to first unread message

Joon Ro

unread,
Dec 8, 2014, 7:30:09 PM12/8/14
to leo-e...@googlegroups.com
Hi,

I have a node with multiple child nodes, and only some of the child nodes are clones of nodes from other parent. I want to create an exact copy of this node - with clone status of its children preserved. Is this possible? If I just copy and paste it, all children become non clones, and if I clone it, then all children (and the parent) become clones.

Now I'm copying individual childrens separately and it is a pain ..

Best,
Joon

Edward K. Ream

unread,
Dec 9, 2014, 7:10:29 AM12/9/14
to leo-editor
On Mon, Dec 8, 2014 at 6:30 PM, Joon Ro <joonhy...@gmail.com> wrote:
Hi,

I have a node with multiple child nodes, and only some of the child nodes are clones of nodes from other parent. I want to create an exact copy of this node - with clone status of its children preserved. Is this possible? If I just copy and paste it, all children become non clones, and if I clone it, then all children (and the parent) become clones.

​Copy the tree, then do paste-retaining-clones.

Edward

Joon Ro

unread,
Dec 9, 2014, 5:17:40 PM12/9/14
to leo-e...@googlegroups.com
On Tuesday, December 9, 2014 6:10:29 AM UTC-6, Edward K. Ream wrote:

​Copy the tree, then do paste-retaining-clones.


I do not have this option in my context menu (I'm using 5.0 final). Is it a newer functionality? 

-Joon

Joon Ro

unread,
Dec 9, 2014, 5:28:28 PM12/9/14
to leo-e...@googlegroups.com

It seems like `paste-retaining-clones` is just the `Paste Node As Clone` menu item. That is not what I want though - I do not want to make a clone of a node, but make a copy. It's just that I want to make a copy, with retaninig clone status of its children. For example, with

```
Parent - Child 1 (not a clone)
            - Child 2 (a clone of Child 2 from somewhere else)
```

I want to generate another

```
Parent (not a clone) - Child 1 (still not a clone)
                                 - Child 2 (still a clone of Child 2 from somewhere else)
```

not:

```
Parent (a clone of original Parent) - Child 1 (now a clone of the original Child 1)
                                                       - Child 2 (still a clone of Child 2 from somewhere else)
```

Basically generate a deep copy of a node, with clone status of its children retained.

-Joon







 

Edward K. Ream

unread,
Dec 10, 2014, 6:19:42 AM12/10/14
to leo-editor

​It's not the context menu.  You can execute it from the minibuffer:​
 

​<Alt-x>paste-retaining-clones<Return>

or from the outline menu:  Paste Node as Clone.

Edward

Joon Ro

unread,
Dec 10, 2014, 12:10:17 PM12/10/14
to leo-e...@googlegroups.com

Hi Edward,

Thanks again for the reply. But paste-retaining-clones just make a clone, and it is not what I was talking about. I’m not sure if you saw my last email - I’m pasting it here again:

Parent - Child 1 (not a clone)
            - Child 2 (a clone of Child 2 from somewhere else)

I want to generate another

Parent (not a clone) - Child 1 (still not a clone)
                                 - Child 2 (still a clone of Child 2 from somewhere else)

not:

Parent (a clone of original Parent) - Child 1 (now a clone of the original Child 1)

               - Child 2 (still a clone of Child 2 from somewhere else)

Basically I want to generate a deep copy of a node, with clone status of its children retained.

Best,
Joon

Edward K. Ream

unread,
Dec 10, 2014, 12:12:59 PM12/10/14
to leo-editor
On Wed, Dec 10, 2014 at 11:10 AM, Joon Ro <joonhy...@gmail.com> wrote:

​> ​
Basically I want to generate a deep copy of a node, with clone status of its children retained.

​Being a clone is *not* an intrinsic property of a node (vnode).  It depends on the outline in which the vnode is embedded.

Edward

Matt Wilkie

unread,
Dec 10, 2014, 4:44:49 PM12/10/14
to leo-e...@googlegroups.com

On Mon, Dec 8, 2014 at 4:30 PM, Joon Ro <joonhy...@gmail.com> wrote:
Now I'm copying individual childrens separately and it is a pain ..

Sometimes this can be worked around a little more smoothly by creating a temporary organizer node and putting all the children-to-remain-clones in that before copy org-node and-paste-as-clone. So, 2 or 3 steps instead of n*n steps.

I'm curious about what produces the want to copy-but-not-clone only the parent in the first place. I don't think I've had encountered that yet. What are you doing that makes this desirable?


Matt

Joon Ro

unread,
Dec 10, 2014, 5:04:11 PM12/10/14
to leo-e...@googlegroups.com


On Wednesday, December 10, 2014 3:44:49 PM UTC-6, Matt Wilkie wrote:

Sometimes this can be worked around a little more smoothly by creating a temporary organizer node and putting all the children-to-remain-clones in that before copy org-node and-paste-as-clone. So, 2 or 3 steps instead of n*n steps.


Thanks! This is pretty much what I ended up doing.
 
I'm curious about what produces the want to copy-but-not-clone only the parent in the first place. I don't think I've had encountered that yet. What are you doing that makes this desirable?


This would be helpful when one wants to have a templete node for multiple documents that share majority of contents.

For example, let's say I'm making syllabuses for multiple sections of the same course. Then they will share majority of contents, but there will be differences such as class information, class meeting time and exam schedules, etc.

With this particular functionality, I can make a templete, with nodes for both common and non-common contents, and then make the nodes for the common contents clones.
For each class, I can just make a deep copy of the template, and edit non-common nodes.

But it seems currently I cannot do this. So I ended up puttting the common contents into one parent node as you said, and manually generate other nodes. Which is not ideal because 1) you have to do quite a few reorganization of the nodes if you did not plan the structure beforehand, and 2) you still have to manually generate non-clone nodes.

-Joon


Matt Wilkie

unread,
Dec 10, 2014, 5:36:06 PM12/10/14
to leo-e...@googlegroups.com
Thanks for the scenario. You might find the approach of using <<named sections>> usable. The best intro at the moment seems to be http://leoeditor.com/tutorial-programming.html

Also see recent related discussion at https://github.com/leo-editor/leo-editor/issues/109

Matt



--
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+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages