1 ;;;; lily.scm -- implement Scheme output routines for TeX and PostScript
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2001 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 (use-modules (ice-9 regex))
12 ;;(write standalone (current-error-port))
19 (debug-enable 'backtrace)
22 (define point-and-click #f)
23 (define security-paranoia #f)
24 (define midi-debug #f)
26 (define (line-column-location line col file)
27 "Print an input location, including column number ."
28 (string-append (number->string line) ":"
29 (number->string col) " " file)
32 (define (line-location line col file)
33 "Print an input location, without column number ."
34 (string-append (number->string line) " " file)
37 ;; cpp hack to get useful error message
38 (define ifdef "First run this through cpp.")
39 (define ifndef "First run this through cpp.")
41 (define default-script-alist '())
42 (define font-name-alist '())
44 (if (not (defined? 'standalone))
45 (define standalone (not (defined? 'ly-gulp-file))))
47 ;; The regex module may not be available, or may be broken.
49 (let ((os (string-downcase (vector-ref (uname) 0))))
50 (not (equal? "cygwin" (substring os 0 (min 6 (string-length os)))))))
52 ;; If you have trouble with regex, define #f
54 ;;(define use-regex #f)
59 ;; URG guile-1.4/1.4.x compatibility
60 (if (not (defined? 'primitive-eval))
61 (define (primitive-eval form)
69 (define (write-me n x)
81 (define (filter-list pred? list)
82 "return that part of LIST for which PRED is true."
84 (let* ((rest (filter-list pred? (cdr list))))
85 (if (pred? (car list))
86 (cons (car list) rest)
89 (define (filter-out-list pred? list)
90 "return that part of LIST for which PRED is true."
92 (let* ((rest (filter-list pred? (cdr list))))
93 (if (not (pred? (car list)))
94 (cons (car list) rest)
97 (define (uniqued-alist alist acc)
99 (if (assoc (caar alist) acc)
100 (uniqued-alist (cdr alist) acc)
101 (uniqued-alist (cdr alist) (cons (car alist) acc)))))
103 (define (uniq-list list)
105 (if (null? (cdr list))
107 (if (equal? (car list) (cadr list))
108 (uniq-list (cdr list))
109 (cons (car list) (uniq-list (cdr list)))))))
111 (define (alist<? x y)
112 (string<? (symbol->string (car x))
113 (symbol->string (car y))))
116 (define (ly-load x) (eval-string (ly-gulp-file x)))
118 (ly-load "output-lib.scm")
122 (use-modules (scm tex)
131 ("tex" . ,tex-output-expression)
132 ("ps" . ,ps-output-expression)
134 ("as" . ,as-output-expression)
135 ("pysk" . ,pysk-output-expression)
136 ("sketch" . ,sketch-output-expression)
142 (define (find-dumper format )
144 ((d (assoc format output-alist)))
148 scm-output-expression)
161 "grob-property-description.scm"
162 "translator-property-description.scm"
163 "context-description.scm"
164 "interface-description.scm"
169 "music-functions.scm"
170 "music-property-description.scm"
172 "generic-property.scm"
173 "basic-properties.scm"
175 "grob-description.scm"