From: Jan Nieuwenhuizen Date: Tue, 21 Sep 2004 15:17:38 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.19~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=584b22c19b252c42ec871f51358d3ab25a18c93e;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 57b6ce4b10..5c078f5577 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,13 @@ 2004-09-21 Jan Nieuwenhuizen + * lily/parse-scm.cc (internal_ly_parse_scm): Eval in module, not + in function. + + * scm/framework-tex.scm (convert-to-dvi): Use nonstopmode. Set + openout_any=p. Throughout: progress to stderr, translate user + messages. + * scm/output-gnome.scm: Fix font dir description. 2004-09-20 Han-Wen Nienhuys diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc index 5189f32479..2ad5a0c1ce 100644 --- a/lily/parse-scm.cc +++ b/lily/parse-scm.cc @@ -38,9 +38,16 @@ internal_ly_parse_scm (Parse_start * ps) /* Read expression from port. */ if (!SCM_EOF_OBJECT_P (form = scm_read (port))) { - SCM function = ly_scheme_function ("make-safe-lilypond-module"); if (ps->safe_) - answer = scm_eval (form, function); + { + static SCM module = SCM_BOOL_F; + if (module == SCM_BOOL_F) + { + SCM function = ly_scheme_function ("make-safe-lilypond-module"); + module = scm_call_0 (function); + } + answer = scm_eval (form, module); + } else answer = scm_primitive_eval (form); } diff --git a/scm/framework-tex.scm b/scm/framework-tex.scm index eeee26df6d..3b0b9ad094 100644 --- a/scm/framework-tex.scm +++ b/scm/framework-tex.scm @@ -16,7 +16,13 @@ (srfi srfi-13) (lily)) -(define-public (sanitize-tex-string s) ;; todo: rename +;; FIXME: rename +;; what is bla supposed to do? It breaks the default output terribly: + +;; \def\lilypondpaperbla$\backslash${$\backslash$}{bla$\backslash${$\backslash$}}% +;; \lyitem{089.5557}{-15.3109}{\hbox{\magfontUGQLomTVo{}bla$\backslash${$\backslash$}}}% +;; --jcn +(define-public (sanitize-tex-string s) (if (ly:get-option 'safe) (regexp-substitute/global #f "\\\\" (regexp-substitute/global #f "([{}])" "bla{}" 'pre "\\" 1 'post ) @@ -55,7 +61,8 @@ (define (define-fonts bookpaper) (string-append - "\\def\\lilypondpaperunit{mm}" ;; UGH. FIXME. + ;; UGH. FIXME. + "\\def\\lilypondpaperunit{mm}\n" (tex-number-def "lilypondpaper" 'outputscale (number->string (exact->inexact (ly:bookpaper-outputscale bookpaper)))) @@ -71,15 +78,15 @@ (if (not (equal? "-" fn)) (set! fn (string-append fn "." key))) (display - (format "Writing header field `~a' to `~a'..." + (format (_ "Writing header field `~a' to `~a'...") key (if (equal? "-" fn) "" fn) - ) + (current-error-port)) (current-error-port)) (if (equal? fn "-") (display val) (display val (open-file fn "w"))) - (display "\n" (current-error-port)) + (newline (current-error-port)) "") (define (output-scopes scopes fields basename) @@ -114,6 +121,10 @@ (tex-string-def "lilypond" 'classic "1") "") + (if (ly:get-option 'safe) + "\\nofiles\n" + "") + (tex-string-def "lilypondpaper" 'linewidth (ly:number->string (* scale (ly:output-def-lookup bookpaper 'linewidth)))) @@ -245,16 +256,24 @@ (define-public (convert-to-ps book name) (let* - ((cmd (string-append "dvips -u+ec-mftrace.map -u+lilypond.map -Ppdf " (basename name ".tex")))) + ((cmd (string-append "dvips -u+ec-mftrace.map -u+lilypond.map -Ppdf " + (basename name ".tex")))) - (display (format #f "invoking ~S" cmd)) + (display (format #f (_ "Invoking ~S") cmd) (current-error-port)) + (newline (current-error-port)) (system cmd))) (define-public (convert-to-dvi book name) (let* - ((cmd (string-append "latex " name))) + ((cmd (string-append "latex \\\\nonstopmode \\\\input " name))) - (display (format #f "invoking ~S\n" cmd)) + (display (format #f (_ "Invoking ~S") cmd) (current-error-port)) + (newline (current-error-port)) + + ;; fixme: set in environment? + (if (ly:get-option 'safe) + (set! cmd (string-append "openout_any=p " cmd))) + (system cmd))) (define-public (convert-to-tex book name) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index b47f9d4260..1c33c06ba3 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -145,37 +145,46 @@ ly:version ly:warn + ;; SCM-only functionality + set-global-staff-size + + ;; FIXME: cannot change staff size in --safe-mode + ;;$defaultbookpaper + ;;$defaultmidi + ;;$defaultpaper + ;; need these for parsing init files: ;; todo: should have a macro define-safe-public DOUBLE-FLAT - THREE-Q-FLAT + DOUBLE-SHARP FLAT - SEMI-FLAT NATURAL + SEMI-FLAT SEMI-SHARP - SHARP - THREE-Q-SHARP - DOUBLE-SHARP SEMI-TONE + SHARP START STOP + THREE-Q-FLAT + THREE-Q-SHARP + alist->hash-table + chord-name->german-markup + context-spec-music default-chord-modifier-list - sequential-music-to-chord-exceptions - make-music make-articulation make-event-chord + make-music make-penalty-music make-span-event - set-start-grace-properties - set-stop-grace-properties - set-default-paper-size - set-part-combine-listener - context-spec-music make-voice-props-revert make-voice-props-set - chord-name->german-markup note-name->german-markup + sequential-music-to-chord-exceptions + set-default-paper-size + set-part-combine-listener + set-start-grace-properties + set-stop-grace-properties Accidental_interface::after_line_breaking Accidental_interface::print