From: Han-Wen Nienhuys Date: Thu, 6 May 2004 22:27:25 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.1~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e4d0eee7496681f041e95c1f598e39c4061affb5;p=lilypond.git *** empty log message *** --- diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 46d4e25a17..32b2295c3d 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -8,7 +8,18 @@ @itemize @bullet -@item Music can be used as a markup + +@item Music syntax can now be extended seamlessly. As an example, +here is the new implementation @code{\apply}, + +@example + apply = #(ly:make-music-function + (list procedure? ly:music?) ; signature + (lambda (where func music) ; the function + (func music))) +@end example + +@item Music can be used as a markup. When inserting a @code{score} block as part of a @code{\markup}, it produces a rendered markup of the music. @@ -17,12 +28,11 @@ it produces a rendered markup of the music. @end example -@item LilyPond expressions can be embedded into Scheme, thanks to the -@code{#@{ ... #@}} syntax. Within such a block, Scheme forms, for +@item LilyPond expressions can be embedded into Scheme. The syntax for +this is @code{#@{ ... #@}}. Within such a block, Scheme forms, for instance variable names, can be introduced thanks to a @code{$} -character (@code{$$} has to be used to issue a single `$' character). -These forms are then 'printed' in the pattern, as if they were called -by (display). +character (@code{$$} results in a single `$' character). These forms +are then printed in the pattern. @example #(define (textoffset dx dy) @@ -71,22 +81,25 @@ is the same as The default value is one octave below middle C. @c update-me? formal definition of newaddlyrics, once it works -@item Combining lyrics with music can be @code{newaddlyrics} +@item Combining lyrics with music can be @code{newlyrics} @example << \relative @{ \clef bass d2 d c4 bes a2 \break - c2 c d4 f g2 @} \newlyrics @{ My first Li -- ly song, + @} + \newlyrics @{ Not much can go wrong! @} >> @end example +Syntactically, @code{\newlyrics} acts like an infix operator + @item The parser is encapsulated in a Scheme function @code{ly:parse-file}, so the following fragment processes two files diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index 067b51b20c..8ac4acb22f 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -3385,6 +3385,9 @@ The definition of lyrics mode is too complex. @node The Lyrics context @subsection The Lyrics context + +@c TODO: document \newlyrics + Lyrics are printed by interpreting them in a @internalsref{Lyrics} context @example \context Lyrics \lyrics @dots{} diff --git a/lily/parser.yy b/lily/parser.yy index f94d93a35e..f8efe45b33 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1009,7 +1009,7 @@ Generic_prefix_music: } SCM m = SCM_EOL; if (ok) - m = scm_apply_0 (func, ly_cdr ($1)); + m = scm_apply_0 (func, ly_cdr ($1)); if (unsmob_music (m)) { $$ = unsmob_music (m); @@ -1020,7 +1020,7 @@ Generic_prefix_music: loc->error (_ ("Music head function should return Music object.")); $$ = MY_MAKE_MUSIC ("Music"); } - + $$->set_spot (*loc); } ;