+2005-08-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * ly/engraver-init.ly: add Rest_engraver only once.
+
+ * scm/define-music-display-methods.scm (KeyChangeEvent): only do
+ (*parser*) lookup if (*parser*) != #f.
+
2005-08-15 Jan Nieuwenhuizen <janneke@gnu.org>
* input/regression/slur-script.ly: Add example of reverting
#(read-hash-extend #\[ my-read-lily-expression)
-#(display-lily-init parser)
#(define test-number 0)
#(define (lily-string->markup str)
\paper { raggedright = ##t
indent = 0.0 }
-\new Voice \with {
+\relative c'' \new Voice \with {
\remove Forbid_line_break_engraver
allowBeamBreak = ##t
}
SCM proc = ly_lily_module_constant ("make-mark-set");
SCM result = scm_call_1 (proc, $2);
- scm_gc_protect_object (result);
$$ = unsmob_music (result);
$$->protect ();
}
#include "smobs.hh"
+/*
+ The CDR contains the actual protected list.
+ */
static SCM smob_protection_list;
void
}
ADD_SCM_INIT_FUNC (init_smob_protection, init_smob_protection);
+LY_DEFINE(ly_smob_protects, "ly:smob-protects",
+ 0,0,0, (),
+ "Return lily's internal smob protection list")
+{
+ return scm_cdr (smob_protection_list);
+}
+
+
+
+
void
protect_smob (SCM smob, SCM *prot_cons)
{
\remove "Glissando_engraver"
\remove "Ligature_bracket_engraver"
\remove "Note_heads_engraver"
- \consists "Rest_engraver"
\consists "Drum_notes_engraver"
\remove "New_fingering_engraver"
(format #f "\\key ~a \\~a~a"
(note-name->lily-string (ly:music-property key 'tonic))
(any (lambda (mode)
- (if (equal? (ly:parser-lookup (*parser*) mode) c-pitch-alist)
+ (if (and (*parser*)
+ (equal? (ly:parser-lookup (*parser*) mode) c-pitch-alist))
(symbol->string mode)
#f))
'(major minor ionian locrian aeolian mixolydian lydian phrygian dorian))
(display (format "Dumping gc protected objs to ~a...\n" out-file-name))
(display
- (filter
- (lambda (x) (not (symbol? x)))
- (map (lambda (y)
- (let ((x (car y))
- (c (cdr y)))
-
- (string-append
- (string-join
- (map object->string (list (object-address x) c x))
- " ")
- "\n")))
+ (map (lambda (y)
+ (let ((x (car y))
+ (c (cdr y)))
+
+ (string-append
+ (string-join
+ (map object->string (list (object-address x) c x))
+ " ")
+ "\n")))
+
+ (filter
+ (lambda (x)
+ (not (symbol? (car x))))
protects))
outfile)
+; (display (ly:smob-protects))
+ (newline outfile)
(if (defined? 'gc-live-object-stats)
(let* ((stats #f))
(display "Live object statistics: GC'ing\n")
(for-each
(lambda (x)
(lilypond-file handler x)
- (ly:clear-anonymous-modules))
+ (ly:clear-anonymous-modules)
+ (if (ly:get-option 'debug-gc)
+ (dump-gc-protects)))
+
files)
failed))
(define (lilypond-file handler file-name)
(catch 'ly-file-failed
(lambda () (ly:parse-file file-name))
- (lambda (x . args) (handler x file-name)))
-
- (if (ly:get-option 'debug-gc)
- (dump-gc-protects)))
+ (lambda (x . args) (handler x file-name))))
(use-modules (scm editor))