X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flily.scm;h=c670eb15bf31e90ac6218fe08df33ebcd9e31847;hb=e426ea7b5af83739ab2f3a255e8cbac55b16e6ec;hp=0f711ed19331df8fdc185e87d4bf1f605199c570;hpb=cf137655b7aee9988ef536d6fa5e38d279ee73cf;p=lilypond.git diff --git a/scm/lily.scm b/scm/lily.scm index 0f711ed193..c670eb15bf 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen +;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify @@ -41,7 +41,25 @@ (define-public PLATFORM (string->symbol (string-downcase - (car (string-tokenize (utsname:sysname (uname))))))) + (car (string-tokenize (utsname:sysname (uname)) char-set:letter))))) + +;; We don't use (srfi srfi-39) (parameter objects) here because that +;; does not give us a name/handle to the underlying fluids themselves. + +(define %parser (make-fluid)) +(define %location (make-fluid)) +;; No public setters: should not get overwritten in action +(define-public (*parser*) (fluid-ref %parser)) +(define-public (*location*) (fluid-ref %location)) +;; but properly scoped location should be fine +(defmacro-public with-location (loc . body) + `(with-fluids ((,%location ,loc)) ,@body)) + +;; It would be nice to convert occurences of parser/location to +;; (*parser*)/(*location*) using the syncase module but it is utterly +;; broken in GUILE 1 and would require changing a lot of unrelated +;; innocuous constructs which just happen to fall apart with +;; inscrutable error messages. ;; ;; Session-handling variables and procedures. @@ -277,7 +295,7 @@ file to given string.") to a music font.") (point-and-click #t - "Add point & click links to PDF output.") + "Add point & click links to PDF and SVG output.") (paper-size "a4" "Set default paper size.") @@ -330,6 +348,12 @@ floating point exceptions.") #t "Don't use directories from input files while constructing output file names.") + (strokeadjust + #f + "Set the PostScript strokeadjust operator explicitly. +This employs different drawing primitives, resulting in +large PDF file size increases but often markedly better +PDF previews.") (svg-woff #f "Use woff font files in SVG backend.") @@ -405,8 +429,8 @@ messages into errors.") (define-public (ergonomic-simple-format dest . rest) "Like ice-9's @code{format}, but without the memory consumption." (if (string? dest) - (apply simple-format (cons #f (cons dest rest))) - (apply simple-format (cons dest rest)))) + (apply simple-format #f dest rest) + (apply simple-format dest rest))) (define format ergonomic-simple-format) @@ -420,7 +444,7 @@ messages into errors.") v) (define-public (print . args) - (apply format (cons (current-output-port) args))) + (apply format (current-output-port) args)) ;;; General settings. @@ -440,8 +464,6 @@ messages into errors.") (if (ly:get-option 'trace-scheme-coverage) (coverage:enable)) -(define-public parser #f) - (define music-string-to-path-backends '(svg)) @@ -541,9 +563,9 @@ messages into errors.") "c++.scm" "chord-entry.scm" "skyline.scm" - "stencil.scm" - "define-markup-commands.scm" "markup.scm" + "define-markup-commands.scm" + "stencil.scm" "modal-transforms.scm" "chord-generic-names.scm" "chord-ignatzek-names.scm" @@ -551,11 +573,11 @@ messages into errors.") "part-combiner.scm" "autochange.scm" "define-music-properties.scm" + "time-signature.scm" "time-signature-settings.scm" "auto-beam.scm" "chord-name.scm" "bezier-tools.scm" - "ly-syntax-constructors.scm" "define-context-properties.scm" "translation-functions.scm" @@ -662,6 +684,8 @@ messages into errors.") (,number-or-pair? . "number or pair") (,number-or-string? . "number or string") (,number-pair? . "pair of numbers") + (,number-pair-list? . "list of number pairs") + (,rational-or-procedure? . "an exact rational or procedure") (,rhythmic-location? . "rhythmic location") (,scheme? . "any type") (,string-or-pair? . "string or pair") @@ -687,6 +711,7 @@ messages into errors.") (,ly:font-metric? . "font metric") (,ly:grob? . "graphical (layout) object") (,ly:grob-array? . "array of grobs") + (,ly:grob-properties? . "grob properties") (,ly:input-location? . "input location") (,ly:item? . "item") (,ly:iterator? . "iterator") @@ -707,7 +732,6 @@ messages into errors.") (,ly:pitch? . "pitch") (,ly:prob? . "property object") (,ly:score? . "score") - (,ly:simple-closure? . "simple closure") (,ly:skyline? . "skyline") (,ly:skyline-pair? . "pair of skylines") (,ly:source-file? . "source file") @@ -717,6 +741,7 @@ messages into errors.") (,ly:stream-event? . "stream event") (,ly:translator? . "translator") (,ly:translator-group? . "translator group") + (,ly:undead? . "undead container") (,ly:unpure-pure-container? . "unpure/pure container") )) @@ -742,8 +767,8 @@ messages into errors.") (define (dump-profile base last this) (let* ((outname (format #f "~a.profile" (dir-basename base ".ly"))) - (diff (map (lambda (y) (apply - y)) (zip this last)))) - (ly:progress "\nWriting timing to ~a..." outname) + (diff (map - this last))) + (ly:progress "\nWriting timing to ~a...\n" outname) (format (open-file outname "w") "time: ~a\ncells: ~a\n" (if (ly:get-option 'dump-cpu-profile) @@ -841,11 +866,10 @@ messages into errors.") (let* ((stat (gulp-file "/proc/self/status")) (lines (string-split stat #\newline)) - (interesting (filter identity - (map - (lambda (l) - (string-match "^VmData:[ \t]*([0-9]*) kB" l)) - lines))) + (interesting (filter-map + (lambda (l) + (string-match "^VmData:[ \t]*([0-9]*) kB" l)) + lines)) (mem (string->number (match:substring (car interesting) 1)))) (format #t "VMDATA: ~a\n" mem) (display (gc-stats)) @@ -898,12 +922,11 @@ PIDs or the number of the process." (ly:exit 2 #t))) (if (ly:get-option 'read-file-list) (set! files - (filter (lambda (s) - (> (string-length s) 0)) - (apply append - (map (lambda (f) - (string-split (string-delete (ly:gulp-file f) #\cr) #\nl)) - files))))) + (remove string-null? + (append-map + (lambda (f) + (string-split (string-delete (ly:gulp-file f) #\cr) #\nl)) + files)))) (if (and (number? (ly:get-option 'job-count)) (>= (length files) (ly:get-option 'job-count))) (let* ((count (ly:get-option 'job-count))