-\version "1.7.21"
-\header { texidoc = "@cindex Spanner After Break Transparent
-To selectively tweak spanners after the linebreaking
-process, Scheme code must be used. In this simple example, the tie
-after the line break is set transparent. "
-}
+\version "2.1.30"
+
+\header { texidoc = "@cindex Spanner after break
+
+In order to selectively change the properties of spanners after
+a line break, Scheme code must be used. In thas manner, the tie
+after the line break in this example is moved around. "
-\score { \notes {
- \property Voice.Tie \set #'after-line-breaking-callback
- = #(lambda (x)
- (if (eq? (cadr (ly:get-broken-into (ly:get-original x))) x)
- (ly:set-grob-property! x 'transparent #t)
- ))
+ }
+
+#(define (my-callback grob)
+ (let* (
+ (o (ly:grob-original grob))
+ (b (if (ly:grob? o) (ly:spanner-broken-into o) '() ))
+ )
+
+ ;; Call the equivalent of Tie::after_line_breaking
+ ;; if you're using this for other grob-types.
- c'1 ~ \break c'1
+ (if (and (>= (length b) 2) (eq? (car (last-pair b)) grob))
+ (ly:grob-set-property! grob 'extra-offset '(-2 . -1))
+ )
+ ))
+
+#(debug-enable 'backtrace)
- }
- \paper { raggedright = ##t }
+\score {\notes \relative c'' {
+ \override Tie #'after-line-breaking-callback =
+ #my-callback
+ c1 ~ \break c2 ~ c
}
+ \paper { raggedright = ##t }
+ }