[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Robustly include project-specific scheme files?
From: |
Reedmace Star |
Subject: |
Re: Robustly include project-specific scheme files? |
Date: |
Mon, 22 Oct 2012 06:41:30 +0200 |
User-agent: |
KMail/4.8.5 (Linux/3.2.0-32-generic; KDE/4.8.5; x86_64; ; ) |
* 2012-10-22 04:44 +0200 Ian Hulin:
> On 21/10/12 22:00, Reedmace Star wrote:
> > --- file my-scheme-defs.scm (same directory as master.ly) ---
> >
> > ;;; scheme definitions...
> >
> >
> > --- file master.ly ---
> >
> > \version "2.16.0" #(load "my-scheme-defs.scm")
> >
> > %% do something ...
> >
> > ---
> >
> > This, however, only works when calling lilypond on master.ly from
> > that same directory. The load command looks for the .scm file in
> > the present working directory, but not in the directory containing
> > the including file.
...
>
> If my-scheme-defs.scm is in path my-scheme-dir
>
> --- file master.ly ---
>
> \version "2.16.0"
> % allow guile to find your file.
> #(set! %load-path cons("my-scheme-dir" %load-path))
> #(load-from-path "my-scheme-defs.scm")
>
> %% do something ...
O.k., but that would require "my-scheme-dir" to be an absolute path,
lest I run into the original problem, right?
To keep the project self-contained and movable, I would prefer to
include relative to master.ly. Can I somehow find out its containing
directory from inside that file?
Best regards,
Reedmace Star