From: Jan Nieuwenhuizen Date: Wed, 2 Feb 2011 10:18:28 +0000 (+0100) Subject: Guile-1.9 compatibility fixes. X-Git-Tag: release/2.13.48-1~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=05514c83a49dd3dfabd1fa7774c69c3038ecde6b;p=lilypond.git Guile-1.9 compatibility fixes. * remove #:use-syntax * rewrite curried definitions * change order of loading .scm files so that markups are defined before used in code --- diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 7a96dfa869..5dbc5d2f52 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -2379,6 +2379,32 @@ normal text font, no matter what font was used earlier. ;; symbols. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(define-markup-command (musicglyph layout props glyph-name) + (string?) + #:category music + "@var{glyph-name} is converted to a musical symbol; for example, +@code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from +the music font. See @ruser{The Feta font} for a complete listing of +the possible glyphs. + +@lilypond[verbatim,quote] +\\markup { + \\musicglyph #\"f\" + \\musicglyph #\"rests.2\" + \\musicglyph #\"clefs.G_change\" +} +@end lilypond" + (let* ((font (ly:paper-get-font layout + (cons '((font-encoding . fetaMusic) + (font-name . #f)) + + props))) + (glyph (ly:font-get-glyph font glyph-name))) + (if (null? (ly:stencil-expr glyph)) + (ly:warning (_ "Cannot find glyph ~a") glyph-name)) + + glyph)) + (define-markup-command (doublesharp layout props) () #:category music @@ -2546,33 +2572,6 @@ Use the filled head if @var{filled} is specified. props)) name))) -(define-markup-command (musicglyph layout props glyph-name) - (string?) - #:category music - "@var{glyph-name} is converted to a musical symbol; for example, -@code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from -the music font. See @ruser{The Feta font} for a complete listing of -the possible glyphs. - -@lilypond[verbatim,quote] -\\markup { - \\musicglyph #\"f\" - \\musicglyph #\"rests.2\" - \\musicglyph #\"clefs.G_change\" -} -@end lilypond" - (let* ((font (ly:paper-get-font layout - (cons '((font-encoding . fetaMusic) - (font-name . #f)) - - props))) - (glyph (ly:font-get-glyph font glyph-name))) - (if (null? (ly:stencil-expr glyph)) - (ly:warning (_ "Cannot find glyph ~a") glyph-name)) - - glyph)) - - (define-markup-command (lookup layout props glyph-name) (string?) #:category other diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 2205c43e5a..a349934c23 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -696,7 +696,7 @@ Syntax: @code{\\\\}") (set! music-descriptions (sort music-descriptions alist. -(define ((check-beam-quant posl posr) beam posns) +(define check-beam-quant + (lambda (posl posr) + (lambda (beam posns) "Check whether BEAM has POSL and POSR quants. POSL are (POSITION . QUANT) pairs, where QUANT is -1 (hang), 0 (center), 1 (sit) or -2/ 2 (inter) @@ -39,11 +41,11 @@ want-l want-r posns) (set! (ly:grob-property beam 'annotation) (format "(~S,~S)" want-l want-r)))) - posns - )) + posns)))) - -(define ((check-beam-slope-sign comparison) beam posns) +(define check-beam-slope-sign + (lambda (comparison) + (lambda (beam posns) "Check whether the slope of BEAM is correct wrt. COMPARISON." (let* ((slope-sign (- (cdr posns) (car posns))) (correct (comparison slope-sign 0))) @@ -54,7 +56,7 @@ (set! (ly:grob-property beam 'annotation) (format "~S 0" (procedure-name comparison)))) (set! (ly:grob-property beam 'annotation) "")) - posns)) + posns)))) (define-public (check-quant-callbacks l r) diff --git a/scm/lily.scm b/scm/lily.scm index 7384d56f9e..08e6561058 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -409,12 +409,15 @@ LilyPond safe mode. The syntax is the same as `define*-public'." "define-music-properties.scm" "time-signature-settings.scm" "auto-beam.scm" - "chord-name.scm" "bezier-tools.scm" "parser-ly-from-scheme.scm" "ly-syntax-constructors.scm" "define-context-properties.scm" + ;; guile 1.9 wants markups defined before referenced + "define-markup-commands.scm" + + "chord-name.scm" "translation-functions.scm" "script.scm" "midi.scm" @@ -431,7 +434,6 @@ LilyPond safe mode. The syntax is the same as `define*-public'." "define-woodwind-diagrams.scm" "display-woodwind-diagrams.scm" "predefined-fretboards.scm" - "define-markup-commands.scm" "define-grob-properties.scm" "define-grobs.scm" "define-grob-interfaces.scm"