I'm not crazy about using {{sep}} here.  It's not very readable, and it's 
harder to type that a single character. Requiring matched double braces 
also promotes the chance of an unspotted typo. IMO, instead of {{sep}} Leo 
should accept any of the standard path separators and convert them itself 
to whatever platform it's running on.

I found a bug in another project that used "/", and they said that it 
wasn't supposed to be the actual path separator.  But then some downstream 
code treated it as if it were the real separator - and, of course, using 
programs just fed in real paths, not canonicalized ones, leading to failure 
to find the reference file.

So just do the conversion.  It hardly costs any code or processing time.

On Tuesday, March 3, 2020 at 10:18:42 AM UTC-5, jkn wrote:
>
>
>
> On Tuesday, March 3, 2020 at 10:58:42 AM UTC, Edward K. Ream wrote:
>>
>> #1521 <https://github.com/leo-editor/leo-editor/issues/1521> fixes 
>> long-standing bugs with path expressions 
>> <https://leoeditor.com/directives.html#path-expressions> in @clean, 
>> @asis and @shadow nodes.
>>
>> The new code is simpler than before. All unit tests pass, which is a 
>> significant set of tests.
>>
>> However, all changes to Leo's file logic are significant. Please report 
>> any problems immediately.
>>
>> Edward
>>
>
> Thanks Edward - I have possibly-seen issues around this (although with 
> @file rather than the others...),
> I will see if this changes things for me.
>
> One this: the path expressions section you link to mentions using 
> something like:
>
> @file {{c.config.getString('my-dir')}}{{sep}}myFile.py
>
> but is it possible to use environment variables in a similar way?
>
> Actually, I really want to just use the homepage - either
>
> @file {{home}}{{sep}}mydir{{sep}}myFile.py
> or
> @file {{c.config.getEnv('HOME')}}{{sep}}mydir{{sep}}myFile.py
>
> Apologies if something like this already exists - I did look for it...
>
> Thanks, Jon N
>
>
>
>
>

-- 
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/11f7e090-da1a-4905-bfef-71fcd38730e4%40googlegroups.com.

Reply via email to