From fa01857ae94abb14b5f51d725b5150fa5da85496 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Sat, 10 Jun 2006 04:35:28 +0000 Subject: [PATCH] convert-ly rule for annotate-foo, and snippet from NEWS. --- ChangeLog | 9 ++++- .../user/programming-interface.itely | 34 +++++++++++++++++++ python/convertrules.py | 11 ++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8cce756d72..02dc0763f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-10 Graham Percival + + * Documentation/user/programming-interfaces.itely: add + info from NEWS. + + * python/convertrules.py: add annotatefoo -> annotate-foo + rules. + 2006-06-10 Han-Wen Nienhuys * HACKING: trim outdated info. @@ -14,7 +22,6 @@ * input/regression/page-spacing.ly, input/regression/page-layout-manual-position.ly: idem - 2006-06-09 Han-Wen Nienhuys * lily/line-spanner.cc: cleanup property list. diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index e282f754f1..9e149bd8a0 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -12,6 +12,7 @@ not familiar with Scheme, you may wish to read our * Building complicated functions:: * Markup programmer interface:: * Contexts for programmers:: +* Scheme procedures as properties:: @end menu @@ -1131,3 +1132,36 @@ note-heads on the center-line: (set! (ly:grob-property grob 'transparent) #t))) @end example + +@node Scheme procedures as properties +@section Scheme procedures as properties + +Properties (like thickness, direction, etc.) can be set at fixed values +with \override, e.g. + +@example +\override Stem #'thickness = #2.0 +@end example + +Properties can also be set to a Scheme procedure, + +@lilypond[fragment,verbatim,quote,relative=2] +\override Stem #'thickness = #(lambda (grob) + (if (= UP (ly:grob-property grob 'direction)) + 2.0 + 7.0)) +c b a g b a g b +@end lilypond + +Procedures may also be combined like that with +"grob closure". Here is a setting from +@code{AccidentalSuggestion}, + +@example +(X-offset . ,(ly:make-simple-closure + `(,+ + ,(ly:make-simple-closure (list ly:self-alignment-interface::centered-on-x-parent)) + ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))))) +@end example + + diff --git a/python/convertrules.py b/python/convertrules.py index d535ae8ce9..ecf7532cef 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -2795,3 +2795,14 @@ def conv (str): return str conversions.append (((2, 9, 6), conv, """\context Foo \applyOutput #bla -> \applyOutput #'Foo #bla """)) + + +def conv (str): + str = re.sub ('annotatepage', 'annotate-page', str) + str = re.sub ('annotateheaders', 'annotate-headers', str) + str = re.sub ('annotatesystems', 'annotate-systems', str) + return str + +conversions.append (((2, 9, 9), conv, """annotatefoo -> annotate-foo""")) + + -- 2.39.5