[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: after-line-breaking access to paper variables
From: |
David Kastrup |
Subject: |
Re: after-line-breaking access to paper variables |
Date: |
Fri, 30 Jun 2017 12:48:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Knut Petersen <address@hidden> writes:
> Hi everybody!
>
> I use some scheme code to dump information needed for video generation:
>
> #(define (mkvideo-dump-alb grob)
> (let* (
> (pap (ly:parser-lookup '$defaultpaper))
> (lm (ly:output-def-lookup pap 'left-margin))
> [...]
>
> It is activated by
>
> \layout {
> \context { \Staff
> \override BarLine #'after-line-breaking = #mkvideo-dump-alb
> }
> \context { \Voice
> \override NoteHead #'after-line-breaking = #mkvideo-dump-alb
> \override Rest #'after-line-breaking = #mkvideo-dump-alb
> \override MultiMeasureRest #'after-line-breaking =
> #mkvideo-dump-alb
> }
> }
>
> That works as long as changes to paper variables are made only at the
> top level, but changes to paper variables are also possible inside of
> a \book{}.
>
> It would we nice if someone would give me a hint how to change "pap"
> and "lm" to access the current and not the top-level definition of
> left-margin.
Without an actual example I have no real idea what you want to access
where using what kind of function.
At any rate, you are overriding grob callbacks, and maybe you just want
to call (lm (ly:output-def-lookup (ly:grob-layout grob) 'left-margin))
and its ilk?
--
David Kastrup