]> git.donarmstrong.com Git - lilypond.git/commitdiff
Guile-1.9 compatibility fixes.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 2 Feb 2011 10:18:28 +0000 (11:18 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 2 Feb 2011 10:18:28 +0000 (11:18 +0100)
  * remove #:use-syntax
  * rewrite curried definitions
  * change order of loading .scm files so that
    markups are defined before used in code

scm/define-markup-commands.scm
scm/define-music-types.scm
scm/display-lily.scm
scm/layout-beam.scm
scm/lily.scm

index 7a96dfa869592b9ec9f3434c6cae5d58fbe4829c..5dbc5d2f5254b61bd4e3bd4c42b4143807501812 100644 (file)
@@ -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
index 2205c43e5a1526cadd47fbc42b7b2e727c153200..a349934c238e0896bab665206db71919fd5a7e65 100644 (file)
@@ -696,7 +696,7 @@ Syntax: @code{\\\\}")
 (set! music-descriptions
       (sort music-descriptions alist<?))
 
-(define-public music-name-to-property-table (make-vector 59 '()))
+(define-public music-name-to-property-table (make-hash-table 59))
 
 ;; init hash table,
 ;; transport description to an object property.
index 51b13eb25941f21356691c0a48a59c459e185365..fa87f1c7f919618ee1128cada9a490a88b05ee08 100644 (file)
@@ -28,9 +28,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-13)
   #:use-module (srfi srfi-39)
-  #:use-module (lily)
-  #:use-syntax (srfi srfi-39)
-  #:use-syntax (ice-9 optargs))
+  #:use-module (lily))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -289,11 +287,13 @@ inside body."
 ;;;
 
 (define (make-music-type-predicate . music-types)
-  (define ((make-music-type-predicate-aux mtypes) expr)
-    (if (null? mtypes)
-       #f
-       (or (eqv? (car mtypes) (ly:music-property expr 'name))
-           ((make-music-type-predicate-aux (cdr mtypes)) expr))))
-  (make-music-type-predicate-aux music-types))
+  (define make-music-type-predicate-aux
+    (lambda (mtypes)
+      (lambda (expr)
+       (if (null? mtypes)
+           #f
+           (or (eqv? (car mtypes) (ly:music-property expr 'name))
+               ((make-music-type-predicate-aux (cdr mtypes)) expr))))))
+      (make-music-type-predicate-aux music-types))
 
 (load "define-music-display-methods.scm")
\ No newline at end of file
index 5d5d190c2d01ca769622d45f4f832c11b68569c8..4ef49e975989978bfdeeb1af595aa567f76fc06f 100644 (file)
@@ -15,7 +15,9 @@
 ;;;; You should have received a copy of the GNU General Public License
 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
-(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) 
 
                      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)
index 7384d56f9e4b7750da6d3d9162ba562a748e9564..08e656105873400de70aae5280f8768c3ceb1cac 100644 (file)
@@ -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"