lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to parse "location"


From: Urs Liska
Subject: Re: How to parse "location"
Date: Fri, 24 Oct 2014 16:26:51 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


Am 24.10.2014 15:29, schrieb Jan-Peter Voigt:
Hi Urs,

you can use ly:input-file-line-char-column to get a list containing the file-path and line- and column-number.
In openlilylib I placed a function inside /scheme-lib/lalily/parser-location.scm -  location-extract-path - which returns the absolute path of the location.
With lalily I sometimes use a wrapper around this:
epsPath = \filePath "mypic.eps"
Now 'epsPath' contains the absolute path of the file "mypic.eps" relative to the ily-file. That way I can predefine markups containing eps-files in files, which are included from anywhere.

It gets a bit fuzzy now ;)
Back to the point:
use ly:input-file-line-char-column to get a list from a location.

HTH

Yes, it does. Hope you're not disappointed that Richard Shann was earlier (in a PM) ;-)

Thanks
Urs

Best
Jan-Peter

Am 24.10.2014 um 11:52 schrieb Urs Liska:
If I use (display location) in a Scheme function I get an output like:


#<location /home/uliska/git/bfsc/fried/das-trunkne-lied/parts/bassclarinet/02.ily:40:3>


How can I access the content of the location (or better: it's constituents), for example to extract the file name and a part of the path (concretely I'd like to extract "bassclarinet" and "02" from the above example)?


TIA
Urs



_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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