;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+(for-each (lambda (x)
+ (ly:add-option (car x) (cadr x) (caddr x)))
+
+ '((point-and-click #t "use point & click")
+ (midi-debug #f "generate human readable MIDI")
+ (internal-type-checking #f "check every property assignment for types")
+ (parse-protect #t "continue when finding errors in inline
+scheme are caught in the parser. If off, halt
+on errors, and print a stack trace.")
+ (old-relative #f
+ "relative for simultaneous music works
+similar to chord syntax")
+
+ (resolution 101 "resolution for generating bitmaps")
+ (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
+ (preview-include-book-title #t "include book-titles in preview images.")
+ (gs-font-load #f
+ "load fonts via Ghostscript.")
+ (delete-intermediate-files #f
+ "delete unusable PostScript files")
+ (verbose #f "value for the --verbose flag")
+ (ttf-verbosity 0
+ "how much verbosity for TTF font embedding?")
+ (debug-gc #f
+ "dump GC protection info")))
+
+
(if (defined? 'set-debug-cell-accesses!)
(set-debug-cell-accesses! #f))
(debug-enable 'backtrace)
(read-enable 'positions)))
-;; initialize defaults.
-(ly:set-option 'command-line-settings
- '((resolution . 90)
- (preview-include-book-title . #t)
- ))
(define-public tex-backend?
(member (ly:output-backend) '("texstr" "tex")))
(lambda (a b)
(< (object-address (car a))
(object-address (car b))))))
+
(out-file-name (string-append
"gcstat-" (number->string gc-protect-stat-count)
".scm"))
" ")
"\n")))
protects))
- outfile)))
+ outfile)
+
+ (if (defined? 'gc-live-object-stats)
+ (let*
+ ((dummy (gc))
+ (dummy2 (gc))
+ (stats (gc-live-object-stats))
+ )
+
+ (for-each
+ (lambda (x)
+ (format outfile "~a: ~a\n" (car x) (cdr x)))
+ (sort (gc-live-object-stats)
+ (lambda (x y)
+ (string<? (car x) (car y)))))
+ ))
+
+ ))
(define-public (tweak-grob-property grob sym val)
(set! (ly:grob-property grob sym) val))
(lambda () (ly:parse-file file-name))
(lambda (x . args) (handler x file-name)))
- (if #f
+ (if (ly:get-option 'debug-gc)
(dump-gc-protects)))
(use-modules (scm editor))
-(define (running-from-gui?)
+(define-public (running-from-gui?)
(let ((have-tty? (isatty? (current-input-port))))
;; If no TTY and not using safe, assume running from GUI.
(cond
(not have-tty?)))))
(define-public (gui-main files)
- (if (null? files) (gui-no-files-handler))
+ (if (null? files)
+ (gui-no-files-handler))
(let* ((base (basename (car files) ".ly"))
(log-name (string-append base ".log")))
(if (not (running-from-gui?))