lilypond-user
[Top][All Lists]
Advanced

[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: Tue, 23 Oct 2012 22:42:04 +0200
User-agent: KMail/4.8.5 (Linux/3.2.0-32-generic; KDE/4.8.5; x86_64; ; )

* 2012-10-22 06:41 +0200 Reedmace Star:
> * 2012-10-22 04:44 +0200 Ian Hulin:
> 
> > 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?

To half-answer my own question: guile 2 seems to have a function 
(current-filename), so something like (dirname (current-filename)) 
instead of "my-scheme-dir" might work. Though LilyPond is still using 
guile 1.8, this at least puts a possible future solution on the horizon.

In case someone knows a method that works now, I'm still interested.


Best regards,

R.S.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]