]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily-library.scm
lilypond-book: avoid subprocess for mingw
[lilypond.git] / scm / lily-library.scm
index 34c9cb3820096c04603fd358393651bb165491e1..9673c7b3e44eb634b4a2daff6d557d10483cb0d3 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
@@ -19,6 +19,9 @@
 ; for take, drop, take-while, list-index, and find-tail:
 (use-modules (srfi srfi-1))
 
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; constants.
 
@@ -746,23 +749,6 @@ Handy for debugging, possibly turned off."
 
    (reverse matches))
 
-(define-public (random-string pool n)
-  "Produces a random lowercase string of length n"
-  (define (helper alphabet out num)
-    (let ((rand (random (string-length pool))))
-      (if (< num 1)
-          out
-          (helper alphabet
-                  (string-concatenate `(,out
-                                        ,(substring alphabet
-                                                    rand
-                                                    (+ 1 rand))))
-                  (- num 1)))))
-  (helper pool "" n))
-
-(define-public (random-lowercase-string n)
-  (random-string "abcdefghijklmnopqrstuvwxyz" n))
-
 ;;;;;;;;;;;;;;;;
 ;; other
 
@@ -869,17 +855,12 @@ print a warning and set an optional @var{default}."
     scaling))
 
 (define-public (version-not-seen-message input-file-name)
-  (ly:message
-   "~a:0: ~a ~a"
-    input-file-name
-    (_ "warning:")
-    (format #f
-           (_ "no \\version statement found, please add~afor future compatibility")
-           (format #f "\n\n\\version ~s\n\n" (lilypond-version)))))
+  (ly:warning-located
+    (ly:format "~a:0" input-file-name)
+    (_ "no \\version statement found, please add~afor future compatibility")
+    (format #f "\n\n\\version ~s\n\n" (lilypond-version))))
 
 (define-public (old-relative-not-used-message input-file-name)
-  (ly:message
-   "~a:0: ~a ~a"
-    input-file-name
-    (_ "warning:")
+  (ly:warning-located
+    (ly:format "~a:0" input-file-name)
     (_ "old relative compatibility not used")))