lilypond-user
[Top][All Lists]
Advanced

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

Re: How do I figure out the absolute path of the file currently being ex


From: Urs Liska
Subject: Re: How do I figure out the absolute path of the file currently being executed?
Date: Sat, 24 Jun 2017 14:27:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0


Am 24.06.2017 um 12:48 schrieb address@hidden:
> That is, the file where the currently executing function is defined,
> not the file it's called from.

You can get this from the (*location*) function.
You may inspect
https://github.com/openlilylib/oll-core/blob/master/internal/os-path.ily
(the core is in the this-file function but uses helper functions all
over the file), and if you have openLilyLib (new) available you can test

a) main.ly
\version "2.19.60"

\include "oll-core/package.ily"

\include "inc.ily"
#(format #t "Main file: ~a" (os-path-join-unix (this-file)))

and
b) inc.ily
\version "2.19.60"

#(format #t "Included file: ~a\n" (os-path-join-unix (this-file)))

But the core is that calling (*location*) will give you a location
object for the current position in the input from which you can extract
the necessary information.

HTH
Urs

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

-- 
address@hidden
https://openlilylib.org
http://lilypondblog.org




reply via email to

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