File 'Open' or 'Import File' command to follow @path directive

19 views
Skip to first unread message

Largo84

unread,
Nov 15, 2011, 10:31:20 PM11/15/11
to leo-editor
Suppose my focus node is under a @path directive, say @path E:
\Documents\Some Folder\

Is there a setting that would cause the 'File>Open' or 'File>Import
File' commands to begin the search dialog in the directory, E:
\Documents\Some Folder\ instead of the last directory used?

Would others find this a useful feature?

Rob.................

Kent Tenney

unread,
Nov 16, 2011, 7:36:18 AM11/16/11
to leo-e...@googlegroups.com

+1

>
> Rob.................
>
> --
> You received this message because you are subscribed to the Google Groups "leo-editor" group.
> To post to this group, send email to leo-e...@googlegroups.com.
> To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
>
>

Terry Brown

unread,
Nov 16, 2011, 10:30:09 AM11/16/11
to leo-e...@googlegroups.com
On Tue, 15 Nov 2011 19:31:20 -0800 (PST)
Largo84 <lar...@gmail.com> wrote:

> Is there a setting that would cause the 'File>Open' or 'File>Import
> File' commands to begin the search dialog in the directory, E:
> \Documents\Some Folder\ instead of the last directory used?
>
> Would others find this a useful feature?

I vote for that being default behavior, not sure a setting is necessary.

Cheers -Terry

Josef

unread,
Nov 18, 2011, 8:22:57 AM11/18/11
to leo-editor
not only would I vote for this, but in addition, the generated path
should be *relative* to the path in the @path directive, not absolute.
E.g. use os.path.relpath(path[, start]) where start is the path
specified by the (cascaded) @path directive.

That allows Leo files to be moved together with the files it is
pointing to, without having to rewrite all the filename paths,
and is the only way to for collaboration with others.
Only in rare occations one would actually prefer an absolute path, so
we would need open-relative and open-absolute versions. When dragging
files this might be achieved by left-click-dragging versus middleclick-
dragging or ctrl-dragging.

- Josef

On Nov 16, 4:30 pm, Terry Brown <terry_n_br...@yahoo.com> wrote:
> On Tue, 15 Nov 2011 19:31:20 -0800 (PST)
>

Terry Brown

unread,
Nov 20, 2011, 4:48:00 PM11/20/11
to leo-e...@googlegroups.com
On Fri, 18 Nov 2011 05:22:57 -0800 (PST)
Josef <joe...@gmx.net> wrote:

> not only would I vote for this, but in addition, the generated path
> should be *relative* to the path in the @path directive, not absolute.
> E.g. use os.path.relpath(path[, start]) where start is the path
> specified by the (cascaded) @path directive.

In what context would this relative path exist - oh, I get it,
p.nodePath() or whatever it's called would return a relative path.
Relative to the most recent absolute path ancestor, or the current
location of the .leo file, if there are no absolute path ancestors.

That could be useful although I suspect the most common use case of
p.nodePath() is to feed it into open(), so perhaps p.nodePath() should
return an absolute path and p.nodePath(relative=True) should return a
relative path.

Cheers -Terry

Edward K. Ream

unread,
Nov 23, 2011, 11:17:24 AM11/23/11
to leo-e...@googlegroups.com
On Tue, Nov 15, 2011 at 9:31 PM, Largo84 <lar...@gmail.com> wrote:

Please file a wish-list bug for this.

Edward

Edward K. Ream

unread,
Nov 25, 2011, 10:48:20 AM11/25/11
to leo-editor

On Nov 23, 10:17 am, "Edward K. Ream" <edream...@gmail.com> wrote:

> > Is there a setting that would cause the 'File>Open' or 'File>Import
> > File' commands to begin the search dialog in the directory, E:
> > \Documents\Some Folder\ instead of the last directory used?
>
> > Would others find this a useful feature?
>
> Please file a wish-list bug for this.

No need. I've just put it on the internal to-do list. I have some
questions about how this might work which might be related to the
project to regularize how Leo handles @path.

Edward

Reply all
Reply to author
Forward
0 new messages