/* 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);
}
(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 )
(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))))
(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) "<stdout>" 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)
(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))))
(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)
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