Re: Finding files in include paths

2020-01-20 Thread Urs Liska
Am Montag, den 20.01.2020, 10:34 +0100 schrieb Han-Wen Nienhuys:
> I documented it in https://codereview.appspot.com/573400043/
> 
> you could add a scheme callback similar to ly:source-file, eg.
> ly:source-find to do the equivalent of kpsewhich

Thanks. I have to go to work now, but I'll have a look ASAP:

Urs

> 
> On Mon, Jan 20, 2020 at 9:22 AM Urs Liska 
> wrote:
> > Hi all,
> > 
> > how/where is the file searchign with LilyPond's search path is
> > implemented?
> > 
> > If I write 
> >   \include "a/relative/path"
> > the given path is searched for relative to all search paths known
> > to
> > LilyPond.
> > 
> > Is there a way to do the same in Scheme, say
> >   (file-visible-to-lilypond "a/relative/path")
> > to determine whether a target can be found within any LilyPond
> > search
> > path? Probably the function should return the absolut path, similar
> > to
> > what kpsewhich does.
> > 
> > I need that to check whether a certain file is present (and then
> > open
> > it) without knowing the absolute location.
> > 
> > Urs
> > 
> > 
> 
> 




Re: Finding files in include paths

2020-01-20 Thread Han-Wen Nienhuys
I documented it in https://codereview.appspot.com/573400043/

you could add a scheme callback similar to ly:source-file, eg.
ly:source-find to do the equivalent of kpsewhich

On Mon, Jan 20, 2020 at 9:22 AM Urs Liska  wrote:

> Hi all,
>
> how/where is the file searchign with LilyPond's search path is
> implemented?
>
> If I write
>   \include "a/relative/path"
> the given path is searched for relative to all search paths known to
> LilyPond.
>
> Is there a way to do the same in Scheme, say
>   (file-visible-to-lilypond "a/relative/path")
> to determine whether a target can be found within any LilyPond search
> path? Probably the function should return the absolut path, similar to
> what kpsewhich does.
>
> I need that to check whether a certain file is present (and then open
> it) without knowing the absolute location.
>
> Urs
>
>
>

-- 
Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen


Finding files in include paths

2020-01-20 Thread Urs Liska
Hi all,

how/where is the file searchign with LilyPond's search path is
implemented?

If I write 
  \include "a/relative/path"
the given path is searched for relative to all search paths known to
LilyPond.

Is there a way to do the same in Scheme, say
  (file-visible-to-lilypond "a/relative/path")
to determine whether a target can be found within any LilyPond search
path? Probably the function should return the absolut path, similar to
what kpsewhich does.

I need that to check whether a certain file is present (and then open
it) without knowing the absolute location.

Urs