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))
18 ;(debug-enable 'backtrace)
21 (define point-and-click #f)
22 (define security-paranoia #f)
23 (define midi-debug #f)
25 (define (line-column-location line col file)
26 "Print an input location, including column number ."
27 (string-append (number->string line) ":"
28 (number->string col) " " file)
31 (define (line-location line col file)
32 "Print an input location, without column number ."
33 (string-append (number->string line) " " file)
36 ;; cpp hack to get useful error message
37 (define ifdef "First run this through cpp.")
38 (define ifndef "First run this through cpp.")
40 (define default-script-alist '())
41 (define font-name-alist '())
43 (if (not (defined? 'standalone))
44 (define standalone (not (defined? 'ly-gulp-file))))
46 ;; The regex module may not be available, or may be broken.
48 (let ((os (string-downcase (vector-ref (uname) 0))))
49 (not (equal? "cygwin" (substring os 0 (min 6 (string-length os)))))))
51 ;; If you have trouble with regex, define #f
53 ;;(define use-regex #f)
58 ;; URG guile-1.4/1.4.x compatibility
59 (if (not (defined? 'primitive-eval))
60 (define (primitive-eval form)
68 (define (write-me n x)
80 (define (filter-list pred? list)
81 "return that part of LIST for which PRED is true."
83 (let* ((rest (filter-list pred? (cdr list))))
84 (if (pred? (car list))
85 (cons (car list) rest)
88 (define (filter-out-list pred? list)
89 "return that part of LIST for which PRED is true."
91 (let* ((rest (filter-list pred? (cdr list))))
92 (if (not (pred? (car list)))
93 (cons (car list) rest)
96 (define (uniqued-alist alist acc)
98 (if (assoc (caar alist) acc)
99 (uniqued-alist (cdr alist) acc)
100 (uniqued-alist (cdr alist) (cons (car alist) acc)))))
102 (define (uniq-list list)
104 (if (null? (cdr list))
106 (if (equal? (car list) (cadr list))
107 (uniq-list (cdr list))
108 (cons (car list) (uniq-list (cdr list)))))))
110 (define (alist<? x y)
111 (string<? (symbol->string (car x))
112 (symbol->string (car y))))
118 (fn (%search-load-path x))
121 (format (current-error-port) "[~A]" fn))
129 (use-modules (scm tex)
139 ("tex" . ,tex-output-expression)
140 ("ps" . ,ps-output-expression)
142 ("as" . ,as-output-expression)
143 ("pysk" . ,pysk-output-expression)
144 ("sketch" . ,sketch-output-expression)
145 ("pdftex" . ,pdftex-output-expression)
149 (define (find-dumper format )
151 ((d (assoc format output-alist)))
155 scm-output-expression)
174 "grob-property-description.scm"
175 "context-description.scm"
176 "interface-description.scm"
181 "music-functions.scm"
182 "music-property-description.scm"
184 "basic-properties.scm"
186 "grob-description.scm"
187 "translator-property-description.scm"