X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flily.scm;h=086d80f09f4d2b3e86e8438d4311a7d352002dc6;hb=bb91de5b7f8c4f753452730101c2422946067cc3;hp=b8f9a672b7169a249d0d1e5995bcc8146f4a12bf;hpb=2a5bf602e34fadfeb14b0d7be3b83fa587be3fbb;p=lilypond.git diff --git a/scm/lily.scm b/scm/lily.scm index b8f9a672b7..086d80f09f 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 1998--2007 Jan Nieuwenhuizen +;;;; (c) 1998--2008 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;; Internationalisation: (_i "to be translated") gets an entry in the @@ -17,6 +17,11 @@ (read-enable 'positions) (debug-enable 'debug) +(define-public PLATFORM + (string->symbol + (string-downcase + (car (string-tokenize (utsname:sysname (uname))))))) + (define scheme-options-definitions `( @@ -26,7 +31,7 @@ ;; - [subject-]-verb-object-object (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG") - (backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)") + (backend ps "which backend to use by default; Options: eps, null, ps [default], scm, svg)") (check-internal-types #f "check every property assignment for types") (clip-systems #f "Generate cut-out snippets of a score") (datadir #f "LilyPond prefix for data files (Readonly).") @@ -55,6 +60,10 @@ ensure that all refs to parsed objects are dead. This is an internal option, an (include-eps-fonts #t "Include fonts in separate-system EPS files.") (job-count #f "Process in parallel") (log-file #f "redirect output to log FILE.log") + (midi-extension ,(if (eq? PLATFORM 'windows) + "mid" + "midi") + "set the default file extension for MIDI") (old-relative #f "relative for simultaneous music works @@ -71,6 +80,8 @@ on errors, and print a stack trace.") (resolution 101 "resolution for generating PNG bitmaps") (read-file-list #f "Read files to be processed from command line arguments") + (relative-includes #f "When processing an \\include command, look for the included file +relative to the current file (instead of the root file)") (safe #f "Run safely") (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.") @@ -78,8 +89,6 @@ on errors, and print a stack trace.") (separate-log-files #f "Output to FILE.log per file.") (trace-memory-frequency #f "Record Scheme cell usage this many times per second, and dump to file.") (trace-scheme-coverage #f "Record coverage of Scheme files") - (ttf-verbosity 0 - "how much verbosity for TTF font embedding?") (show-available-fonts #f "List font names available.") (verbose ,(ly:command-line-verbose?) "value for the --verbose flag") @@ -154,17 +163,9 @@ on errors, and print a stack trace.") (if (ly:get-option 'trace-scheme-coverage) (coverage:enable)) -(define-public tex-backend? - (member (ly:get-option 'backend) '(texstr tex))) - (define-public parser #f) -;; TeX C++ code actually hooks into TEX_STRING_HASHLIMIT -(define-public TEX_STRING_HASHLIMIT 10000000) - - - ;; gettext wrapper for guile < 1.7.2 (if (defined? 'gettext) (define-public _ gettext) @@ -180,22 +181,6 @@ on errors, and print a stack trace.") (if (ly:get-option 'verbose) (ly:progress "]")))) -;; Cygwin -;; #(CYGWIN_NT-5.1 Hostname 1.5.12(0.116/4/2) 2004-11-10 08:34 i686) -;; -;; Debian -;; #(Linux hostname 2.4.27-1-686 #1 Fri Sep 3 06:28:00 UTC 2004 i686) -;; -;; Mingw -;; #(Windows XP HOSTNAME build 2600 5.01 Service Pack 1 i686) -;; - -;; ugh, code dup. -(define-public PLATFORM - (string->symbol - (string-downcase - (car (string-tokenize (vector-ref (uname) 0) char-set:letter))))) - (define-public DOS (let ((platform (string-tokenize (vector-ref (uname) 0) char-set:letter+digit))) @@ -258,8 +243,6 @@ predicates. Print a message at LOCATION if any predicate failed." ;;(define-public (output-framework) (write "hello\n")) -(define output-tex-module - (make-module 1021 (list (resolve-interface '(scm output-tex))))) (define output-ps-module (make-module 1021 (list (resolve-interface '(scm output-ps))))) @@ -337,8 +320,11 @@ The syntax is the same as `define*-public'." "font.scm" "encoding.scm" + "flag-styles.scm" "fret-diagrams.scm" - "define-markup-commands.scm" + "harp-pedals.scm" + "predefined-fretboards.scm" + "define-markup-commands.scm" "define-grob-properties.scm" "define-grobs.scm" "define-grob-interfaces.scm" @@ -546,6 +532,8 @@ The syntax is the same as `define*-public'." (define (multi-fork count) + "Split this process in COUNT helpers. Returns either a list of pids, +or the number of the process." (define (helper count acc) (if (> count 0) (let* @@ -593,7 +581,6 @@ The syntax is the same as `define*-public'." (if (and (number? (ly:get-option 'job-count)) (>= (length files) (ly:get-option 'job-count))) - (let* ((count (ly:get-option 'job-count)) (split-todo (split-list files count)) @@ -605,8 +592,9 @@ The syntax is the same as `define*-public'." (if (number? joblist) (begin - (ly:set-option 'log-file (format "~a-~a" - (ly:get-option 'log-file) joblist)) + (ly:set-option + 'log-file (format "~a-~a" + (ly:get-option 'log-file) joblist)) (set! files (vector-ref split-todo joblist))) (begin @@ -616,25 +604,29 @@ The syntax is the same as `define*-public'." (let* ((stat (cdr (waitpid pid)))) (if (not (= stat 0)) - (set! errors (acons (list-element-index joblist pid) stat errors))))) + (set! errors + (acons (list-element-index joblist pid) + stat errors))))) joblist) (for-each (lambda (x) (let* ((job (car x)) (state (cdr x)) - (logfile (format "~a-~a.log" + (logfile (format "~a-~a.log" (ly:get-option 'log-file) job)) (log (ly:gulp-file logfile)) (len (string-length log)) (tail (substring log (max 0 (- len 1024))))) (if (status:term-sig state) - (ly:message "\n\n~a\n" - (format (_ "job ~a terminated with signal: ~a") - job - (status:term-sig state))) - (ly:message (_ "logfile ~a (exit ~a):\n~a") logfile (status:exit-val state) tail)))) + (ly:message + "\n\n~a\n" + (format (_ "job ~a terminated with signal: ~a") + job (status:term-sig state))) + (ly:message + (_ "logfile ~a (exit ~a):\n~a") + logfile (status:exit-val state) tail)))) errors) @@ -646,18 +638,15 @@ The syntax is the same as `define*-public'." (dump-profile "lily-run-total" '(0 0) (profile-measurements))) (exit (if (null? errors) 0 1)))))) - (if (string-or-symbol? (ly:get-option 'log-file)) (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w")) - (let ((failed (lilypond-all files))) (if (ly:get-option 'trace-scheme-coverage) (begin (coverage:show-all (lambda (f) (string-contains f "lilypond")) ))) - (if (pair? failed) (begin @@ -671,6 +660,11 @@ The syntax is the same as `define*-public'." (define-public (lilypond-all files) (let* ((failed '()) (separate-logs (ly:get-option 'separate-log-files)) + (ping-log + (if separate-logs + (open-file (if (string-or-symbol? (ly:get-option 'log-file)) + (format "~a.log" (ly:get-option 'log-file)) + "/dev/tty") "a") #f)) (do-measurements (ly:get-option 'dump-profile)) (handler (lambda (key failed-file) (set! failed (append (list failed-file) failed))))) @@ -687,6 +681,9 @@ The syntax is the same as `define*-public'." (if separate-logs (ly:stderr-redirect (format "~a.log" base) "w")) + (if ping-log + (format ping-log "Procesing ~a\n" base)) + (if (ly:get-option 'trace-memory-frequency) (mtrace:start-trace (ly:get-option 'trace-memory-frequency))) @@ -718,12 +715,9 @@ The syntax is the same as `define*-public'." files) ;; we want the failed-files notice in the aggregrate logfile. - (if (ly:get-option 'separate-logs) - (ly:stderr-redirect - (if (string-or-symbol? (ly:get-option 'log-file)) - (format "~a.log" (ly:get-option 'log-file)) - "/dev/tty") "a")) - + (if ping-log + (format ping-log "Failed files: ~a\n" failed)) + (if (ly:get-option 'dump-profile) (dump-profile "lily-run-total" '(0 0) (profile-measurements)))