[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: accessing current file name in markup function
From: |
Jean Abou Samra |
Subject: |
Re: accessing current file name in markup function |
Date: |
Thu, 07 Dec 2023 20:21:31 +0100 |
User-agent: |
Evolution 3.50.1 (3.50.1-1.fc39) |
Documentation question from trying to understand *location* in David's solution:
I found that function in the IR documentation[1], but I could not find the definition of a sip:
Function: ly:input-file-line-char-column
sip Return input location in sip as (file-name line char column)
.
Guessing, is sip a stream input pointer? Where would I look to find the definition/example of sip?
Well, if you have that code snippet, you basically do #(display (*location*)) and look at the result, which is something like
#<location /tmp/frescobaldi-7wfyx79d/tmpqvfqyl7q/document.ly:3:2>
indicating that *location* doesn't return a string but a special type of location/input object.
This is also what the "input" prefix on the function name means — functions specific to a LilyPond object type are prefixed with ly:that-type (e.g., ly:grob-parent, ly:context-property, etc.).
The name "sip" is a bit weird; looking in the commit that added the code 19 years ago, it looks like it was meant as "smob input" (where smob = Scheme object = LilyPond C++ object made available to Scheme).
signature.asc
Description: This is a digitally signed message part