On Sun, Oct 9, 2011 at 9:06 PM, Terry Brown <[email protected]> wrote: > On Sun, 9 Oct 2011 20:12:30 -0500 > Kent Tenney <[email protected]> wrote: > >> On Wed, Sep 7, 2011 at 6:19 AM, Edward K. Ream <[email protected]> wrote: >> > On Mon, Aug 8, 2011 at 9:27 AM, Kent Tenney <[email protected]> wrote: >> >> Howdy, >> >> >> >> Is there an easier way to get a node [UNL] than to iterate through >> >> parents? >> > >> > This discussion is amusing. Almost all such questions can be >> > researched by doing a few searches. Here, my first thought was be to >> > discover how UNL's are already computed. Searching for UNL (word >> > search) I found the following: >> > >> > Plugins-->Commands & directives-->@file quickMove.py-->class >> > quickMoveButton-->computeUNL >> > >> > This plugin isn't always enabled, so I looked in Leo's core: >> > >> > Code-->Gui base classes-->@file leoFrame.py-->class >> > leoTree-->leoTree.select & helpers-->selectHelper >> > >> > # what UNL.py used to do >> > c.frame.clearStatusLine() >> > c.frame.putStatusLine("-->".join(reversed( >> > [i.h for i in p.self_and_parents()]))) >> >> This returns an incorrect UNL if there is a "-->" in the headline. >> Are there compelling reasons not use standard notation for UNL? >> leo://myleofile.leo/root node/child node/target >> >> slashes in headlines would need escaping, as --> does now. > > Hmm, --> are old, not sure where they came from. > > It seems to me that / in a headline is more likely than -->, although > obviously both occur often enough to be problematic. / more often than > --> though.
I've never used either, more likely to need / than -->. As with file names, not too onerous to consider special characters. Filenames make some chars illegal, we wouldn't do that (would we?) > > Slashes are problematic because you can't easily tell where the file > path ends and the node path starts. You could test each component to > find where the file is, i.e. > it's /dir/dir/dir/dir/dir/file/node/node/node/node, as opposed to urls > which are some.domain.name/path/path/path > > Hmm, probably > > protocol:some.domain.name:port/filepath/filepath/filepath#nodepath/nodepath/nodepath > > would be the most urlesque, '#' is the normal 'fragment' identifier. > But that's basically what we have now, except the slashes instead of > --> in the fragment part. Doh! I didn't recognize where your use of "#" came from maybe forget the leo:// part, an address could be standard using file:///path/to/leo/file.leo#/root node/child node/Considering "/" as a separator I've been playing with combinations of urllib.quote, .quote_plus, .quote_plus, .unquote_plus but it's not clear how best to leverage them > > The most important thing is to make sure the needed escaping > occurs. I guess we could support both schemes, / escaped would be %2F, > and --> could be --%3E or possibly -->, but I think --%3E makes more > sense. I don't think we should need both, if Leo settled on get_UNL "officially", we work with that. Does Leo use UNLs beyond the status line? Thanks, Kent > > I'll try and fix the escaping, introducing / as an alternative (or > replacement?) probably needs wider discussion. > > Cheers -Terry > >> >> I like the orthogonality of slashes as separators. >> >> Thanks, >> Kent >> > >> > Had the helpful comment not been present, I could have found the code >> > by looking for calls to putStatusLine. >> > >> > Edward >> > >> > -- >> > 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. >> > >> > >> > > -- > 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. > > -- 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.
