From: Han-Wen Nienhuys Date: Mon, 15 Aug 2005 18:28:41 +0000 (+0000) Subject: * ly/engraver-init.ly: add Rest_engraver only once. X-Git-Tag: release/2.7.5~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6f870f1f99be015b8159770207f44a6317e0c96a;p=lilypond.git * ly/engraver-init.ly: add Rest_engraver only once. * scm/define-music-display-methods.scm (KeyChangeEvent): only do (*parser*) lookup if (*parser*) != #f. --- diff --git a/ChangeLog b/ChangeLog index a3fa9961b9..7f8807dae1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-15 Han-Wen Nienhuys + + * 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 * input/regression/slur-script.ly: Add example of reverting diff --git a/input/regression/display-lily-tests.ly b/input/regression/display-lily-tests.ly index 369e338fda..81f72cfb2d 100644 --- a/input/regression/display-lily-tests.ly +++ b/input/regression/display-lily-tests.ly @@ -29,7 +29,6 @@ #(read-hash-extend #\[ my-read-lily-expression) -#(display-lily-init parser) #(define test-number 0) #(define (lily-string->markup str) diff --git a/input/regression/tuplet-full-length.ly b/input/regression/tuplet-full-length.ly index ae206c677a..28dd010a09 100644 --- a/input/regression/tuplet-full-length.ly +++ b/input/regression/tuplet-full-length.ly @@ -10,7 +10,7 @@ start of the next non-tuplet note. " \paper { raggedright = ##t indent = 0.0 } -\new Voice \with { +\relative c'' \new Voice \with { \remove Forbid_line_break_engraver allowBeamBreak = ##t } diff --git a/lily/parser.yy b/lily/parser.yy index 5662c99439..3b72ec290b 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1779,7 +1779,6 @@ command_element: 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 (); } diff --git a/lily/smobs.cc b/lily/smobs.cc index e984567be5..57de04c09f 100644 --- a/lily/smobs.cc +++ b/lily/smobs.cc @@ -8,6 +8,9 @@ #include "smobs.hh" +/* + The CDR contains the actual protected list. + */ static SCM smob_protection_list; void @@ -18,6 +21,16 @@ init_smob_protection () } 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) { diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 4189c9aca3..13f67e2b9f 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -243,7 +243,6 @@ contained staves are not connected vertically." \remove "Glissando_engraver" \remove "Ligature_bracket_engraver" \remove "Note_heads_engraver" - \consists "Rest_engraver" \consists "Drum_notes_engraver" \remove "New_fingering_engraver" diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index ea49d53613..c6ee229821 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -561,7 +561,8 @@ Otherwise, return #f." (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)) diff --git a/scm/lily.scm b/scm/lily.scm index c91fcb2b88..cc899a67b3 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -316,20 +316,24 @@ The syntax is the same as `define*-public'." (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") @@ -375,17 +379,17 @@ The syntax is the same as `define*-public'." (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))