This post discusses Leo's find commands and their relation to clones and workflow. All comments & questions welcome.
*Executive summary*: - Programming is *almost all about* finding definitions of classes, defs and vars! - Leo's clones may have impeded workflow by making find commands more cumbersome. - The new @bool find-ignores-duplicates setting is a corrective step. - New find-related features "just work" without most people being aware of them. *How did we ever live without find-def & find-var?* As I was developing find-def my attention was drawn to how many times I could have used it. Almost all finds I do could be done with find-def or find-var! This was shocking. Although find-def and find-var a just a *little *more convenient to use, the payoff is significant because: - find-def and find-var start at the start of the outline. No need to select a starting point. - find-def and find-var automatically do word searches, and add "def" or "class" or " =" as needed. - With @bool find-ignores-duplicates = True, *clones no longer slow down searches*! Still to do: ctrl-clicking a word could be a synonym for find-def. *Clones are more useful, and more optional* Clones allow me to avoid finds entirely. The idea is to gather nodes together so that I don't *have *to search. Having said that, being able to find a definition just by placing the cursor on a symbol creates a new workflow that doesn't depend on clones. It quickly becomes second nature. *Benign hidden modes & related hacks* Initial versions of the code tried to do the work of finding *all* definitions in the find-def command itself. Sharing the work between find-def and find-next collapsed the complexity of the code. In effect, various find-related ivars create a *hidden mode* that exists from the time the find-def command starts until find-next fails. Imo, this mode is completely benign. It "just works" without the user being aware that anything unusual is happening. One side effect of using find-def so often was that I often used F3 "by mistake" after Ctrl-F. Now, Leo supports the key bindings for the following commands after hitting Ctrl-F: find-def, find-next, find-prev, find-var. This hack will make Leo work more smoothly without anyone noticing. *Initing Find commands* Ctrl-F (start-search) inits the find pattern to the selected text or the word under the cursor. This behaviour could be called an instance of DWIM: Do What I Mean. It quickly becomes second nature, and is much more convenient than cutting and pasting text into the find pattern. *Summary* The new find code improves Leo's workflow in subtle but significant ways. The find-def and find-var commands are simple minded, but in practice they work well. The present work already works much better with clones, assuming @bool find-ignores-duplicates = True. More experimentation will show whether further improvements are possible. 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 post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
