[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: How do I figure out the absolute path of the file currently being executed?
From:       Urs Liska <ul () openlilylib ! org>
Date:       2017-06-24 12:27:39
Message-ID: e9a658b6-b5b2-a1f7-f46c-d787aa45577f () openlilylib ! org
[Download RAW message or body]



Am 24.06.2017 um 12:48 schrieb caagr98@gmail.com:
> 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
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
ul@openlilylib.org
https://openlilylib.org
http://lilypondblog.org


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic