Re: [NTG-context] RFC: path relative to current file.

2012-11-08 Thread Andre Caldas
Hello, Hans! I quoted this from your message: local function toppath() [...] resolvers.toppath = topath When you commited version eb24ffd, the following bug was introduced: There is a bug here. It should be resolvers.toppath = toppath (double p in the right side) In your local copy I

Re: [NTG-context] RFC: path relative to current file.

2012-11-08 Thread Hans Hagen
On 11/8/2012 1:14 PM, Andre Caldas wrote: Hello, Hans! I quoted this from your message: local function toppath() [...] resolvers.toppath = topath When you commited version eb24ffd, the following bug was introduced: There is a bug here. It should be resolvers.toppath = toppath (double p

Re: [NTG-context] RFC: path relative to current file.

2012-11-08 Thread Andre Caldas
Are we giving up the feature? I was kind of using it already... :-( you have a messed up system ... the code is in data-pre.lua Indeed! :-) Sorry for the mess! Now, I have a bug at data-pre.lua. The variable inputstack is not defined there. Here is a fix: diff --git

Re: [NTG-context] RFC: path relative to current file.

2012-11-07 Thread Andre Caldas
Hello! local function toppath() [...] resolvers.toppath = topath There is a bug here. It should be resolvers.toppath = toppath (double p in the right side) André Caldas. -- - Por que altera a ordem natural da conversação! - Por que não? - Eu não gosto, não. - Você gosta quando copiam a

Re: [NTG-context] RFC: path relative to current file.

2012-11-07 Thread Hans Hagen
On 11/7/2012 8:34 PM, Andre Caldas wrote: Hello! local function toppath() [...] resolvers.toppath = topath There is a bug here. It should be resolvers.toppath = toppath (double p in the right side) In your local copy I presume, not here.

Re: [NTG-context] RFC: path relative to current file.

2012-11-03 Thread Sietse Brouwer
Andreas wrote: It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. Hans wrote: in file-job.lua add around the function 'process': local function toppath() [...] \component toppath:/subpath/somefile.tex Andreas wrote: Works like a charm, Hans!

Re: [NTG-context] RFC: path relative to current file.

2012-11-03 Thread Hans Hagen
On 11/3/2012 10:13 AM, Sietse Brouwer wrote: Andreas wrote: It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. Hans wrote: in file-job.lua add around the function 'process': local function toppath() [...] \component toppath:/subpath/somefile.tex

Re: [NTG-context] RFC: path relative to current file.

2012-11-02 Thread Andre Caldas
Hello! It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. in file-job.lua add around the function 'process': local function toppath() [...] \component toppath:/subpath/somefile.tex Works like a charm, Hans! Sorry I took so long to test... I

Re: [NTG-context] RFC: path relative to current file.

2012-10-16 Thread Hans Hagen
On 16-10-2012 00:26, Andre Caldas wrote: 1. check for stack underflow; and/or such things are dealt with By assert, I mean: assert(inputstack[#inputstack], Input stack should never be empty when toppath() is called.) normally if inputstack[#inputstack] == nil then assume path .

Re: [NTG-context] RFC: path relative to current file.

2012-10-16 Thread Andre Caldas
1. check for stack underflow; and/or such things are dealt with By assert, I mean: assert(inputstack[#inputstack], Input stack should never be empty when toppath() is called.) normally if inputstack[#inputstack] == nil then assume path . end is good enough ... Is

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Hans Hagen
On 13-10-2012 03:34, Andre Caldas wrote: 3. Call function pop automatically, just like the push function is called automatically. kind of tricky as the file can already be loaded and closed and therefore you're back at the previous level 4. Avoid having to define \xproject, \xproduct,

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Hans Hagen
On 13-10-2012 03:34, Andre Caldas wrote: Hello, list! A while ago, I raised a question about how to, in a tex, specify a file with a path relative to the currently being processed file. http://www.ntg.nl/pipermail/ntg-context/2012/069132.html

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Andre Caldas
It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. in file-job.lua add around the function 'process': You make me really happy, Hans! :-) I will change file-job.lua on my system to test. I can do this only on Wednesday. local function toppath() [...]

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Hans Hagen
On 15-10-2012 21:42, Andre Caldas wrote: I don't know when inputstack could be empty... but maybe a warning should be issued, and the return value of toppath should be declared undefined. That is, it would be an error to call toppath if inputstack is empty. you should test \component x.tex

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Aditya Mahajan
2. check if the file somefile.tex exists in the directory being popped from the stack. Just for bug catching... it all happens before a file is loaded so the normal reporting is applied Actually, it is a bit annoying that \environment and \component do not report an error (or at least a

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Marco Patzer
2012-10-15 Aditya Mahajan: 2. check if the file somefile.tex exists in the directory being popped from the stack. Just for bug catching... it all happens before a file is loaded so the normal reporting is applied Actually, it is a bit annoying that \environment and \component do not

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Hans Hagen
On 15-10-2012 23:27, Aditya Mahajan wrote: 2. check if the file somefile.tex exists in the directory being popped from the stack. Just for bug catching... it all happens before a file is loaded so the normal reporting is applied Actually, it is a bit annoying that \environment and \component

Re: [NTG-context] RFC: path relative to current file.

2012-10-15 Thread Andre Caldas
1. check for stack underflow; and/or such things are dealt with By assert, I mean: assert(inputstack[#inputstack], Input stack should never be empty when toppath() is called.) 2. check if the file somefile.tex exists in the directory being popped from the stack. Just for bug catching...

[NTG-context] RFC: path relative to current file.

2012-10-12 Thread Andre Caldas
Hello, list! A while ago, I raised a question about how to, in a tex, specify a file with a path relative to the currently being processed file. http://www.ntg.nl/pipermail/ntg-context/2012/069132.html http://www.ntg.nl/pipermail/ntg-context/2012/068902.html Even though the issue did not get