Thanks for this tutorial, Edward! Long time ago I stopped using clone-find-* commands because I need to use @clean nodes. Cloning of @clean nodes is a really bad idea - one who is brave enough to use can suddenly (just after saving the .leo project) discover unwanted files somewhere in the filesystem and other artifacts. So as a matter of fact, it is good to use cf* commands with plain .leo or @file nodes.
ср, 23 сент. 2020 г. в 17:07, Edward K. Ream <[email protected]>: > The clone find commands are one of Leo's killer features. This post will > get you up to speed in a hurry. > > Suppose you want to find all the calls to a method (or ivar) x. Use the *cff > *(clone-find-flattened) command: > > <Alt-x>cff<return> prompts you for a search pattern in the minibuffer. > Enter the search pattern. You can change search settings while entering the > pattern. See the second post script. > > When you hit <return> the cff command creates an organizer node as the > last top-level node of the outline. This organizer node contains a clone of > every node containing a match of the search pattern. > > That's all! > > "What's the big deal?", you ask. The big deal is: > > 1. You now have *live* (cloned) nodes containing all the matches. > Changing any of the cloned nodes changes *all* of the cloned nodes. > > 2. You can keep the organizer node as long as you like. The organizer node > is a record of your researches. > > 3. Most importantly, you can *organize* the cloned nodes. For example, > you can create a node called "not likely to be significant" and move some > of the clones so they are children of that node. Or you can just delete > nodes that aren't likely to be significant :-) > > *Summary* > > The clone find commands allow you to see how classes, methods or ivars are > used. > > You can organize the results of these commands as you see fit, and keep > the results for as long as you like. > > I use cff commands continually while refactoring code. > > Edward > > P.S. The *cffm *command (clone-find-flattened-marked) doesn't use a > search pattern. Instead, it makes clones of all the marked nodes of an > outline. This is a supremely simple way of "gathering" nodes. Just mark > any set of nodes you like, then do <Alt-x cffm<return>. > > P.P.S While entering the search pattern, you can change search settings > with shortcuts that start with Alt-Ctrl: > > - Alt-Ctrl-B: toggle search bodies. > - Alt-Ctrl-E: search the entire outline. > - Alt-Ctrl-H: toggle search headlines. > - Alt-Ctrl-I: toggle Ignore-case. > - Alt-Ctrl-N: search selected node only. > - Alt-Ctrl-S: search only the selected outline. > - Alt-Ctrl-W: toggle whole-word. > - Alt-Ctrl-X: toggle regex mode. > > You did know about these shortcuts, didn't you? > > EKR > > -- > 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/2a00cbf8-ec78-4b89-a35a-9f89dc4b4906o%40googlegroups.com > <https://groups.google.com/d/msgid/leo-editor/2a00cbf8-ec78-4b89-a35a-9f89dc4b4906o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAC%2B8SVyYNUKU3qPJyRNpZdz6F2k6LPO58BiqnOKsuJgy064NsQ%40mail.gmail.com.
