Re: Discuss: remove support for Leo's path expressions

2023-04-08 Thread jkn
I haven't looked at c.expand_path_expression, at least recently - it may be too capable for its own good. But I would definitely want a way to navigate to a given file under different environments, similar to Tom's example. I could live with the headline having to be changed to accommodate a new

Re: Discuss: remove support for Leo's path expressions

2023-04-08 Thread Edward K. Ream
On Fri, Apr 7, 2023 at 8:28 PM Thomas Passin wrote: I'd like to know an easy workaround for *@file > c:\Tom\devel\leo\some-file.py* on Windows but, say, *@file > ~/Leo/outlines/some-file.py.* > Create an @button node that adjusts your @file nodes. Edward -- You received this message because

Re: Discuss: remove support for Leo's path expressions

2023-04-08 Thread Edward K. Ream
On Fri, Apr 7, 2023 at 8:29 PM Félix wrote: I don't see why vscode would not allow me to evaluate parts of those > strings as expected by this feature, as I already have support of scripting > , including offereing g, c, p etc. available in the scope of the running > scripts. Many years ago Pau

Re: Discuss: remove support for Leo's path expressions

2023-04-08 Thread Edward K. Ream
On Fri, Apr 7, 2023 at 9:10 PM Thomas Passin wrote: > I was thinking the same. After all, leointeg or leojs could parse > headlines and do something with the results. What might make sense - > both for security and for both Leo and leojs - would be to write a small > number of methods that wo

Re: Discuss: remove support for Leo's path expressions

2023-04-08 Thread Edward K. Ream
On Sat, Apr 8, 2023 at 5:33 AM jkn wrote: > I haven't looked at c.expand_path_expression, at least recently - it may > be too capable for its own good. But I would definitely want a way to > navigate to a given file under different environments, similar to Tom's > example. > > I could live with t

Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
Recent comments have convinced me that Leo should support *safe* path expressions. I have renamed and rewritten #3260 . At minimum, I suppose the following expressions should be valid: {{~}} # home {{/}} # os.sep {{..}} # parent direc

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Sat, Apr 8, 2023 at 6:39 AM Edward K. Ream wrote: > > At minimum, I suppose the following expressions should be valid: > > {{~}} # home > {{/}} # os.sep > {{..}} # parent directory. > And combinations of the above: {{../..}} {{~/}} Edward -- You received this message because you are su

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
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 use

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 7:35:43 AM UTC-5 Edward K. Ream wrote: 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. In the new scheme path expressions are actually *directory* expressions: - The *default

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
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

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Sat, Apr 8, 2023 at 8:01 AM Thomas Passin 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 extre

Re: VR3 can now be opened in a tab

2023-04-08 Thread jkn
This look interesting, thanks. One thing I have never really needed, but occasionally wondered about; it is possible to *delete* a tab in the log pane? (perhaps it should be called the 'tab pane'?...) J^n On Friday, April 7, 2023 at 3:04:48 PM UTC+1 tbp1...@gmail.com wrote: > The VR3 plug

Re: VR3 can now be opened in a tab

