On Mon, Oct 10, 2011 at 7:37 AM, Edward K. Ream <[email protected]> wrote:
> On Sun, Oct 9, 2011 at 8:12 PM, Kent Tenney <[email protected]> wrote:
>
>>>    # 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.
>
> Good catch.
>
> First of all, following the DRY (Don't repeat yourself) principle, we
> need one, and *only* one place to handle the computation of UNL's.
> leoGlobals.py seems like the proper place.  For sure it should be in
> Leo's core.
>
> Let's call the new method g.computeUNL(p,escape=False)
>
>> Are there compelling reasons not use standard notation for UNL?
>> leo://myleofile.leo/root node/child node/target
>
> Hmm.  Imo, a "standard" notation would be based on (the contents of)
> Leo headlines, as is done at present.
>
> In other words, I like the present scheme.  More importantly, UNL's
> are shown in Leo's status line, and I would prefer not to change them:
> the code that computes the UNL in the status line will set
> escape=False.
>
> Provided that "non-visual" UNL's (escape=True) yield valid
> url's/uri's, I suppose it doesn't matter what escape convention you
> use, but that might be a bit too simplistic.
>
> I am always uneasy with messing with slashes, forward and back.  They
> cause considerable trouble in Leo's file code.  Otoh, perhaps escaping
> them might lessen the troubles because the escapes would ensure that
> slashes don't get munged in escape/unescape process.
>
> Another consideration is to choose the simplest, least intrusive,
> escape sequence that could possibly work.

I'm inclined towards one which is legal in a browser location bar.

>
> At present, I'll leave the details to Terry, or whoever wants to work
> on it.  Just be sure that you use a single method to handle the gory
> details, that you don't alter the appearance of UNL's in the status
> line

OK, so g.get_UNL(p) returns "-->" separated components.
aka "status line style"

The question is what does g.get_UNL(p, True) return?

something like:

- prefixes the node UNL with "file:///path/to/file.leo#"
- quotes any URL illegals
- reliably unquotes to status line style


, and that you keep us informed.
>
> Thanks,
>
> 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.

Reply via email to