From 7d62bd9bf492a787674f042530a072a20de25ce0 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Tue, 26 Dec 2006 07:07:21 -0800 Subject: [PATCH] Add info about music functions without arguments. --- .../user/programming-interface.itely | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index 1cadde8f2e..3909b5b65c 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -27,6 +27,7 @@ This section discusses how to create music functions within LilyPond. * Paired substitution functions:: * Mathematics in functions:: * Void functions:: +* Functions without arguments:: * Overview of available music functions:: @end menu @@ -237,6 +238,36 @@ noPointAndClick = \noPointAndClick % disable point and click @end example + +@node Functions without arguments +@subsection Functions without arguments + +In most cases a function without arguments should be written +with an identifier, + +@example +dolce = \markup@{ \italic \bold dolce @} +@end example + +However, in rare cases it may be useful to create a music function +without arguments, + +@example +displayBarNum = +#(define-music-function (parser location) () + (if (eq? #t (ly:get-option display-bar-numbers)) + #@{ \once \override Score.BarNumber #'break-visibility = ##f #@} + #@{#@})) +@end example + +To actually display bar numbers where this function is called, +invoke lilypond with + +@example +lilypond -d display-bar-numbers FILENAME.ly +@end example + + @node Overview of available music functions @subsection Overview of available music functions -- 2.39.5