]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily.scm
remove latin1.enc rules.
[lilypond.git] / scm / lily.scm
index ac39758fdb4d96cfb906967edaedf8bc02902f59..6a6c8c64745673baaf50f17d75f535d0f0da7324 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c)  1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 
@@ -13,6 +13,7 @@
 
 (use-modules (ice-9 regex)
             (ice-9 safe)
+             (ice-9 optargs)
             (oop goops)
             (srfi srfi-1)  ; lists
             (srfi srfi-13)) ; strings
@@ -88,10 +89,11 @@ predicates. Print a message at LOCATION if any predicate failed."
       (if (not (pred? arg))
 
          (begin
-           (ly:input-message location
-                             (format #f
-                                     (_ "wrong type for argument ~a. Expecting ~a, found ~s")
-                                     count (type-name pred?) arg))
+           (ly:input-message
+            location
+            (format
+             #f (_ "wrong type for argument ~a.  Expecting ~a, found ~s")
+             count (type-name pred?) arg))
            #f)
          #t))
 
@@ -137,6 +139,7 @@ predicates. Print a message at LOCATION if any predicate failed."
     repeat-slash
     round-filled-box
     text
+    url-link
     white-dot
     white-text
     embedded-ps
@@ -155,12 +158,33 @@ predicates. Print a message at LOCATION if any predicate failed."
     placebox
     unknown))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Safe definitions utility
+(define safe-objects (list))
+
+(define-macro (define-safe-public arglist . body)
+  "Define a variable, export it, and mark it as safe, ie usable in LilyPond safe mode.
+The syntax is the same as `define*-public'."
+  (define (get-symbol arg)
+    (if (pair? arg)
+        (get-symbol (car arg))
+        arg))
+  (let ((safe-symbol (get-symbol arglist)))
+    `(begin
+       (define*-public ,arglist
+         ,@body)
+       (set! safe-objects (cons (cons ',safe-symbol ,safe-symbol)
+                                safe-objects))
+       ,safe-symbol)))
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; other files.
 
 (for-each ly:load
          ;; load-from-path
          '("lily-library.scm"
+           "file-cache.scm"
            "define-music-types.scm"
            "output-lib.scm"
            "c++.scm"