On Sat, Apr 8, 2023 at 8:01 AM Thomas Passin <[email protected]> wrote:
Leo already handles "~", so we don't need "{{~}}".
Hmm. You are probably right.
> We don't need {{sep}} if the handling code makes the adjustment for "/" vs
> "\" automatically.
This is the dreaded g.os_path_normslashes. We have to be extremely careful
about this issue. The draft PR #3264
<https://github.com/leo-editor/leo-editor/pull/3264> supports only '/'
within path expressions, and then only to separate '..' items, so I *think*
the draft is good.
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.
The PR would be broken if you had to change any of your existing outlines
that *don't* already use path expressions.
> I agree that ".." steps should be handled correctly but I don't see that
> they need to be enclosed in braces.
>
Another hmm. It seems like a great idea and I'm not sure exactly what Leo
already does.
We should try for maximum readability and clarity in the path expressions.
>
As long as we don't break existing outlines!
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.
>
Exactly. That's all the PR allows.
> 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
>
Let's get the basics working first.
This kind of hack is why I suggested writing scripts as a workaround.
Thomas, please review the PR. Thanks.
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2xi91-8ueenRPA6wCgzC2FaZnrsia%3DVDM%2B_n3M27%2BcMA%40mail.gmail.com.