From: Han-Wen Nienhuys Date: Fri, 3 Nov 2006 01:18:14 +0000 (+0000) Subject: clean up Sources X-Git-Tag: release/2.10.0-2~34^2~6^2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7785ac382ed511ed535adf77adc3c07649fbc9b5;p=lilypond.git clean up Sources plug memleak in case of failed files. don't allocate part combine events statically. Plugs small leak. ignore gcstat files. don't delete .scale.pfa; the FF script may not have read themyet. Fixes brace OTF bug more ignores. Remove set-part-combine-listener. This plugs a memory leak. clear lexer scopes after parsing file. Plugs pseudo memory leak set-part-combine fix for autochange. implement and use ASSERT_LIVE_IS_ALLOWED() autochange thinko. --- diff --git a/.gitignore b/.gitignore index 0b3bdf9521..9526956a35 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,12 @@ tags *.midi \#* lily-[0-9][0-9][0-9]* +gcstat*.scm +*.aux +*.svg +*.pyc +*.log +.htaccess +*.tfm +*.afm + diff --git a/ChangeLog b/ChangeLog index 13ca50f1ae..22532fc9b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +2006-11-02 Han-Wen Nienhuys + + * scm/autochange.scm: + autochange thinko. + + * lily/context-def.cc: + * lily/include/parse-scm.hh: + * lily/include/smobs.hh: + * lily/parse-scm.cc: + * lily/prob.cc: + * lily/program-option.cc: + * scm/lily.scm: + implement and use ASSERT_LIVE_IS_ALLOWED() + + * ly/music-functions-init.ly: + * scm/autochange.scm: + set-part-combine fix for autochange. + + * lily/include/lily-lexer.hh: + * lily/include/lily-parser.hh: + * lily/lily-lexer.cc: + * lily/lily-parser-scheme.cc: + * lily/lily-parser.cc: + clear lexer scopes after parsing file. Plugs pseudo memory leak + + * ly/declarations-init.ly: + * ly/music-functions-init.ly: + * scm/part-combiner.scm: + Remove set-part-combine-listener. This plugs a memory leak. + + * .gitignore: + more ignores. + + * mf/GNUmakefile: + don't delete .scale.pfa; the FF script may not have read themyet. Fixes brace OTF bug + + * .gitignore: + ignore gcstat files. + + * lily/part-combine-iterator.cc: + don't allocate part combine events statically. Plugs small leak. + + * lily/lily-parser-scheme.cc: + plug memleak in case of failed files. + + * lily/include/source.hh: + * lily/source.cc: + clean up Sources + + * lily/lexer.ll: + hi-bit ascii is also counted as alpha chars. This allows unicodeidentifiers, and fixes premature stop at accented char. (#134) + + * lily/include/program-option.hh: + * lily/program-option.cc: + get_program_option() function + + * ly/titling-init.ly: + change naming: print-page-number becomescreate-page-number-stencil. This avoids nameclash withprint-page-number boolean, and fixes page number printing. + + * lily/include/translator.hh: + * lily/include/translator.icc: + * lily/translator.cc: + minor cleanups + + * lily/figured-bass-engraver.cc: + don't use ASSIGN_EVENT_ONCE for Figured_bass_engraver. Fixes #128. + + * stepmake/stepmake/compile-vars.make: + don't do -fPIC for mingw. Suppresses warning about unnecessary -fPIC + 2006-11-01 Han-Wen Nienhuys * python/midi.c: diff --git a/lily/context-def.cc b/lily/context-def.cc index 0af5fabf4f..c3a2a6c293 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -87,6 +87,8 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state*) SCM Context_def::mark_smob (SCM smob) { + ASSERT_LIVE_IS_ALLOWED(); + Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob); scm_gc_mark (me->description_); diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index 6a9107ee15..b64798823b 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -64,6 +64,7 @@ public: void add_scope (SCM); SCM set_current_scope (); + bool has_scope () const; SCM remove_scope (); void start_main_input (); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index 4fa354d280..d4557e3688 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -50,6 +50,7 @@ public: DECLARE_SCHEME_CALLBACK (layout_description, ()); + void clear (); void do_init_file (); void do_yyparse (); void parse_file (string init, string name, string out_name); diff --git a/lily/include/parse-scm.hh b/lily/include/parse-scm.hh index 28223cac7e..0f48de2c53 100644 --- a/lily/include/parse-scm.hh +++ b/lily/include/parse-scm.hh @@ -13,6 +13,7 @@ #include "lily-guile.hh" extern bool parse_protect_global; +extern bool parsed_objects_should_be_dead; struct Parse_start { diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index 5833ee5c37..55971a1fa1 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -20,4 +20,6 @@ extern bool profile_property_accesses; SCM ly_get_option (SCM); SCM ly_set_option (SCM, SCM); +bool get_program_option (const char *); + #endif /* SCM_OPTION_HH */ diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index cfd49db34f..a2dcdb613d 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -11,6 +11,7 @@ #include "lily-guile.hh" #include "virtual-methods.hh" +#include "warn.hh" /* Smobs are GUILEs mechanism of exporting C(++) objects to the Scheme @@ -140,5 +141,14 @@ void protect_smob (SCM smob, SCM *prot_cons); void unprotect_smob (SCM smob, SCM *prot_cons); +extern bool parsed_objects_should_be_dead; + +#define ASSERT_LIVE_IS_ALLOWED() \ + static bool passed_here_once;\ + if (parsed_objects_should_be_dead && !passed_here_once) { \ + programming_error (string ("Parsed object should be dead: ") + __PRETTY_FUNCTION__ ); \ + passed_here_once = true;\ + } + #endif /* SMOBS_HH */ diff --git a/lily/include/source.hh b/lily/include/source.hh index 09c6b0553f..b06266b4fc 100644 --- a/lily/include/source.hh +++ b/lily/include/source.hh @@ -13,9 +13,8 @@ /* A set of sourcefiles. */ class Sources { - Sources (Sources const &) {} + Sources (Sources const &); vector sourcefiles_; - bool is_binary_; public: Sources (); @@ -25,7 +24,6 @@ public: Source_file *get_sourcefile (char const *); void add (Source_file *sourcefile); void set_path (File_path *); - void set_binary (bool); const File_path *path_; }; diff --git a/lily/lexer.ll b/lily/lexer.ll index 04a279b4ca..8bf851eea4 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -80,11 +80,6 @@ bool is_valid_version (string s); (*(YYLTYPE*)lexloc) #define YY_USER_ACTION add_lexed_char (YYLeng ()); -/* - -LYRICS ({AA}|{TEX})[^0-9 \t\n\f]* - -*/ SCM scan_fraction (string); @@ -117,18 +112,21 @@ SCM (* scm_parse_error_handler) (void *); %x sourcefilename %x version -A [a-zA-Z] +A [a-zA-Z\200-\377] AA {A}|_ N [0-9] AN {AA}|{N} ANY_CHAR (.|\n) PUNCT [?!:'`] ACCENT \\[`'"^] -NATIONAL [\001-\006\021-\027\031\036\200-\377] +NATIONAL [\001-\006\021-\027\031\036] TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL} WORD {A}{AN}* DASHED_WORD {A}({AN}|-)* DASHED_KEY_WORD \\{DASHED_WORD} + + + ALPHAWORD {A}+ DIGIT {N} UNSIGNED {N}+ @@ -148,6 +146,7 @@ ESCAPED [nt\\'"] EXTENDER __ HYPHEN -- BOM_UTF8 \357\273\277 + %% @@ -245,7 +244,6 @@ BOM_UTF8 \357\273\277 int i; sscanf (YYText (), "%d", &i); -// this->set_debug (1); yy_pop_state (); this->here_input ().get_source_file ()->set_line (here_input ().start (), i); } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index ef579dc7f0..1f39bd2425 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -148,6 +148,11 @@ Lily_lexer::add_scope (SCM module) set_current_scope (); } +bool +Lily_lexer::has_scope () const +{ + return scm_is_pair (scopes_); +} SCM Lily_lexer::remove_scope () @@ -300,6 +305,8 @@ IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer); SCM Lily_lexer::mark_smob (SCM s) { + ASSERT_LIVE_IS_ALLOWED(); + Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s); scm_gc_mark (lexer->chordmodifier_tab_); diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 90d9a60366..a1cdfa3c03 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -110,11 +110,12 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", exit (2); } + + bool error = false; if ((file_name != "-") && file_name.empty ()) { warning (_f ("can't find file: `%s'", file)); - scm_throw (ly_symbol2scm ("ly-file-failed"), - scm_list_1 (scm_makfrom0str (file_name.c_str ()))); + error = true; } else { @@ -129,14 +130,20 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", parser->parse_file (init, file_name, out_file); - bool error = parser->error_level_; + error = parser->error_level_; + parser->clear (); parser->unprotect (); - if (error) - /* TODO: pass renamed input file too. */ - scm_throw (ly_symbol2scm ("ly-file-failed"), - scm_list_1 (scm_makfrom0str (file_name.c_str ()))); } + + /* + outside the if-else to ensure cleanup fo Sources object, + */ + if (error) + /* TODO: pass renamed input file too. */ + scm_throw (ly_symbol2scm ("ly-file-failed"), + scm_list_1 (scm_makfrom0str (file_name.c_str ()))); + return SCM_UNSPECIFIED; } diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 8c5d43b202..ac468b771e 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -127,7 +127,7 @@ Lily_parser::parse_file (string init, string name, string out_name) } error_level_ = error_level_ | lexer_->error_level_; - lexer_ = 0; + clear (); } void @@ -156,6 +156,19 @@ Lily_parser::parse_string (string ly_code) error_level_ = error_level_ | lexer_->error_level_; } +void +Lily_parser::clear () +{ + if (lexer_) + { + while (lexer_->has_scope ()) + lexer_->remove_scope (); + + + } + lexer_ = 0; +} + char const * Lily_parser::here_str0 () const { diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc index 75f161540d..0769083cfa 100644 --- a/lily/parse-scm.cc +++ b/lily/parse-scm.cc @@ -115,6 +115,7 @@ protected_ly_parse_scm (Parse_start *ps) } bool parse_protect_global = true; +bool parsed_objects_should_be_dead = false; /* Try parsing. Upon failure return SCM_UNDEFINED. FIXME: shouldn't we return SCM_UNSCPECIFIED -- jcn */ diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 9f06f3821f..03da0d4f57 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -34,7 +34,6 @@ public: protected: virtual void derived_substitute (Context *f, Context *t); virtual void derived_mark () const; - Part_combine_iterator (Part_combine_iterator const &); virtual void construct_children (); virtual Moment pending_moment () const; @@ -57,6 +56,11 @@ private: SCM split_list_; + Stream_event *unisono_event_; + Stream_event *solo_one_event_; + Stream_event *solo_two_event_; + Stream_event *mmrest_event_; + enum Status { APART, @@ -111,6 +115,11 @@ Part_combine_iterator::do_quit () Part_combine_iterator::Part_combine_iterator () { + mmrest_event_ = 0; + unisono_event_ = 0; + solo_two_event_ = 0; + solo_one_event_= 0; + first_iter_ = 0; second_iter_ = 0; split_list_ = SCM_EOL; @@ -125,6 +134,17 @@ Part_combine_iterator::derived_mark () const scm_gc_mark (first_iter_->self_scm ()); if (second_iter_) scm_gc_mark (second_iter_->self_scm ()); + + Stream_event *ptrs[] = { + unisono_event_, + mmrest_event_, + solo_two_event_, + solo_one_event_, + 0 + }; + for (int i = 0; ptrs[i]; i++) + if (ptrs[i]) + scm_gc_mark (ptrs[i]->self_scm ()); } void @@ -171,14 +191,15 @@ Part_combine_iterator::chords_together () void Part_combine_iterator::kill_mmrest (int in) { - static Stream_event *mmrest; - if (!mmrest) + + if (!mmrest_event_) { - mmrest = new Stream_event (ly_symbol2scm ("multi-measure-rest-event")); - mmrest->set_property ("duration", SCM_EOL); + mmrest_event_ = new Stream_event (ly_symbol2scm ("multi-measure-rest-event")); + mmrest_event_->set_property ("duration", SCM_EOL); + mmrest_event_->unprotect (); } - handles_[in].get_outlet ()->event_source ()->broadcast (mmrest); + handles_[in].get_outlet ()->event_source ()->broadcast (mmrest_event_); } void @@ -196,11 +217,13 @@ Part_combine_iterator::solo1 () if (playing_state_ != SOLO1) { - static Stream_event *event; - if (!event) - event = new Stream_event (ly_symbol2scm ("solo-one-event")); + if (!solo_one_event_) + { + solo_one_event_ = new Stream_event (ly_symbol2scm ("solo-one-event")); + solo_one_event_->unprotect (); + } - first_iter_->get_outlet ()->event_source ()->broadcast (event); + first_iter_->get_outlet ()->event_source ()->broadcast (solo_one_event_); } playing_state_ = SOLO1; } @@ -252,14 +275,16 @@ Part_combine_iterator::unisono (bool silent) if (playing_state_ != UNISONO && newstate == UNISONO) { - static Stream_event *event; - if (!event) - event = new Stream_event (ly_symbol2scm ("unisono-event")); - + if (!unisono_event_) + { + unisono_event_ = new Stream_event (ly_symbol2scm ("unisono-event")); + unisono_event_->unprotect (); + } + Context *out = (last_playing_ == SOLO2 ? second_iter_ : first_iter_) ->get_outlet (); - out->event_source ()->broadcast (event); + out->event_source ()->broadcast (unisono_event_); playing_state_ = UNISONO; } state_ = newstate; @@ -279,11 +304,13 @@ Part_combine_iterator::solo2 () if (playing_state_ != SOLO2) { - static Stream_event *event; - if (!event) - event = new Stream_event (ly_symbol2scm ("solo-two-event")); - - second_iter_->get_outlet ()->event_source ()->broadcast (event); + if (!solo_two_event_) + { + solo_two_event_ = new Stream_event (ly_symbol2scm ("solo-two-event")); + solo_two_event_->unprotect (); + } + + second_iter_->get_outlet ()->event_source ()->broadcast (solo_two_event_); playing_state_ = SOLO2; } } @@ -368,7 +395,8 @@ Part_combine_iterator::set_busy (SCM se) } /* -* Processes a moment in an iterator, and returns whether any new music was reported. + Processes a moment in an iterator, and returns whether any new music + was reported. */ bool Part_combine_iterator::try_process (Music_iterator *i, Moment m) diff --git a/lily/prob.cc b/lily/prob.cc index e28c24411a..b6df86590f 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -101,6 +101,8 @@ Prob::derived_mark () const SCM Prob::mark_smob (SCM smob) { + ASSERT_LIVE_IS_ALLOWED(); + Prob *system = (Prob *) SCM_CELL_WORD_1 (smob); scm_gc_mark (system->mutable_property_alist_); system->derived_mark (); diff --git a/lily/program-option.cc b/lily/program-option.cc index 9ec4901c85..be81de380b 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -34,7 +34,6 @@ bool profile_property_accesses = false; bool do_internal_type_checking_global; bool strict_infinity_checking = false; - static SCM option_hash; void internal_set_option (SCM var, SCM val) @@ -68,6 +67,11 @@ void internal_set_option (SCM var, SCM val) do_internal_type_checking_global = to_boolean (val); val = scm_from_bool (to_boolean (val)); } + else if (var == ly_symbol2scm ("debug-gc-assert-parsed-dead")) + { + parsed_objects_should_be_dead = to_boolean (val); + val = scm_from_bool (parsed_objects_should_be_dead); + } else if (var == ly_symbol2scm ("old-relative")) { lily_1_8_relative = to_boolean (val); @@ -204,6 +208,9 @@ LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (), return scm_from_bool (be_verbose_global); } + + + LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var), "Get a global option setting.") { @@ -211,3 +218,12 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var), SCM_ARG1, __FUNCTION__, "symbol"); return scm_hashq_ref (option_hash, var, SCM_BOOL_F); } + + +bool +get_program_option (const char *s) +{ + SCM sym = ly_symbol2scm (s); + + return to_boolean (ly_get_option (sym)); +} diff --git a/lily/source.cc b/lily/source.cc index 9d978d4fae..811b4dd681 100644 --- a/lily/source.cc +++ b/lily/source.cc @@ -14,15 +14,15 @@ Sources::Sources () { path_ = 0; - is_binary_ = false; } -void -Sources::set_binary (bool bo) + +Sources::Sources (Sources const &) { - is_binary_ = bo; + assert (false); } + void Sources::set_path (File_path *f) { @@ -64,16 +64,3 @@ Sources::~Sources () } } -Source_file * -Sources::get_sourcefile (char const *str0) -{ - for (vector::iterator i = sourcefiles_.begin(); - i != sourcefiles_.end (); i++) - { - if ((*i)->contains (str0)) - return *i; - } - - return 0; -} - diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 6728973084..3ff8e22119 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -106,8 +106,6 @@ partCombineListener = \layout { } } -#(set-part-combine-listener partCombineListener) - \include "dynamic-scripts-init.ly" \include "spanners-init.ly" \include "property-init.ly" diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 4686f7b723..a1fafa63e3 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -23,7 +23,7 @@ acciaccatura = addquote = #(define-music-function (parser location name music) (string? ly:music?) "Add a piece of music to be quoted " - (add-quotable name music) + (add-quotable parser name music) (make-music 'SequentialMusic 'void #t)) @@ -96,7 +96,7 @@ assertBeamSlope = autochange = #(define-music-function (parser location music) (ly:music?) - (make-autochange-music music)) + (make-autochange-music parser music)) applyContext = #(define-music-function (parser location proc) (procedure?) @@ -338,7 +338,8 @@ octave = )) partcombine = #(define-music-function (parser location part1 part2) (ly:music? ly:music?) - (make-part-combine-music (list part1 part2))) + (make-part-combine-music parser + (list part1 part2))) pitchedTrill = diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 0956ee36ef..c87aa1c47f 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -65,7 +65,6 @@ $(outdir)/emmentaler-%.otf $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe $(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfa) $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable cd $(outdir) && $(FONTFORGE) -script aybabtu.pe - -rm -f $(outdir)/*.scale.{pfa,afm} $(outdir)/%.pfa: $(outdir)/%.log diff --git a/scm/autochange.scm b/scm/autochange.scm index e4a27d7063..c445997199 100644 --- a/scm/autochange.scm +++ b/scm/autochange.scm @@ -3,7 +3,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; autochange - fairly related to part combining. -(define-public (make-autochange-music music) +(define-public (make-autochange-music parser music) (define (generate-split-list change-moment event-list acc) (if (null? event-list) acc @@ -32,7 +32,8 @@ (let* ((m (make-music 'AutoChangeMusic)) (m1 (make-non-relative-music (context-spec-music music 'Voice "one"))) - (context-list (recording-group-emulate music part-combine-listener)) + (context-list (recording-group-emulate music + (ly:parser-lookup parser 'partCombineListener))) (evs (car context-list)) (rev (reverse! (cdar context-list))) (split (reverse! (generate-split-list diff --git a/scm/lily.scm b/scm/lily.scm index edd99461d5..8de8adc430 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -22,8 +22,10 @@ (clip-systems #f "Generate cut-out snippets of a score") (debug-gc #f "dump memory debugging statistics") + (debug-gc-assert-parsed-dead #f + "for memory debugging: ensure that all refs to parsed objects are dead.") + (debug-midi #f "generate human readable MIDI") - (debug-parser #f "debug the bison parser") (debug-lexer #f "debug the flex lexer") (debug-midi #f "generate human readable MIDI") (delete-intermediate-files #f @@ -386,6 +388,8 @@ The syntax is the same as `define*-public'." (display "Live object statistics: GC'ing\n") (gc) (gc) + (ly:set-option 'debug-gc-assert-parsed-dead #t) + (gc) (set! stats (gc-live-object-stats)) (display "Dumping live object statistics.\n") @@ -445,6 +449,7 @@ The syntax is the same as `define*-public'." (for-each (lambda (x) + (ly:set-option 'debug-gc-assert-parsed-dead #f) (lilypond-file handler x) (ly:clear-anonymous-modules) (if (ly:get-option 'debug-gc) @@ -458,8 +463,7 @@ The syntax is the same as `define*-public'." (lambda () (ly:parse-file file-name)) (lambda (x . args) (handler x file-name)))) -(use-modules (scm editor) - ) +(use-modules (scm editor)) (define-public (gui-main files) (if (null? files) diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index a444313f66..cc051cd5e6 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -220,25 +220,13 @@ Voice-state objects (ly:interpret-music-expression (make-non-relative-music music) global) context-list)) -(define noticed '()) -;; todo: junk this, extract $defaultlayout from parser instead -(define part-combine-listener '()) - -; UGH - should pass noticed setter to part-combine-listener -(define-safe-public (set-part-combine-listener x) - (set! part-combine-listener x)) - -(define-public (notice-the-events-for-pc context lst) - "add CONTEXT-ID, EVENT list to NOTICED variable." - - (set! noticed (acons (ly:context-id context) lst noticed))) - -(define-public (make-part-combine-music music-list) +(define-public (make-part-combine-music parser music-list) (let* ((m (make-music 'PartCombineMusic)) (m1 (make-non-relative-music (context-spec-music (first music-list) 'Voice "one"))) (m2 (make-non-relative-music (context-spec-music (second music-list) 'Voice "two"))) - (evs2 (recording-group-emulate m2 part-combine-listener)) - (evs1 (recording-group-emulate m1 part-combine-listener))) + (listener (ly:parser-lookup parser 'partCombineListener)) + (evs2 (recording-group-emulate m2 listener)) + (evs1 (recording-group-emulate m1 listener))) (set! (ly:music-property m 'elements) (list m1 m2)) (set! (ly:music-property m 'split-list) @@ -495,11 +483,10 @@ the mark when there are no spanners active. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-public (add-quotable name mus) - (set! noticed '()) +(define-public (add-quotable parser name mus) (let* ((tab (eval 'musicQuotes (current-module))) (context-list (recording-group-emulate (context-spec-music mus 'Voice) - part-combine-listener))) + (ly:parser-lookup parser 'partCombineListener)))) (if (pair? context-list) (hash-set! tab name ;; cdr : skip name string