view patches/0001-Guile-1.9-compatibility-fixes.patch @ 6512:ccc20ae889ca default tip guix

mingw::guile-2.0.7 builds.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Thu, 24 Mar 2016 08:03:39 +0100
parents f92e580f1587
children
line wrap: on
line source

From 05514c83a49dd3dfabd1fa7774c69c3038ecde6b Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 2 Feb 2011 11:18:28 +0100
Subject: [PATCH] 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
---
 scm/define-markup-commands.scm |   53 +++++++++++++++++++--------------------
 scm/define-music-types.scm     |    2 +-
 scm/display-lily.scm           |   18 +++++++-------
 scm/layout-beam.scm            |   14 ++++++----
 scm/lily.scm                   |    6 +++-
 5 files changed, 48 insertions(+), 45 deletions(-)

diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index 7a96dfa..5dbc5d2 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 2205c43..a349934 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-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.
diff --git a/scm/display-lily.scm b/scm/display-lily.scm
index 51b13eb..fa87f1c 100644
--- a/scm/display-lily.scm
+++ b/scm/display-lily.scm
@@ -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
diff --git a/scm/layout-beam.scm b/scm/layout-beam.scm
index 5d5d190..4ef49e9 100644
--- a/scm/layout-beam.scm
+++ b/scm/layout-beam.scm
@@ -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) 
 
@@ -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 7384d56..08e6561 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"
-- 
1.7.1