On Wed, Mar 25, 2009 at 5:05 PM, Edward K. Ream <[email protected]> wrote:
> Inspired by such sleazy links, I have been wondering if Leo could live > with breakable clone links. Suppose we dispense with gnx's, and > simply use some form of headline searching to resolve clone links. Ctags uses this approach, sort of. Instead of pointing at filename : linenumber pairs (that can break), it uses filename + regex pattern for the line that matches the definition. Something like: myfunc : "^ def myfunc(self):" That link breaks when you insert just one space between beginning of line and def. But that rarely happens. So, the genius "leap" might be - if you are linking to a node geneated from @auto node, do not store the gnx - it's worthless on next load. Use a filename + pattern that matches the first line in the node in the external file (this match is MUCH more accurate than the headline). The "pattern" can just be the string in itself. Now, when you have imported all the auto nodes, you can reconstruct the clones trivially (since we would have implemented a fast lookup dict already when importing. > Blue sky stuff. It might be worth a prototype, though. Not that blue sky, maybe. The concept has already been proven. But, we can rest assured that @thin nodes won't go anywhere anytime soon. @auto and @shadow can reach for the same direction, but they are still "bridge" solutions. Sometimes you just want something rock solid that is not allowed to break at all (where the structure has significant value as well, and it's not trivially deducible), and that's where they step in. BTW - gnx's could still be used for this scheme. We'll just have to add a table that maps file:definition_pattern to gnx's, to allow appointing the same autonode the same gnx on all subsequent runs. -- Ville M. Vainio http://tinyurl.com/vainio --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
