From 8bc633dcd98352f65f16a7de3ff25258f9075ca5 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 11 Nov 2004 22:19:49 +0000 Subject: [PATCH] * lily/context-selector.cc (set_tweaks): New function. * lily/grob-selector.cc (set_tweaks): (Re)set hash table. Fixes web with -DTWEAK. * Documentation/user/introduction.itely (Automated engraving): Remove fragment option. Fixes web. * lily/context-property.cc (make_item_from_properties): * lily/context.cc (add_context)[TWEAK]: Tweak registration behind #ifdef. --- ChangeLog | 7 +++++++ Documentation/user/introduction.itely | 2 +- lily/context-selector.cc | 11 +++++++++-- lily/context.cc | 2 +- lily/grob-selector.cc | 3 +-- lily/include/context-selector.hh | 1 + lily/lily-parser.cc | 4 +++- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8385f2b83..f385d555c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-11-11 Jan Nieuwenhuizen + * lily/context-selector.cc (set_tweaks): New function. + * lily/grob-selector.cc (set_tweaks): (Re)set hash table. Fixes + web with -DTWEAK. + + * Documentation/user/introduction.itely (Automated engraving): + Remove fragment option. Fixes web. + * lily/context-property.cc (make_item_from_properties): * lily/context.cc (add_context)[TWEAK]: Tweak registration behind #ifdef. diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index 99cb884078..1d74137dac 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -224,7 +224,7 @@ with accents and arpeggio. In the first chord, the graphical objects have all directions down (or left). The second chord has all directions up (right). -@lilypond[quote,raggedright,relative=1,fragment] +@lilypond[quote,raggedright,relative=1] \new Score \with { \override SpacingSpanner #'spacing-increment = #3 \override TimeSignature #'transparent = ##t diff --git a/lily/context-selector.cc b/lily/context-selector.cc index fa583e91a9..2a90b8d3d8 100644 --- a/lily/context-selector.cc +++ b/lily/context-selector.cc @@ -15,8 +15,6 @@ Scheme_hash_table *Context_selector::contexts_ = 0; void Context_selector::register_context (Context *context) { - if (!contexts_) - contexts_ = new Scheme_hash_table (); int count = 0; if (Context *first = retrieve_context (identify_context (context, 0))) { @@ -59,3 +57,12 @@ Context_selector::retrieve_context (SCM context_id) { return unsmob_context (contexts_->get (ly_to_symbol (context_id))); } + +void +Context_selector::set_tweaks (SCM tweaks) +{ + (void) tweaks; + contexts_ = new Scheme_hash_table (); + //tweaks_ = tweaks; +} + diff --git a/lily/context.cc b/lily/context.cc index f53b319799..48e93080b9 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -233,7 +233,7 @@ Context::where_defined (SCM sym) const SCM Context::internal_get_property (SCM sym) const { - SCM val =SCM_EOL; + SCM val = SCM_EOL; if (properties_dict ()->try_retrieve (sym, &val)) return val; diff --git a/lily/grob-selector.cc b/lily/grob-selector.cc index 3758133e73..bc45d90103 100644 --- a/lily/grob-selector.cc +++ b/lily/grob-selector.cc @@ -20,8 +20,6 @@ Protected_scm Grob_selector::tweaks_ = SCM_EOL; void Grob_selector::register_grob (Context *context, Grob *grob) { - if (!grobs_) - grobs_ = new Scheme_hash_table (); int count = 0; Moment m = context->now_mom (); if (Grob *first = retrieve_grob (identify_grob (context, m, grob, 0))) @@ -75,6 +73,7 @@ Grob_selector::retrieve_grob (SCM grob_id) void Grob_selector::set_tweaks (SCM tweaks) { + grobs_ = new Scheme_hash_table (); tweaks_ = tweaks; } diff --git a/lily/include/context-selector.hh b/lily/include/context-selector.hh index ade26365a8..b18ebd13c0 100644 --- a/lily/include/context-selector.hh +++ b/lily/include/context-selector.hh @@ -26,6 +26,7 @@ public: static SCM identify_context (Context *context); static Context *retrieve_context (SCM context_id); static void store_context (SCM context_id, Context *context); + static void set_tweaks (SCM tweaks); }; #endif /* CONTEXT_SELECTOR_HH */ diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 96ec79f0e3..379a1b286e 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -8,6 +8,7 @@ */ #include "book.hh" +#include "context-selector.hh" #include "grob-selector.hh" #include "file-name.hh" #include "file-path.hh" @@ -112,12 +113,13 @@ Lily_parser::parse_file (String init, String name, String out_name) SCM tweaks = scm_eval_string (scm_makfrom0str (s.to_str0 ())); Grob_selector::set_tweaks (tweaks); } + Context_selector::set_tweaks (SCM_EOL); #endif /* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to OUT_FILE (unless IN_FILE redefines output file name). */ do_yyparse (); - + if (!define_spots_.is_empty ()) { define_spots_.top ().warning (_ ("Braces don't match")); -- 2.39.5