vitalije - if you read all the way to the end, I think we end up in the
same place :-)

On Mon, 7 Nov 2011 13:06:21 -0800 (PST)
vitalije <[email protected]> wrote:

> >Is it too late to claim English isn't my first language?  :-}
> neither is my first language.

The trouble is it is my first, and only :-(, language, so my mangled
sentence was just careless.

> I didn't think that /etc/hosts should be resolved as /home/.../etc/hosts
> My idea was that we should deduce root folder as root of Leo file. On linux 
> machines it would be '/', while on windows it would be <Drive>:\ . 
> Concatenating, that way deduced root with the given absolute path in 
> heading we would get correct absolute path on both windows and linux.

Here's how I think it works now, which is also how I think it should
work in general, and may be the same as what you're saying, if not
perhaps you can point out the differences.

The goal is to work out the path for a node, which may be the path for
a derived file represented by the node.

 - The initial directory at the top of the .leo file is the directory
   containing the .leo file.  (*)

 - The path for each node is that directory, with any modifications
   made by @path or @<file> (@auto, @file, etc.) directives on the
   node itself or its ancestors.  Any absolute paths encountered would
   eliminate the influence of all path information from any ancestor
   nodes.

So for the file /home/tbrown/myproject/project.leo,

@auto projectnotes.txt would be /home/tbrown/myproject/projectnotes.txt

@path docs
     @auto projectnotes.txt 
     would be /home/tbrown/myproject/docs/projectnotes.txt

@path /tmp
     @auto projectnotes.txt
or
@auto /tmp/projectnotes.txt
     
would be /tmp/projectnotes.txt

etc.

(*) - so I realize now maybe this is not what you're suggesting,
currently relative paths are determined relative to the folder
containing the .leo file, and you're suggesting they should be
relative to the root of the filesystem containing the .leo file?

I think such a change would break to many existing outlines, and
is probably less useful overall.  But maybe I'm not following your
suggestion properly.

In the specific case of Window's drive specific relative paths, like
A:projectnotes.txt, if the path in effect for the node is on the A:
drive, ignore the A: and treat as a regular relative path.  If the 
path in effect for the node is *not* on the A: drive, then perhaps
there's no way to make it work consistently.  Given a .leo file
C:\myproject\project.leo, what does @auto A:projectnotes.txt mean?

And for Windows paths like @auto \myproject\projectnotes.txt, the "root
of which drive?" question can be answered consistently by following the
above rules to work out which drive you started on, either the one
holding the .leo file, or another specified by an absolute @path
ancestor node.

Ah - and now I think this last point was the point you were making, and
perhaps we agree?

Cheers -Terry

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

Reply via email to