>> 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).
Quickly written documentation by an insider. It should be eventually
On 12/7/2023 12:21 PM, Jean Abou Samra wrote:
Documentation question from trying to understand *location* in
David's solution:
Guessing, is sip a stream input pointer? _Where would I look to find
the definition/example of sip?_
*location* doesn't return a string but a special type
> 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
On 12/6/2023 3:48 PM, David Kastrup wrote:
\version "2.24.2"
locationOf =
#(define-scheme-function () ()
(apply format #f "~a:~a:~a:~a" (ly:input-file-line-char-column
(*location*
\markup { \locationOf }
Documentation question from trying to understand *location* in David's
>> Thanks! However, Jean's statement
>>
>> > markups don't store location info, unfortunately.
>>
>> is still true, which means that you can't access the current input
>> location within `define-markup-command`.
>
> Yes, sure, but you could inject this during parsing. [...]
I'm doing very
Am Donnerstag, 7. Dezember 2023, 06:47:56 CET schrieb Werner LEMBERG:
> >> Maybe a bit less esoteric:
> > Or even less esoteric:
> Thanks! However, Jean's statement
>
> > markups don't store location info, unfortunately.
>
> is still true, which means that you can't access the current input
>
>> Maybe a bit less esoteric:
>
> Or even less esoteric:
Thanks! However, Jean's statement
> markups don't store location info, unfortunately.
is still true, which means that you can't access the current input
location within `define-markup-command`.
Werner
Valentin Petzel writes:
> Am Mittwoch, 6. Dezember 2023, 23:10:11 CET schrieb Jean Abou Samra:
>> \version "2.24.2"
>>
>> #(define-markup-command (foo layout props loc-provider) (ly:music?)
>>(display (ly:input-file-line-char-column (ly:music-property loc-provider
>> 'origin)))
Am Mittwoch, 6. Dezember 2023, 23:10:11 CET schrieb Jean Abou Samra:
> \version "2.24.2"
>
> #(define-markup-command (foo layout props loc-provider) (ly:music?)
>(display (ly:input-file-line-char-column (ly:music-property loc-provider
> 'origin))) empty-stencil)
>
> \markup \foo {{}}
Maybe
> OK, thanks. But what about accessing the `input-file-name` variable?
> Shouldn't this work within `delay-stencil-evaluation`?
delay-stencil-evaluation or not, during backend processing,
input-file-name is set to the filename of the main file,
not the filename of the file where the markup
>> How can I access the current LilyPond input file name from within a
>> markup command? Or do I have to use the (undocumented)
>> `delay-stencil-evaluation` functionality?
>
> If you mean the name of the file from which the command is called
> (vs. defined), you can't — markups don't store
> How can I access the current LilyPond input file name from within a
> markup command? Or do I have to use the (undocumented)
> `delay-stencil-evaluation` functionality?
If you mean the name of the file from which the command is called
(vs. defined), you can't — markups don't store location
How can I access the current LilyPond input file name from within a
markup command? Or do I have to use the (undocumented)
`delay-stencil-evaluation` functionality?
Werner
13 matches
Mail list logo