X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fuser%2Fprogramming-interface.itely;h=ba9fdc95e56b8e235a7767ef3153af738f4b9857;hb=a74f4a786ff2dd07adb02b16d15095263271801f;hp=9b1a518797af43ebe58265558e430ba8bd0d9005;hpb=dc8e9c050a98c809e66b10d9ae1d3df9d3b0190f;p=lilypond.git diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index 9b1a518797..ba9fdc95e5 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -22,8 +22,9 @@ not familiar with Scheme, you may wish to read our * Building complicated functions:: * Markup programmer interface:: * Contexts for programmers:: -* Scheme procedures as properties:: -* TODO moved into scheme:: +* Scheme procedures as properties:: +* Using Scheme code instead of \tweak:: +* Difficult tweaks:: @end menu @@ -50,8 +51,8 @@ code is easy. The general form of these functions is @example function = -#(define-music-function (parser location @var{var1} @var{var2}... ) - (@var{var1-type?} @var{var2-type?}...) +#(define-music-function (parser location @var{var1} @var{var2}...@var{vari}... ) + (@var{var1-type?} @var{var2-type?}...@var{vari-type?}...) #@{ @emph{...music...} #@}) @@ -61,10 +62,10 @@ function = where @multitable @columnfractions .33 .66 -@item @var{argi} @tab @var{i}th variable -@item @var{argi-type?} @tab type of variable +@item @var{vari} @tab @var{i}th variable +@item @var{vari-type?} @tab type of @var{i}th variable @item @var{...music...} @tab normal LilyPond input, using - variables as @code{#$var1}. + variables as @code{#$var1}, etc. @end multitable There following input types may be used as variables @@ -73,7 +74,7 @@ other documentation specifically about Scheme for more variable types. @multitable @columnfractions .33 .66 -@headitem Input type @tab @var{argi-type?} notation +@headitem Input type @tab @var{vari-type?} notation @item Integer @tab @code{integer?} @item Float (decimal number) @tab @code{number?} @item Text string @tab @code{string?} @@ -82,9 +83,9 @@ variable types. @item A pair of variables @tab @code{pair?} @end multitable -The @code{parser} and @code{location} argument are mandatory, +The @code{parser} and @code{location} arguments are mandatory, and are used in some advanced situations. The @code{parser} -argument is used to access to the value of another LilyPond +argument is used to gain access to the value of another LilyPond variable. The @code{location} argument is used to set the @q{origin} of the music expression that is built by the music function, so that in case of a syntax error LilyPond @@ -864,14 +865,14 @@ The @code{markup} macro builds markup expressions in Scheme while providing a LilyPond-like syntax. For example, @example (markup #:column (#:line (#:bold #:italic "hello" #:raise 0.4 "world") - #:bigger #:line ("foo" "bar" "baz"))) + #:larger #:line ("foo" "bar" "baz"))) @end example @noindent is equivalent to: @example \markup \column @{ \line @{ \bold \italic "hello" \raise #0.4 "world" @} - \bigger \line @{ foo bar baz @} @} + \larger \line @{ foo bar baz @} @} @end example @noindent @@ -1366,16 +1367,8 @@ to @var{proc}, the outer ensures that result of the function is returned, rather than the @code{simple-closure} object. -@node TODO moved into scheme -@section TODO moved into scheme - -@menu -* Using Scheme code instead of \tweak:: -* Difficult tweaks:: -@end menu - @node Using Scheme code instead of \tweak -@subsection Using Scheme code instead of @code{\tweak} +@section Using Scheme code instead of @code{\tweak} The main disadvantage of @code{\tweak} is its syntactical inflexibility. For example, the following produces a syntax error. @@ -1404,7 +1397,7 @@ F = #(let ((m (make-music 'ArticulationEvent (acons 'font-size -3 (ly:music-property m 'tweaks))) m) - + \relative c'' @{ c4^\F c4_\F @} @@ -1422,7 +1415,7 @@ written back with @code{set!}. The last element of the @node Difficult tweaks -@subsection Difficult tweaks +@section Difficult tweaks There are a few classes of difficult adjustments.