Leo already handles "~", so we don't need "{{~}}".  When I say "handles", I 
mean it adjusts between Windows and Linux.  We don't need {{sep}} if the 
handling code makes the adjustment for "/" vs "\" automatically.  This 
would be highly desirable anyway because sometimes the best way to get the 
right path is to copy it in the OS's file browser and paste it in directly 
which will insert native path separators.  Changing them all is a pain and 
I find it to be error prone.  And I have sometimes ended up with a mix of 
separator types.  Leo should handle this case automatically, adjusting the 
separators as needed for the OS.

I agree that ".." steps should be handled correctly but I don't see that 
they need to be enclosed in braces.  We should try for maximum readability 
and clarity in the path expressions.

In my experience, the biggest need, apart from the separators, is to adjust 
the path prefix (the entire path up to but not including the file name) 
from one system to another.  This could also involve changing from an 
absolute to a relative path.  Here are some use cases:

1. I send a Leo outline along with its external files (perhaps as one of 
the new Leo archive files!).  The outline uses absolute paths for some 
historical reason, but the outline location and the desired location of the 
external files are different for the new user.  The old @file paths may not 
even be valid on the target system - e.g. c:\tom\devel\leo vs ~/Temp/leo - 
even after the separators have been changed.

2. Similar to 1) but I need to move an outline from Windows to Linux so I 
can test my code on both OSs. 

To me it seems that one capability would be to have conditional 
expressions.  For example:

@clean {windows: c:\tom\devel\llm; linux: ~/Test/leo/llm}/small_llm_1.py

Perhaps we could use Python's string format syntax with a custom formatter.
On Saturday, April 8, 2023 at 8:35:43 AM UTC-4 Edward K. Ream wrote:

> On Saturday, April 8, 2023 at 6:43:24 AM UTC-5 Edward K. Ream wrote:
>
> And combinations of the above:
>
> {{../..}}
> {{~/}}
>
>
> And one more, per g.getBaseDirectory:
>
> {{!}}  # g.app.loadDir.
>
> Imo path expressions probably should be allowed only at the start of 
> filenames. I don't see how they could be useful in other positions.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3e193b8c-a1c3-4517-99a2-062db0a0d9e0n%40googlegroups.com.

Reply via email to