diff options
author | David Kastrup <dak@gnu.org> | 2011-07-26 09:43:14 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2011-07-26 09:43:14 +0200 |
commit | fb0b572f923f29e02bc9909a4cf5cc674e5315d5 (patch) | |
tree | f3bc587633773ce63755565b6f29fdd0197c3cde | |
parent | 6b753c8f9b2f238464f399243eda0d719cd8c941 (diff) |
Fix Issue 1780: Scheme format functions with no destination parameter cause deprecation warnings in Guile V2
-rw-r--r-- | input/regression/profile-property-access.ly | 2 | ||||
-rw-r--r-- | input/regression/scheme-engraver-instance.ly | 2 | ||||
-rw-r--r-- | ly/graphviz-init.ly | 8 | ||||
-rw-r--r-- | ly/init.ly | 2 | ||||
-rw-r--r-- | ly/titling-init.ly | 2 | ||||
-rw-r--r-- | scm/backend-library.scm | 2 | ||||
-rw-r--r-- | scm/define-markup-commands.scm | 8 | ||||
-rw-r--r-- | scm/document-identifiers.scm | 6 | ||||
-rw-r--r-- | scm/document-translation.scm | 6 | ||||
-rw-r--r-- | scm/font.scm | 6 | ||||
-rw-r--r-- | scm/framework-eps.scm | 21 | ||||
-rw-r--r-- | scm/framework-ps.scm | 38 | ||||
-rw-r--r-- | scm/framework-scm.scm | 2 | ||||
-rw-r--r-- | scm/framework-socket.scm | 14 | ||||
-rw-r--r-- | scm/framework-svg.scm | 8 | ||||
-rw-r--r-- | scm/graphviz.scm | 25 | ||||
-rw-r--r-- | scm/layout-beam.scm | 4 | ||||
-rw-r--r-- | scm/lily-library.scm | 4 | ||||
-rw-r--r-- | scm/lily.scm | 48 | ||||
-rw-r--r-- | scm/output-lib.scm | 8 | ||||
-rw-r--r-- | scm/output-socket.scm | 16 | ||||
-rw-r--r-- | scm/output-svg.scm | 16 | ||||
-rw-r--r-- | scm/page.scm | 2 | ||||
-rw-r--r-- | scm/ps-to-png.scm | 10 | ||||
-rw-r--r-- | scm/stencil.scm | 2 | ||||
-rw-r--r-- | scm/translation-functions.scm | 2 | ||||
-rw-r--r-- | scripts/lilypond-invoke-editor.scm | 2 | ||||
-rw-r--r-- | scripts/musicxml2ly.py | 2 |
28 files changed, 130 insertions, 138 deletions
diff --git a/input/regression/profile-property-access.ly b/input/regression/profile-property-access.ly index be8016ffa5..13e811e0e5 100644 --- a/input/regression/profile-property-access.ly +++ b/input/regression/profile-property-access.ly @@ -34,7 +34,7 @@ Note: lilypond must be compiled with --disable-optimising for this file to work. (ly:progress "\n\n~A properties, top ~a rounded to ~a\n\n~a" what count rnd (string-join - (map (lambda (x) (format "~30a: ~6@a" (car x) (cdr x))) + (map (lambda (x) (format #f "~30a: ~6@a" (car x) (cdr x))) (ly:truncate-list! (sort alist prop-stats>?) count)) "\n")))) diff --git a/input/regression/scheme-engraver-instance.ly b/input/regression/scheme-engraver-instance.ly index 4136171a10..33296d1433 100644 --- a/input/regression/scheme-engraver-instance.ly +++ b/input/regression/scheme-engraver-instance.ly @@ -25,7 +25,7 @@ (set! private-note-counter (1+ private-note-counter)) (let ((text (ly:engraver-make-grob engraver 'TextScript event))) (ly:grob-set-property! text 'text - (format "~a.~a" instance-id + (format #f "~a.~a" instance-id private-note-counter)))))))))) } } diff --git a/ly/graphviz-init.ly b/ly/graphviz-init.ly index 2670858ffb..df797e4c0a 100644 --- a/ly/graphviz-init.ly +++ b/ly/graphviz-init.ly @@ -57,23 +57,23 @@ (set! last-grob-action (assv-set! last-grob-action grob node-id)))) #(define (truncate-value val) - (let ((val-str (format "~a" val))) + (let ((val-str (format #f "~a" val))) (string-take val-str (min 50 (string-length val-str))))) #(define (grob-mod grob file line func prop val) (let* ((val-str (truncate-value val)) - (label (format "~a\\n~a:~a\\n~a <- ~a" (grob-name grob) file line prop val-str))) + (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob-name grob) file line prop val-str))) (if (relevant? grob file line prop) (grob-event-node grob label file)))) #(define (grob-cache grob prop callback value) (let* ((val-str (truncate-value value)) - (label (format "caching ~a.~a\\n~a -> ~a" (grob-name grob) prop callback value))) + (label (format #f "caching ~a.~a\\n~a -> ~a" (grob-name grob) prop callback value))) (if (relevant? grob #f #f prop) (grob-event-node grob label #f)))) #(define (grob-create grob file line func) - (let ((label (format "~a\\n~a:~a" (grob-name grob) file line))) + (let ((label (format #f "~a\\n~a:~a" (grob-name grob) file line))) (grob-event-node grob label file))) #(ly:set-grob-modification-callback grob-mod) diff --git a/ly/init.ly b/ly/init.ly index c27d8c8409..380d9d2a0b 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -25,7 +25,7 @@ #(if (ly:get-option 'include-settings) (ly:parser-include-string parser - (format "\\include \"~a\"" (ly:get-option 'include-settings)))) + (format #f "\\include \"~a\"" (ly:get-option 'include-settings)))) \maininput %% there is a problem at the end of the input file diff --git a/ly/titling-init.ly b/ly/titling-init.ly index 73fd17fe59..679742f291 100644 --- a/ly/titling-init.ly +++ b/ly/titling-init.ly @@ -16,7 +16,7 @@ tagline = \markup { %% 2014 = em dash. #(ly:export - (format "Music engraving by LilyPond ~a~awww.lilypond.org" + (format #f "Music engraving by LilyPond ~a~awww.lilypond.org" (lilypond-version) (ly:wide-char->utf-8 #x2014) )) diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 706bccb2de..93cd2c02d8 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -117,7 +117,7 @@ (base (dir-basename filename ".ps" ".eps")) (intermediate (remove (lambda (x) (member x formats)) completed))) (for-each (lambda (f) - ((eval (string->symbol (format "convert-to-~a" f)) + ((eval (string->symbol (format #f "convert-to-~a" f)) module) paper-book filename)) completed) (if (ly:get-option 'delete-intermediate-files) (for-each (lambda (f) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 3e8953afdf..914ee2585d 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -684,7 +684,7 @@ rings = \\markup { ;; FIXME (ly:make-stencil (list 'embedded-ps - (format " + (format #f " gsave currentpoint translate 0.1 setlinewidth ~a @@ -2655,7 +2655,7 @@ Use the filled head if @var{filled} is specified. } @end lilypond" (let* - ((name (format "arrowheads.~a.~a~a" + ((name (format #f "arrowheads.~a.~a~a" (if filled "close" "open") @@ -2969,7 +2969,7 @@ Construct a note symbol, with stem. By using fractional values for @end lilypond" (define (get-glyph-name-candidates dir log style) (map (lambda (dir-name) - (format "noteheads.~a~a" dir-name + (format #f "noteheads.~a~a" dir-name (if (and (symbol? style) (not (equal? 'default style))) (select-head-glyph style (min log 2)) @@ -3451,7 +3451,7 @@ when @var{label} is not found." (page-number (if (list? table) (assoc-get label table) #f)) - (page-markup (if page-number (format "~a" page-number) default)) + (page-markup (if page-number (format #f "~a" page-number) default)) (page-stencil (interpret-markup layout props page-markup)) (gap (- (interval-length x-ext) (interval-length (ly:stencil-extent page-stencil X))))) diff --git a/scm/document-identifiers.scm b/scm/document-identifiers.scm index ffccf72c30..b456acf334 100644 --- a/scm/document-identifiers.scm +++ b/scm/document-identifiers.scm @@ -31,11 +31,11 @@ (signature-str (string-join - (map (lambda (x) (format "@var{~a} (~a)" + (map (lambda (x) (format #f "@var{~a} (~a)" (car x) (cadr x))) (zip arg-names type-names))))) - (format + (format #f "@item @code{~a}~a~a @findex ~a ~a @@ -60,7 +60,7 @@ (define-public (identifiers-doc-string) - (format + (format #f "@table @asis ~a @end table diff --git a/scm/document-translation.scm b/scm/document-translation.scm index 3e8c308d5b..b6afa8298b 100644 --- a/scm/document-translation.scm +++ b/scm/document-translation.scm @@ -145,14 +145,14 @@ (string-append "@item Set " - (format "grob-property @code{~a} " + (format #f "grob-property @code{~a} " (string-join (map symbol->string path) " ")) - (format "in @ref{~a} to ~a." + (format #f "in @ref{~a} to ~a." context-sym (scm->texi value)) "\n"))) ((equal? (object-property context-sym 'is-grob?) #t) "") ((equal? tag 'assign) - (format "@item Set translator property @code{~a} to ~a.\n" + (format #f "@item Set translator property @code{~a} to ~a.\n" context-sym (scm->texi (car args)))) ))) diff --git a/scm/font.scm b/scm/font.scm index 539e1aaee2..db07a6d998 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -185,7 +185,7 @@ used. This is used to select the proper design size for the text fonts. ,(list->vector (map (lambda (tup) (cons (ly:pt (cdr tup)) - (format "~a-~a ~a" + (format #f "~a-~a ~a" name (car tup) (ly:pt (cdr tup))))) @@ -194,12 +194,12 @@ used. This is used to select the proper design size for the text fonts. ,(list->vector (map (lambda (size-tup) (delay (ly:system-font-load - (format "~a-~a" name (car size-tup))))) + (format #f "~a-~a" name (car size-tup))))) design-size-alist ))) (fetaBraces ,(ly:pt 20.0) #(,(delay (ly:system-font-load - (format "~a-brace" name))))) + (format #f "~a-brace" name))))) ))) (define-public (add-pango-fonts node lily-family family factor) diff --git a/scm/framework-eps.scm b/scm/framework-eps.scm index 4ab6e7bddd..e67f278693 100644 --- a/scm/framework-eps.scm +++ b/scm/framework-eps.scm @@ -74,7 +74,7 @@ alignment." "Return EPS filename." (let* ((stencil (car stencil-count-pair)) (number (cdr stencil-count-pair)) - (name (format "~a-~a" basename number))) + (name (format #f "~a-~a" basename number))) (dump-stencil-as-EPS paper stencil name (ly:get-option 'include-eps-fonts)) (string-append name ".eps"))) @@ -84,7 +84,7 @@ alignment." ;; finally write some auxiliary files if desired (dump-infinite-stack-EPS stencils) (postprocess-output book framework-eps-module - (format "~a.eps" basename) (ly:output-formats)) + (format #f "~a.eps" basename) (ly:output-formats)) ;; individual staves (*-1.eps etc.); only print if more than one stencil ;; Otherwise the .eps and the -1.eps file will be identical and waste space @@ -103,7 +103,7 @@ alignment." (if create-aux-files (let* ((write-file (lambda (str-port ext) (if create-aux-files - (let* ((name (format "~a-systems.~a" basename ext)) + (let* ((name (format #f "~a-systems.~a" basename ext)) (port (open-output-file name))) (ly:message (_ "Writing ~a...") name) (display (get-output-string str-port) port) @@ -113,22 +113,21 @@ alignment." (count-system-port (open-output-string))) (for-each (lambda (c) (if (< 0 c) - (display (format + (format tex-system-port "\\ifx\\betweenLilyPondSystem \\undefined \\linebreak \\else \\expandafter\\betweenLilyPondSystem{~a}% \\fi -" c) - tex-system-port)) - (display (format "\\includegraphics{~a-~a}%\n" - basename (1+ c)) tex-system-port) - (display (format "@image{~a-~a}\n" - basename (1+ c)) texi-system-port)) +" c)) + (format tex-system-port "\\includegraphics{~a-~a}%\n" + basename (1+ c)) + (format texi-system-port "@image{~a-~a}\n" + basename (1+ c))) (iota (length stencils))) (display "@c eof\n" texi-system-port) (display "% eof\n" tex-system-port) - (display (format "~a" (length stencils)) count-system-port) + (format count-system-port "~a" (length stencils)) (write-file texi-system-port "texi") (write-file tex-system-port "tex") ;; do this as the last action so we know the rest is complete if diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 7c44920d67..e58b422b90 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -90,7 +90,7 @@ (ly:outputter-dump-string outputter (string-append - (format "%%Page: ~a ~a\n" page-number page-number) + (format #f "%%Page: ~a ~a\n" page-number page-number) "%%BeginPageSetup\n" (if landscape? "page-width output-scale lily-output-units mul mul 0 translate 90 rotate\n" @@ -112,7 +112,7 @@ (names (apply append (map extract-names fonts)))) (apply string-append (map (lambda (f) - (format + (format #f (if load-fonts? "%%DocumentSuppliedResources: font ~a\n" "%%DocumentNeededResources: font ~a\n") @@ -163,7 +163,7 @@ "%%EndComments\n")) (define (procset file-name) - (format + (format #f "%%BeginResource: procset (~a) 1 0 ~a %%EndResource @@ -171,7 +171,7 @@ file-name (cached-file-contents file-name))) (define (embed-document file-name) - (format "%%BeginDocument: ~a + (format #f "%%BeginDocument: ~a ~a %%EndDocument " @@ -190,10 +190,10 @@ (define-public (ps-embed-cff body font-set-name version) (let* ((binary-data (string-append - (format "/~a ~s StartData " font-set-name (string-length body)) + (format #f "/~a ~s StartData " font-set-name (string-length body)) body)) (header - (format + (format #f "%%BeginResource: font ~a %!PS-Adobe-3.0 Resource-FontSet %%DocumentNeededResources: ProcSet (FontSetInit) @@ -227,11 +227,11 @@ (begin (set! file-name (ly:string-substitute (ly:get-option 'datadir) "" file-name)) - (format + (format #f "lilypond-datadir (~a) concatstrings (r) file .loadfont\n" file-name)) - (format "(~a) (r) file .loadfont\n" file-name)) - (format "% cannot find font file: ~a\n" file-name))) + (format #f "(~a) (r) file .loadfont\n" file-name)) + (format #f "% cannot find font file: ~a\n" file-name))) (let* ((font (car font-name-filename)) (name (cadr font-name-filename)) @@ -243,7 +243,7 @@ (cond ((internal-font? file-name) (ps-load-file (ly:find-file - (format "~a.otf" file-name)))) + (format #f "~a.otf" file-name)))) ((string? bare-file-name) (ps-load-file file-name)) (else @@ -441,7 +441,7 @@ (define-public (output-framework basename book scopes fields) - (let* ((filename (format "~a.ps" basename)) + (let* ((filename (format #f "~a.ps" basename)) (outputter (ly:make-paper-outputter ;; FIXME: better wrap open/open-file, ;; content-mangling is always bad. @@ -531,7 +531,7 @@ ;; FIXME: better wrap open/open-file, ;; content-mangling is always bad. ;; MINGW hack: need to have "b"inary for embedding CFFs - (open-file (format "~a.eps" filename) "wb") + (open-file (format #f "~a.eps" filename) "wb") 'ps)) (port (ly:outputter-port outputter)) (rounded-bbox (to-rounded-bp-box bbox)) @@ -563,7 +563,7 @@ (bbox (list (car xext) (car yext) (cdr xext) (cdr yext))) (filename (if (< 0 count) - (format "~a-~a" basename count) + (format #f "~a-~a" basename count) basename))) (set! count (1+ count)) (dump-stencil-as-EPS-with-bbox paper @@ -572,10 +572,10 @@ (ly:get-option 'include-eps-fonts) bbox) (if do-pdf - (postscript->pdf 0 0 (format "~a.eps" filename))) + (postscript->pdf 0 0 (format #f "~a.eps" filename))) (if do-png (postscript->png (ly:get-option 'resolution) 0 0 - (format "~a.eps" filename))))) + (format #f "~a.eps" filename))))) extents-system-pairs))) (define-public (clip-system-EPSes basename paper-book) @@ -590,7 +590,7 @@ (for-each (lambda (region) (clip-systems-to-region - (format "~a-from-~a-to-~a-clip" + (format #f "~a-from-~a-to-~a-clip" basename (rhythmic-location->file-string (car region)) (rhythmic-location->file-string (cdr region))) @@ -619,7 +619,7 @@ (if (pair? system-list) (clip-score-systems (if (> count 0) - (format "~a-~a" basename count) + (format #f "~a-~a" basename count) basename) system-list))) score-system-list))) @@ -632,10 +632,10 @@ (stack-stencils Y DOWN 0.0 (map paper-system-stencil (reverse to-dump-systems))) - (format "~a.preview" basename) + (format #f "~a.preview" basename) #t) (postprocess-output book framework-ps-module - (format "~a.preview.eps" basename) + (format #f "~a.preview.eps" basename) (cons "png" (ly:output-formats))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scm/framework-scm.scm b/scm/framework-scm.scm index 51a1446302..a47eb185fd 100644 --- a/scm/framework-scm.scm +++ b/scm/framework-scm.scm @@ -15,7 +15,7 @@ (define format ergonomic-simple-format) (define-public (output-framework basename book scopes fields) - (let* ((file (open-output-file (format "~a.scm" basename)))) + (let* ((file (open-output-file (format #f "~a.scm" basename)))) (display ";;Creator: LilyPond\n" file) (display ";; raw SCM output\n" file) diff --git a/scm/framework-socket.scm b/scm/framework-socket.scm index abaaa08ec9..dd54293555 100644 --- a/scm/framework-socket.scm +++ b/scm/framework-socket.scm @@ -36,7 +36,7 @@ (define-public (output-framework channel book scopes fields) (let* ((ctor-arg (if (string? channel) - (open-output-file (format "~a.socket" channel)) + (open-output-file (format #f "~a.socket" channel)) channel)) (outputter (ly:make-paper-outputter ctor-arg @@ -48,27 +48,27 @@ (let* ((system-stencil (paper-system-stencil x)) (x-extent (ly:stencil-extent system-stencil X)) (y-extent (ly:stencil-extent system-stencil Y))) - (format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n" - (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent))) + (display (ly:format "system ~4l ~4l ~4l ~4l\n" + (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)) ctor-arg) (ly:outputter-dump-stencil outputter system-stencil))) systems))) (define-public (output-classic-framework channel book scopes fields) (let* ((ctor-arg (if (string? channel) - (open-output-file (format "~a.socket" channel)) + (open-output-file (format #f "~a.socket" channel)) channel)) (outputter (ly:make-paper-outputter ctor-arg 'socket)) (systems (ly:paper-book-systems book)) (paper (ly:paper-book-paper book))) - (format ctor-arg (ly:format "paper ~4l\n" (get-page-dimensions paper))) + (display (ly:format "paper ~4l\n" (get-page-dimensions paper)) ctor-arg) (for-each (lambda (x) (let* ((system-stencil (paper-system-stencil x)) (x-extent (ly:stencil-extent system-stencil X)) (y-extent (ly:stencil-extent system-stencil Y))) - (format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n" - (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent))) + (display (ly:format "system ~4l ~4l ~4l ~4l\n" + (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)) ctor-arg) (ly:outputter-dump-stencil outputter system-stencil))) systems))) diff --git a/scm/framework-svg.scm b/scm/framework-svg.scm index f10125caa8..ad707a7b89 100644 --- a/scm/framework-svg.scm +++ b/scm/framework-svg.scm @@ -132,7 +132,7 @@ src: url('~a'); (module-remove! (ly:outputter-module outputter) 'paper)) (if (ly:get-option 'svg-woff) (dump (woff-header paper (dirname filename)))) - (dump (comment (format "Page: ~S/~S" page-number page-count))) + (dump (comment (format #f "Page: ~S/~S" page-number page-count))) (ly:outputter-output-scheme outputter `(begin (set! lily-unit-length ,unit-length) "")) @@ -178,11 +178,11 @@ src: url('~a'); (page-count (length page-stencils)) (filename "") (file-suffix (lambda (num) - (if (= page-count 1) "" (format "-page-~a" num))))) + (if (= page-count 1) "" (format #f "-page-~a" num))))) (for-each (lambda (page) (set! page-number (1+ page-number)) - (set! filename (format "~a~a.svg" + (set! filename (format #f "~a~a.svg" basename (file-suffix page-number))) (dump-page paper filename page page-number page-count)) @@ -196,4 +196,4 @@ src: url('~a'); (stack-stencils Y DOWN 0.0 (map paper-system-stencil (reverse to-dump-systems))) - (format "~a.preview.svg" basename)))) + (format #f "~a.preview.svg" basename)))) diff --git a/scm/graphviz.scm b/scm/graphviz.scm index f6fd8fa9e4..ac60a94650 100644 --- a/scm/graphviz.scm +++ b/scm/graphviz.scm @@ -61,18 +61,17 @@ (let ((ns (nodes graph)) (es (edges graph)) (cs (clusters graph))) - (ly:message (format (_ "Writing graph `~a'...") (port-filename out))) + (ly:message (format #f (_ "Writing graph `~a'...") (port-filename out))) (display "digraph G {\nrankdir=\"LR\"\nnode [shape=rectangle]\n" out) - (map (lambda (n) (display (format "~a [label=\"~a\"]\n" (car n) (cdr n)) out)) - ns) - (map (lambda (e) (display (format "~a -> ~a\n" (car e) (cdr e)) out)) - es) - (map (lambda (c) - (display (format "subgraph cluster_~a {\nlabel= \"~a\"\ncolor=blue\n" - (string-filter (car c) char-alphabetic?) - (car c)) - out) - (map (lambda (n) (display (format "~a\n" n) out)) (cdr c)) - (display "}\n" out)) - cs) + (for-each (lambda (n) (format out "~a [label=\"~a\"]\n" (car n) (cdr n))) + ns) + (for-each (lambda (e) (format out "~a -> ~a\n" (car e) (cdr e))) + es) + (for-each (lambda (c) + (format out "subgraph cluster_~a {\nlabel= \"~a\"\ncolor=blue\n" + (string-filter (car c) char-alphabetic?) + (car c)) + (for-each (lambda (n) (format out "~a\n" n)) (cdr c)) + (display "}\n" out)) + cs) (display "}" out))) diff --git a/scm/layout-beam.scm b/scm/layout-beam.scm index 4ef49e9759..aa35be0d63 100644 --- a/scm/layout-beam.scm +++ b/scm/layout-beam.scm @@ -40,7 +40,7 @@ (ly:warning (_ "Error in beam quanting. Expected (~S,~S) found ~S.") want-l want-r posns) (set! (ly:grob-property beam 'annotation) - (format "(~S,~S)" want-l want-r)))) + (format #f "(~S,~S)" want-l want-r)))) posns)))) (define check-beam-slope-sign @@ -54,7 +54,7 @@ (ly:warning (_ "Error in beam quanting. Expected ~S 0, found ~S.") (procedure-name comparison) slope-sign) (set! (ly:grob-property beam 'annotation) - (format "~S 0" (procedure-name comparison)))) + (format #f "~S 0" (procedure-name comparison)))) (set! (ly:grob-property beam 'annotation) "")) posns)))) diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 0e2c810da9..ede65ff5e2 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -179,14 +179,14 @@ bookoutput function" ;; as the key to out internal a-list (let* ((base-name (get-current-filename parser)) (output-suffix (get-current-suffix parser)) - (alist-key (format "~a~a" base-name output-suffix)) + (alist-key (format #f "~a~a" base-name output-suffix)) (counter-alist (ly:parser-lookup parser 'counter-alist)) (output-count (assoc-get alist-key counter-alist 0)) (result base-name)) ;; Allow all ASCII alphanumerics, including accents (if (string? output-suffix) (set! result - (format "~a-~a" + (format #f "~a-~a" result (string-regexp-substitute "[^-[:alnum:]]" diff --git a/scm/lily.scm b/scm/lily.scm index 203a449c8f..17c8d1776b 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -585,7 +585,7 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (assoc-get 'total-cells-allocated stats 0)))) (define (dump-profile base last this) - (let* ((outname (format "~a.profile" (dir-basename base ".ly"))) + (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) (format (open-file outname "w") @@ -622,18 +622,15 @@ LilyPond safe mode. The syntax is the same as `define*-public'." ".scm")) (outfile (open-file out-file-name "w"))) (set! gc-dumping #t) - (display (format "Dumping GC statistics ~a...\n" out-file-name)) - (display (map (lambda (y) - (let ((x (car y)) - (c (cdr y))) - (display - (format "~a (~a) = ~a\n" (object-address x) c x) - outfile))) - (filter - (lambda (x) - (not (symbol? (car x)))) - protects)) - outfile) + (format #t "Dumping GC statistics ~a...\n" out-file-name) + (for-each (lambda (y) + (let ((x (car y)) + (c (cdr y))) + (format outfile "~a (~a) = ~a\n" (object-address x) c x))) + (filter + (lambda (x) + (not (symbol? (car x)))) + protects)) (format outfile "\nprotected symbols: ~a\n" (apply + (map (lambda (obj-count) (if (symbol? (car obj-count)) @@ -659,13 +656,10 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (newline outfile) (let* ((stats (gc-stats))) (for-each (lambda (sym) - (display - (format "~a ~a ~a\n" - gc-protect-stat-count - sym - (assoc-get sym stats "?")) - - outfile)) + (format outfile "~a ~a ~a\n" + gc-protect-stat-count + sym + (assoc-get sym stats "?"))) '(protected-objects bytes-malloced cell-heap-size))) (set! gc-dumping #f) (close-port outfile))) @@ -686,7 +680,7 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (string-match "^VmData:[ \t]*([0-9]*) kB" l)) lines))) (mem (string->number (match:substring (car interesting) 1)))) - (display (format "VMDATA: ~a\n" mem)) + (format #t "VMDATA: ~a\n" mem) (display (gc-stats)) (if (> mem 100000) (begin (dump-gc-protects) @@ -752,7 +746,7 @@ PIDs or the number of the process." (ly:set-option 'log-file "lilypond-multi-run")) (if (number? joblist) (begin (ly:set-option - 'log-file (format "~a-~a" + 'log-file (format #f "~a-~a" (ly:get-option 'log-file) joblist)) (set! files (vector-ref split-todo joblist))) (begin (ly:progress "\nForking into jobs: ~a\n" joblist) @@ -768,7 +762,7 @@ PIDs or the number of the process." (lambda (x) (let* ((job (car x)) (state (cdr x)) - (logfile (format "~a-~a.log" + (logfile (format #f "~a-~a.log" (ly:get-option 'log-file) job)) (log (ly:gulp-file logfile)) (len (string-length log)) @@ -776,7 +770,7 @@ PIDs or the number of the process." (if (status:term-sig state) (ly:message "\n\n~a\n" - (format (_ "job ~a terminated with signal: ~a") + (format #f (_ "job ~a terminated with signal: ~a") job (status:term-sig state))) (ly:message (_ "logfile ~a (exit ~a):\n~a") @@ -794,7 +788,7 @@ PIDs or the number of the process." (ly:exit 1 #f)))))) (if (string-or-symbol? (ly:get-option 'log-file)) - (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w")) + (ly:stderr-redirect (format #f "~a.log" (ly:get-option 'log-file)) "w")) (let ((failed (lilypond-all files))) (if (ly:get-option 'trace-scheme-coverage) (begin @@ -813,7 +807,7 @@ PIDs or the number of the process." (ping-log (if separate-logs (open-file (if (string-or-symbol? (ly:get-option 'log-file)) - (format "~a.log" (ly:get-option 'log-file)) + (format #f "~a.log" (ly:get-option 'log-file)) "/dev/stderr") "a") #f)) (do-measurements (ly:get-option 'dump-profile)) (handler (lambda (key failed-file) @@ -827,7 +821,7 @@ PIDs or the number of the process." (base (dir-basename x ".ly")) (all-settings (ly:all-options))) (if separate-logs - (ly:stderr-redirect (format "~a.log" base) "w")) + (ly:stderr-redirect (format #f "~a.log" base) "w")) (if ping-log (format ping-log "Processing ~a\n" base)) (if (ly:get-option 'trace-memory-frequency) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 1081377907..5d4bdb1b61 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -333,7 +333,7 @@ and duration-log @var{log}." (define-public (tuplet-number::calc-fraction-text grob) (let ((ev (event-cause grob))) - (format "~a:~a" + (format #f "~a:~a" (ly:event-property ev 'denominator) (ly:event-property ev 'numerator)))) @@ -363,7 +363,7 @@ and duration-log @var{log}." (den (if denominator denominator (ly:event-property ev 'denominator))) (num (if numerator numerator (ly:event-property ev 'numerator)))) - (format "~a:~a" den num))) + (format #f "~a:~a" den num))) ;; Print a tuplet fraction with note durations appended to the numerator and the ;; denominator @@ -385,10 +385,10 @@ and duration-log @var{log}." (num (if numerator numerator (ly:event-property ev 'numerator)))) (make-concat-markup (list - (make-simple-markup (format "~a" den)) + (make-simple-markup (format #f "~a" den)) (markup #:fontsize -5 #:note denominatornote UP) (make-simple-markup " : ") - (make-simple-markup (format "~a" num)) + (make-simple-markup (format #f "~a" num)) (markup #:fontsize -5 #:note numeratornote UP))))) diff --git a/scm/output-socket.scm b/scm/output-socket.scm index c86047815a..310db4f58b 100644 --- a/scm/output-socket.scm +++ b/scm/output-socket.scm @@ -49,17 +49,17 @@ ;;; (define (bezier-sandwich lst thick) - (format "bezier_sandwich ~a [~a]" + (format #f "bezier_sandwich ~a [~a]" thick (string-append (string-join (map (lambda (x) - (format "(~a,~a)" (car x) (cdr x))) + (format #f "(~a,~a)" (car x) (cdr x))) lst) ",")))) (define (draw-line thick x1 y1 x2 y2) - (format "drawline ~a ~a ~a ~a ~a" + (format #f "drawline ~a ~a ~a ~a ~a" thick x1 y2 x2 y2)) (define (grob-cause offset grob) @@ -75,7 +75,7 @@ (grob-bbox grob offset))))) (define (named-glyph font glyph) - (format "glyphshow ~a \"~a\" ~a \"~a\"" + (format #f "glyphshow ~a \"~a\" ~a \"~a\"" (ly:font-glyph-name-to-charcode font glyph) (ly:font-name font) (modified-font-metric-font-scaling font) @@ -86,21 +86,21 @@ (define (placebox x y s) (if (not (string-null? s)) - (format "at ~a ~a ~a\n" x y s) + (format #f "at ~a ~a ~a\n" x y s) "")) (define (polygon xy-coords blot do-fill) - (format "polygon ~a ~a ~a" + (format #f "polygon ~a ~a ~a" blot (if do-fill "True" "False") (string-join (map number->string xy-coords)))) (define (round-filled-box breapth width depth height blot-diameter) - (format "draw_round_box ~a ~a ~a ~a ~a" + (format #f "draw_round_box ~a ~a ~a ~a ~a" breapth width depth height blot-diameter)) (define (utf-8-string descr string) - (format "utf-8 \"~a\" \"~a\"" + (format #f "utf-8 \"~a\" \"~a\"" (escape-string descr) ;; don't want unescaped spaces. (escape-string string))) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 3132175414..d993c35635 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -55,20 +55,20 @@ (value (cdr x))) (if (number? value) (set! value (ly:format "~4f" value))) - (format " ~s=\"~a\"" attr value))) + (format #f " ~s=\"~a\"" attr value))) attributes-alist))) (define-public (eo entity . attributes-alist) "o = open" - (format "<~S~a>\n" entity (attributes attributes-alist))) + (format #f "<~S~a>\n" entity (attributes attributes-alist))) (define-public (eoc entity . attributes-alist) "oc = open/close" - (format "<~S~a/>\n" entity (attributes attributes-alist))) + (format #f "<~S~a/>\n" entity (attributes attributes-alist))) (define-public (ec entity) "c = close" - (format "</~S>\n" entity)) + (format #f "</~S>\n" entity)) (define-public (comment s) (string-append "<!-- " s " -->\n")) @@ -86,7 +86,7 @@ (define (helper lst) (if (null? lst) '() - (cons (format "~S ~S" (car lst) (- (cadr lst))) + (cons (format #f "~S ~S" (car lst) (- (cadr lst))) (helper (cddr lst))))) (string-join (helper lst) " ")) @@ -351,7 +351,7 @@ (define (dashed-line thick on off dx dy phase) (draw-line thick 0 0 dx dy - `(stroke-dasharray . ,(format "~a,~a" on off)))) + `(stroke-dasharray . ,(format #f "~a,~a" on off)))) (define (draw-line thick x1 y1 x2 y2 . alist) (apply entity 'line "" @@ -539,7 +539,7 @@ (closepath . z)) ""))) - (cons (format "~a~a" svg-head (number-list->point args)) + (cons (format #f "~a~a" svg-head (number-list->point args)) (convert-path-exps (drop rest arity)))) '())) @@ -637,7 +637,7 @@ '(fill . "currentColor"))) (define (setcolor r g b) - (format "<g color=\"rgb(~a%, ~a%, ~a%)\">\n" + (format #f "<g color=\"rgb(~a%, ~a%, ~a%)\">\n" (* 100 r) (* 100 g) (* 100 b))) ;; rotate around given point diff --git a/scm/page.scm b/scm/page.scm index f65c9559d3..0a30acef4d 100644 --- a/scm/page.scm +++ b/scm/page.scm @@ -69,7 +69,7 @@ (lambda (j) (module-define! page-module - (string->symbol (format "page-~a" j)) + (string->symbol (format #f "page-~a" j)) (lambda (pg) (page-property pg j)))) diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 17f822247b..80bb58abcc 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -111,7 +111,7 @@ (pixmap-format 'png16m) (anti-alias-factor 1)) - (let* ((format-str (format "~a" pixmap-format)) + (let* ((format-str (format #f "~a" pixmap-format)) (extension (cond ((string-contains format-str "png") "png") ((string-contains format-str "jpg") "jpeg") @@ -119,8 +119,8 @@ (else (ly:error "Unknown pixmap format ~a" pixmap-format)))) (base (dir-basename ps-name ".ps" ".eps")) - (png1 (format "~a.~a" base extension)) - (pngn (format "~a-page%d.~a" base extension)) + (png1 (format #f "~a.~a" base extension)) + (pngn (format #f "~a-page%d.~a" base extension)) (page-count (ps-page-count ps-name)) (multi-page? (> page-count 1)) (output-file (if multi-page? pngn png1)) @@ -163,9 +163,9 @@ (if multi-page? (map (lambda (n) - (format "~a-page~a.png" base (1+ n))) + (format #f "~a-page~a.png" base (1+ n))) (iota page-count)) - (list (format "~a.png" base)))) + (list (format #f "~a.png" base)))) (if (not (= 0 status)) (begin diff --git a/scm/stencil.scm b/scm/stencil.scm index 64f48cc89d..2f31d343f5 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -640,7 +640,7 @@ with optional arrows of @code{max-size} on start and end controlled by (markup #:whiteout #:simple (cond ((interval-empty? extent) - (format "empty")) + "empty") (is-length (ly:format "~$" (interval-length extent))) (else diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 94862688fd..314e66ff59 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -565,7 +565,7 @@ only ~a fret labels provided") (define-public (fret-number-tablature-format context string-number fret-number) (make-vcenter-markup - (format "~a" fret-number))) + (format #f "~a" fret-number))) ;; The 5-string banjo has got a extra string, the fifth (duh), which ;; starts at the fifth fret on the neck. Frets on the fifth string diff --git a/scripts/lilypond-invoke-editor.scm b/scripts/lilypond-invoke-editor.scm index 230b1761d4..e993378cb8 100644 --- a/scripts/lilypond-invoke-editor.scm +++ b/scripts/lilypond-invoke-editor.scm @@ -129,7 +129,7 @@ Options: (define (run-browser uri) (system (if (getenv "BROWSER") - (format "~a ~a" (getenv "BROWSER") uri) + (format #f "~a ~a" (getenv "BROWSER") uri) (format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri)))) diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index defc576b1f..2b630029b6 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -68,7 +68,7 @@ additional_definitions = { (let* ((ev (event-cause grob)) (den (if denominator denominator (ly:event-property ev 'denominator))) (num (if numerator numerator (ly:event-property ev 'numerator)))) - (format "~a:~a" den num))) + (format #f "~a:~a" den num))) """, } |