2023-04-08 Thread Thomas Passin
Yes, as long as you know its name, which you do from its label: log.deleteTab(TABNAME) On Saturday, April 8, 2023 at 10:26:30 AM UTC-4 jkn wrote: > This look interesting, thanks. > > One thing I have never really needed, but occasionally wondered about; it > is possible to *delete* a tab in

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 8:01:11 AM UTC-5 tbp1...@gmail.com wrote: Leo already handles "~", so we don't need "{{~}}". Now that I've gathered my wits, let me try to make a simpler response: 1. The new code (PR #3264 ) will be *exactly

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
We definitely need to have a transition strategy so we don't kill anyone's existing outlines. I see two ways to approach this: 1. Only allow certain g. methods, all of which would be new and only used in path expressions. Eventually, only these would be allowed. 2. Current path expressions ca

Re: VR3 can now be opened in a tab

2023-04-08 Thread jkn
I meant at the user level - right-click on a tab or similar... I occasionally have tabs 'outstay their welcome' (as in, I don't need their content any more) On Saturday, April 8, 2023 at 3:28:45 PM UTC+1 tbp1...@gmail.com wrote: > Yes, as long as you know its name, which you do from its label:

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Sat, Apr 8, 2023 at 9:39 AM Thomas Passin wrote: We definitely need to have a transition strategy so we don't kill anyone's > existing outlines. No such strategy is possible. > Maybe it can be enabled by a setting that initially will have the value > True but in later releases defaults to F

Re: Discuss: what should path expressions contain?

2023-04-08 Thread jkn
- shurely '~' is not always needed (if that is what you are saying): I can use {{sep}}home{{sep}}myusername{{sep}}tmp{{sep}}filename.txt , for example - I really hope you don't choose '*' for such a feature. might something like '~~' work? On Saturday, April 8, 2023 at 3:38:04 PM UTC+1 Edward

Re: VR3 can now be opened in a tab

2023-04-08 Thread Thomas Passin
I've been thinking they could be given a close box. I've not looked in to what it would take, though. On Saturday, April 8, 2023 at 10:44:09 AM UTC-4 jkn wrote: > I meant at the user level - right-click on a tab or similar... I > occasionally have tabs 'outstay their welcome' (as in, I don't n

Leo 6.7.3 coming soon

2023-04-08 Thread Edward K. Ream
I shall release Leo 6.7.3 as soon as possible after we test PR #3264 . I urge Félix to release a new version of leoInteg that will require 6.7.3. I am horrified that nobody has noticed the security holes in path expressions and even more horri

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 10:49:03 AM UTC-5 jkn wrote: - I really hope you don't choose '*' for such a feature. What's wrong with *? I'm willing to use any single character. What would you prefer, and why? Edward -- You received this message because you are subscribed to the Google Gr

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
"*" is so widely used as a wildcard for any string that it would be confusing to use it in another way. On Saturday, April 8, 2023 at 2:13:41 PM UTC-4 Edward K. Ream wrote: On Saturday, April 8, 2023 at 10:49:03 AM UTC-5 jkn wrote: - I really hope you don't choose '*' for such a feature. Wha

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 10:49:03 AM UTC-5 jkn wrote: I can use {{sep}}home{{sep}}myusername{{sep}}tmp{{sep}}filename.txt Without understanding the exactly what you want to do, you probably should be able to specify this somehow, either without using path expressions at all, or with some

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 1:17:31 PM UTC-5 tbp1...@gmail.com wrote: "*" is so widely used as a wildcard for any string that it would be confusing to use it in another way. Alright. What *single* character would you prefer? Edward -- You received this message because you are subscribed to

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
The current PR says this: '!' sets the directory to g.app.loadDir. '~' sets the directory to os.path.expanduser('~') '*' sets the directory to os.environ['LEO_BASE_DIRECTORY'] or os.path.expanduser('~') if the environment variable does not exist. 1. I don't see

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
On Saturday, April 8, 2023 at 2:50:01 PM UTC-4 Thomas Passin wrote: Then I could write, for example: @file {{leoDir}}/plugins/new_plugin.py @file ~/.leo/themes/tbp_new_theme.leo # or {{homeLeoDir}}/themes/ tbp_new_theme.leo Well, I wouldn't be having a Leo outline in an @file node, I suppose

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Sat, Apr 8, 2023 at 1:50 PM Thomas Passin wrote: 1. I don't see any need to use the expression "{{~}}". Just using "~" works > now. > Thomas, you have just opened my eyes. Python should do all the work! - os.path.expandvars

Re: Leo 6.7.3 coming soon

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 12:13:36 PM UTC-5 Edward K. Ream wrote: > I shall release Leo 6.7.3 as soon as possible after we test PR #3264 . *Aha* (Thanks, Thomas): Python's os.path module con

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Thomas Passin
Excellent! And if Leo were to export, say, LEODIR, which would be the *leo* directory, then there would not be a need for {leoDir} since one could write something like @file $LEODIR/themes/vr3/rst-dark.css I like it. On Saturday, April 8, 2023 at 5:53:36 PM UTC-4 Edward K. Ream wrote: > On

Re: Discuss: what should path expressions contain?

2023-04-08 Thread Edward K. Ream
On Saturday, April 8, 2023 at 5:52:20 PM UTC-5 tbp1...@gmail.com wrote: Excellent! And if Leo were to export, say, LEODIR, which would be the *leo* directory, then there would not be a need for {leoDir} since one could write something like @file $LEODIR/themes/vr3/rst-dark.css I like it.

PR #3264 is ready for review and testing

2023-04-08 Thread Edward K. Ream
PR #3264 fixes a security blunder by eliminating support for path expressions of the form: {{python statements}} As compensation, the PR supports Python's *standard syntax* defined by os.path.expanduser and os.path.expandvars. Those who no