From: Han-Wen Nienhuys Date: Tue, 8 Apr 2003 16:44:01 +0000 (+0000) Subject: (ly_copy_module_variables): use X-Git-Tag: release/1.7.16~12 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fe84e791fec9ba0ef3d57abbaa643474365a2ba1;p=lilypond.git (ly_copy_module_variables): use scm_internal_hash_fold() for iterating modules. --- diff --git a/ChangeLog b/ChangeLog index 9b63db0f2d..d5066b97e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-04-08 Han-Wen Nienhuys + + * lily/ly-module.cc (ly_copy_module_variables): use + scm_internal_hash_fold() for iterating modules. + 2003-04-08 Juergen Reuter * Documentation/user/refman.itely: Section Custodes: added more diff --git a/Documentation/user/appendices.itely b/Documentation/user/appendices.itely index 7929b78523..380f5ee301 100644 --- a/Documentation/user/appendices.itely +++ b/Documentation/user/appendices.itely @@ -99,9 +99,10 @@ The following symbols are available in the Feta font and may be accessed directly using text markup such as @code{g^\markup @{ \musicglyph #"scripts-segno" @}}, see @ref{Text markup}. + @lilypondfile[noindent]{feta16list.ly} -@c parmesan is too big. Apparently pythons re's choke on this. -@c @lil ypondfile{parmesan16list.ly} + +@lilypondfile[noindent]{parmesan16list.ly} diff --git a/buildscripts/lys-to-tely.py b/buildscripts/lys-to-tely.py index 35adbabbf3..14a998009b 100644 --- a/buildscripts/lys-to-tely.py +++ b/buildscripts/lys-to-tely.py @@ -76,7 +76,7 @@ if files: s = r""" @ifhtml @html - + @end html @end ifhtml """ % n diff --git a/input/test/beamed-slur-endings.ly b/input/test/beamed-slur-endings.ly index f8b0750a01..823c8e1c24 100644 --- a/input/test/beamed-slur-endings.ly +++ b/input/test/beamed-slur-endings.ly @@ -2,8 +2,8 @@ \score{ \notes \relative c''{ - \slurUp c8(()c())c4 - \slurDown a8(()a)a4 + \slurUp c8((c-)(c4-)) + \slurDown a8-(-(a-)a4-) \break \slurDown a8(()a())a4 diff --git a/input/test/chord-names-dpnj.ly b/input/test/chord-names-dpnj.ly index 8d9378ccba..7787084112 100644 --- a/input/test/chord-names-dpnj.ly +++ b/input/test/chord-names-dpnj.ly @@ -73,15 +73,9 @@ efull = \chordnames { c:3-.5-.7- = \markup { \super " o" } %% Hmm - %% ;;Pick your favorite maj7 - %% ((0) mathm-markup-object) ;;a white triangle - %% ;;((0) mathn-markup-object) ;;a black triangle - %% ;;((0) (make-simple-markup "maj7")) ;;good old maj7 %% This ok? c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" } - %%c:3.5.7 = \markup { \override #'(font-family . math) "M" } - %%c:3.5.7 = \markup { \normal-size-super "maj7" } } epartial = \chordnames { diff --git a/lily/ly-module.cc b/lily/ly-module.cc index 3d409cd3f9..0fed4234f6 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -39,31 +39,43 @@ ly_clear_anonymous_modules () { SCM s = anon_modules; anon_modules = SCM_EOL; - + for (; gh_pair_p (s) ; s = gh_cdr (s)) { - scm_vector_fill_x (SCM_MODULE_OBARRAY(gh_car(s)), SCM_EOL); + SCM tab= scm_c_make_hash_table (2); + /* + UGH. + */ + + SCM_STRUCT_DATA(gh_car(s))[scm_module_index_obarray] = (long unsigned int) tab; } } #define FUNC_NAME __FUNCTION__ +SCM +define_one_var (void * closure, SCM key, SCM val, SCM result) +{ + SCM dest = (SCM) closure; + scm_module_define (dest, key, scm_variable_ref (val)); + return SCM_EOL; +} + +typedef SCM (*Hash_cl_func)(); + void ly_copy_module_variables (SCM dest, SCM src) { SCM_VALIDATE_MODULE (1, src); SCM obarr= SCM_MODULE_OBARRAY(src); - SCM syms = SCM_EOL; + scm_internal_hash_fold ((Hash_cl_func) &define_one_var, (void*) dest, SCM_EOL, obarr); +} - for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++) - { - for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i)); - gh_pair_p (s); s = gh_cdr (s)) - { - scm_module_define (dest, gh_caar (s), scm_variable_ref (gh_cdar(s))); - } - } +SCM +accumulate_symbol (void * closure, SCM key, SCM val, SCM result) +{ + return scm_cons (key, result); } SCM @@ -72,20 +84,14 @@ ly_module_symbols (SCM mod) SCM_VALIDATE_MODULE (1, mod); SCM obarr= SCM_MODULE_OBARRAY(mod); - SCM syms = SCM_EOL; - - for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++) - { - for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i)); - gh_pair_p (s); s = gh_cdr (s)) - { - syms = scm_cons (gh_caar (s), syms); - } - } - return syms; + return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, NULL, SCM_EOL, obarr); } - +SCM +entry_to_alist (void * closure, SCM key, SCM val, SCM result) +{ + return scm_cons (scm_cons (key, scm_variable_ref (val)), result); +} SCM ly_module_to_alist (SCM mod) @@ -94,18 +100,8 @@ ly_module_to_alist (SCM mod) SCM obarr= SCM_MODULE_OBARRAY(mod); - SCM alist = SCM_EOL; - for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++) - { - for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i)); - gh_pair_p (s); s = gh_cdr (s)) - { - alist = scm_acons (gh_caar (s), scm_variable_ref (gh_cdar (s)), - alist); - } - } - return alist; + return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr); } /* diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 9f6d693531..194a23780f 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -294,7 +294,6 @@ Multi_measure_rest::add_column (Grob*me,Item* c) MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods,1); - SCM Multi_measure_rest::set_spacing_rods (SCM smob) { @@ -332,8 +331,11 @@ Multi_measure_rest::set_spacing_rods (SCM smob) rod.distance_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER] + sym_width + 2.0; // 2.0 = magic! + Real minlen =0.0; + SCM ml =me->get_grob_property ("minimum-length"); + if (gh_number_p (ml)) minlen = gh_scm2double (ml); rod.distance_ = max(rod.distance_, - gh_scm2double (me->get_grob_property ("minimum-length"))); + minlen); rod.add_to_cols (); } return SCM_UNSPECIFIED; diff --git a/make/lysdoc-rules.make b/make/lysdoc-rules.make index 4918481d47..7e43bb8e1d 100644 --- a/make/lysdoc-rules.make +++ b/make/lysdoc-rules.make @@ -2,5 +2,5 @@ $(outdir)/$(NAME).tely: $(LY_FILES) - $(PYTHON) ../../buildscripts/lys-to-tely.py --name=$(outdir)/collated-files.html --title="$(TITLE)" $(LY_FILES) + $(PYTHON) ../../buildscripts/lys-to-tely.py --name=$(outdir)/collated-files --title="$(TITLE)" $(LY_FILES) diff --git a/make/lysdoc-vars.make b/make/lysdoc-vars.make index a000053989..e653213363 100644 --- a/make/lysdoc-vars.make +++ b/make/lysdoc-vars.make @@ -1,4 +1,4 @@ TITLE=LYs Doc -NAME=$(notdir $(pwd)) +NAME=collated-files