+ (cond ((eq? action-name 'all-definitions)
+ `(begin
+ (define beam ,beam)
+ (define bracket ,bracket)
+ (define char ,char)
+ ;;(define crescendo ,crescendo)
+ (define bezier-sandwich ,bezier-sandwich)
+ ;;(define dashed-slur ,dashed-slur)
+ ;;(define decrescendo ,decrescendo)
+ (define end-output ,end-output)
+ (define experimental-on ,experimental-on)
+ (define filledbox ,filledbox)
+ ;;(define font-def ,font-def)
+ (define font-load-command ,font-load-command)
+ ;;(define font-switch ,font-switch)
+ (define header ,header)
+ (define header-end ,header-end)
+ (define lily-def ,lily-def)
+ ;;(define invoke-char ,invoke-char)
+ ;;(define invoke-dim1 ,invoke-dim1)
+ (define placebox ,placebox)
+ (define select-font ,select-font)
+ (define start-line ,start-line)
+ ;;(define stem ,stem)
+ (define stop-line ,stop-line)
+ (define stop-last-line ,stop-line)
+ (define text ,text)
+ ;;(define tuplet ,tuplet)
+ (define volta ,volta)
+ ))
+ ;;((eq? action-name 'tuplet) tuplet)
+ ;;((eq? action-name 'beam) beam)
+ ;;((eq? action-name 'bezier-sandwich) bezier-sandwich)
+ ;;((eq? action-name 'bracket) bracket)
+ ((eq? action-name 'char) char)
+ ;;((eq? action-name 'crescendo) crescendo)
+ ;;((eq? action-name 'dashed-slur) dashed-slur)
+ ;;((eq? action-name 'decrescendo) decrescendo)
+ ;;((eq? action-name 'experimental-on) experimental-on)
+ ((eq? action-name 'filledbox) filledbox)
+ ((eq? action-name 'select-font) select-font)
+ ;;((eq? action-name 'volta) volta)
+ (else (error "unknown tag -- MUSA-SCM " action-name))
+ )
+ )
+
+
+(define (gulp-file name)
+ (let* ((port (open-file name "r"))
+ (content (let loop ((text ""))
+ (let ((line (read-line port)))
+ (if (or (eof-object? line)
+ (not line))
+ text
+ (loop (string-append text line "\n")))))))
+ (close port)
+ content))
+
+(define (scm-gulp-file name)
+ (set! %load-path
+ (cons (string-append
+ (getenv 'LILYPONDPREFIX) "/ps") %load-path))
+ (let ((path (%search-load-path name)))
+ (if path
+ (gulp-file path)
+ (gulp-file name))))
+
+(define (scm-tex-output)
+ (eval (tex-scm 'all-definitions)))
+
+(define (scm-ps-output)
+ (eval (ps-scm 'all-definitions)))
+
+(define (scm-as-output)
+ (eval (as-scm 'all-definitions)))
+
+; Russ McManus, <mcmanus@IDT.NET>
+;
+; I use the following, which should definitely be provided somewhere
+; in guile, but isn't, AFAIK:
+;
+;
+
+(define (hash-table-for-each fn ht)
+ (do ((i 0 (+ 1 i)))
+ ((= i (vector-length ht)))
+ (do ((alist (vector-ref ht i) (cdr alist)))
+ ((null? alist) #t)
+ (fn (car (car alist)) (cdr (car alist))))))
+
+(define (hash-table-map fn ht)
+ (do ((i 0 (+ 1 i))
+ (ret-ls '()))
+ ((= i (vector-length ht)) (reverse ret-ls))
+ (do ((alist (vector-ref ht i) (cdr alist)))
+ ((null? alist) #t)
+ (set! ret-ls (cons (fn (car (car alist)) (cdr (car alist))) ret-ls)))))
+
+
+
+(define (index-cell cell dir)
+ (if (equal? dir 1)
+ (cdr cell)
+ (car cell)))
+
+;
+; How should a bar line behave at a break?
+;
+(define (break-barline glyph dir)
+ (let ((result (assoc glyph
+ '((":|:" . (":|" . "|:"))
+ ("|" . ("|" . ""))
+ ("|s" . (nil . "|"))
+ ("|:" . ("|" . "|:"))
+ ("|." . ("|." . nil))
+ (":|" . (":|" . nil))
+ ("||" . ("||" . nil))
+ (".|." . (".|." . nil))
+ ("scorebar" . (nil . "scorepostbreak"))
+ ("brace" . (nil . "brace"))
+ ("bracket" . (nil . "bracket"))
+ )
+ )))
+
+ (if (equal? result #f)
+ (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
+ (index-cell (cdr result) dir))
+ )
+ )
+
+
+(define (slur-ugly ind ht)
+ (if (and
+; (< ht 4.0)
+ (< ht (* 4 ind))
+ (> ht (* 0.4 ind))
+ (> ht (+ (* 2 ind) -4))
+ (< ht (+ (* -2 ind) 8)))
+ #f
+ (cons ind ht)
+ ))