How to operate on a group of nodes?

37 views
Skip to first unread message

F.S.

unread,
Oct 2, 2012, 8:12:35 PM10/2/12
to leo-e...@googlegroups.com
All the standard outline operations only work on a single node. How do I cut, paste, move a group of nodes?
Context: In my mind Leo is perfect for refactoring. So I rewrote a bunch of functions, and tested that they work so now I am ready to move the original nodes into a storage node outside of the source file. I assume this is SOP. But I couldn't move them as a group. Okay I can do it one by one but I wonder why the limitation. Do I need to write a script in order to do this?

F.S.

unread,
Oct 2, 2012, 8:29:12 PM10/2/12
to leo-e...@googlegroups.com
I know this is just a minor gripe. It took me less than 20 seconds to first create a comment node ahead of the group, then move each one of the group into a child of the new node, and then move the new node with all its children to where I want them to be. I spent way more time trying to figure out if group operation is actually doable ... Source code indicates that is just what is intended. I wonder why: something to do with node caching, node file correspondence ... ?

F.S.

unread,
Oct 2, 2012, 8:32:58 PM10/2/12
to leo-e...@googlegroups.com


BTW it is great to be able to move codes in logical units. I knew this is a great way to work with code but actually doing it feels wonderful.

Edward K. Ream

unread,
Oct 4, 2012, 11:20:55 AM10/4/12
to leo-e...@googlegroups.com
On Tue, Oct 2, 2012 at 7:12 PM, F.S. <speec...@gmail.com> wrote:
> All the standard outline operations only work on a single node. How do I
> cut, paste, move a group of nodes?

There are several ways. The easiest, imo, is to use promote/demote:
Create a new node. move nodes to children, move the new node, promote
the nodes, delete the new node. There are many variations on
promote/demote.

Other ways: clone-find-all creates a group of nodes. Or mark nodes
of interest and then use clone-marked-nodes or move-marked-nodes. And
I believe some plugins allow you to group nodes in various ways.

Scripts often "group" nodes by marking them with @something. This is
the visible way. You can also group nodes with uA's. A "group" is
all nodes with a particular kind of uA's.

The way I use for fixing bugs or other projects is to create a
"project node" to hold all nodes of interest, clone the nodes and move
*the clones* them under that project node. This accomplishes two
things:

A. It groups all nodes related to the project in one place, which can
be as permanent as you like.

B. All changes to any clone affect the original source file. No need
to save files individually.

In short, you can group nodes with promote/demote, marks, clones,
special headlines or uA's. HTH.

Edward

Terry Brown

unread,
Oct 9, 2012, 6:41:58 PM10/9/12
to leo-e...@googlegroups.com
On Tue, 2 Oct 2012 17:12:35 -0700 (PDT)
"F.S." wrote:

> All the standard outline operations only work on a single node. How do I
> cut, paste, move a group of nodes?

The quickmove plugin is also an attempt to address this issue, although
it does (too many?) other things as well. You mark a destination node,
which creates a button, and clicking the button moves the current node
to the start / end of the destination node's children.

Also, the right-click context menu on the tree has a Delete option
which *does* act on all the selected nodes. Multiple nodes can be
selected in the usual mouse based ways (ctrl-click, shift-click).

Cheers -Terry
Reply all
Reply to author
Forward
0 new messages