]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily.scm
Rewrite `ly-getcwd' for Guile 1.8 backward compat.
[lilypond.git] / scm / lily.scm
index 9a152ed0aa66f3384f32644b3c16fc080f9eccc3..8cfebbd0db26366f405b8f93712f82470eefbd52 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
@@ -115,6 +115,9 @@ output to log file `FOO.log'.")
                         "midi")
 "Set the default file extension for MIDI output
 file to given string.")
+    (music-strings-to-paths #f
+"Convert text strings to paths when glyphs belong
+to a music font.")
     (old-relative #f
 "Make \\relative mode for simultaneous music work
 similar to chord syntax.")
@@ -125,7 +128,7 @@ similar to chord syntax.")
     (pixmap-format "png16m"
 "Set GhostScript's output format for pixel images.")
     (preview #f
-"Create PNG and EPS preview images also.")
+"Create preview images also.")
     (print-pages #t
 "Print pages in the normal way.")
     (protected-scheme-parsing #t
@@ -245,11 +248,13 @@ messages into errors.")
 
 (define-public parser #f)
 
+(define music-string-to-path-backends
+  '(svg))
 
-;; gettext wrapper for guile < 1.7.2
-(if (defined? 'gettext)
-    (define-public _ gettext)
-    (define-public _ ly:gettext))
+(if (memq (ly:get-option 'backend) music-string-to-path-backends)
+    (ly:set-option 'music-strings-to-paths #t))
+
+(define-public _ gettext)
 
 (define-public (ly:load x)
   (let* ((file-name (%search-load-path x)))
@@ -267,25 +272,17 @@ messages into errors.")
     (if (null? (cdr platform)) #f
        (member (string-downcase (cadr platform)) '("95" "98" "me")))))
 
-(case PLATFORM
-  ((windows)
-   (define native-getcwd
-     getcwd)
-
-   (define (slashify x)
-     (if (string-index x #\\)
-        x
-        (string-regexp-substitute
-         "//*" "/"
-         (string-regexp-substitute "\\\\" "/" x))))
-
-   ;; FIXME: this prints a warning.
-   (define-public (ly-getcwd)
-     (slashify (native-getcwd))))
+(define (slashify x)
+  (if (string-index x #\\)
+      x
+      (string-regexp-substitute
+       "//*" "/"
+       (string-regexp-substitute "\\\\" "/" x))))
 
-  (else
-   (define-public ly-getcwd
-     getcwd)))
+(define-public (ly-getcwd)
+  (if (eq? PLATFORM 'windows)
+      (slashify (getcwd))
+      (getcwd)))
 
 (define-public (is-absolute? file-name)
   (let ((file-name-length (string-length file-name)))
@@ -422,6 +419,7 @@ LilyPond safe mode.  The syntax is the same as `define*-public'."
        (,input-port? . "input port")
        (,integer? . "integer")
        (,list? . "list")
+       (,list-or-symbol? . "list or symbol")
        (,ly:context? . "context")
        (,ly:dimension? . "dimension, in staff space")
        (,ly:dir? . "direction")
@@ -449,9 +447,11 @@ LilyPond safe mode.  The syntax is the same as `define*-public'."
        (,output-port? . "output port")
        (,pair? . "pair")
        (,procedure? . "procedure")
+       (,real? . "real number")
        (,rhythmic-location? . "rhythmic location")
        (,scheme? . "any type")
        (,string? . "string")
+       (,string-or-pair? . "string or pair")
        (,symbol? . "symbol")
        (,vector? . "vector")))
 
@@ -718,8 +718,7 @@ PIDs or the number of the process."
         (ly:set-option 'debug-gc-assert-parsed-dead #f)
         (if (ly:get-option 'debug-gc)
             (dump-gc-protects)
-            (if (= (random 40) 1)
-                (ly:reset-all-fonts)))))
+            (ly:reset-all-fonts))))
      files)
 
     ;; we want the failed-files notice in the aggregrate logfile.