]> git.donarmstrong.com Git - lilypond.git/commitdiff
(ly_copy_module_variables): use
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 8 Apr 2003 16:44:01 +0000 (16:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 8 Apr 2003 16:44:01 +0000 (16:44 +0000)
scm_internal_hash_fold() for iterating modules.

ChangeLog
Documentation/user/appendices.itely
buildscripts/lys-to-tely.py
input/test/beamed-slur-endings.ly
input/test/chord-names-dpnj.ly
lily/ly-module.cc
lily/multi-measure-rest.cc
make/lysdoc-rules.make
make/lysdoc-vars.make

index 9b63db0f2df4bd6dff578e67ffd8cb29c9f68fc8..d5066b97e4e48387d9cac3bd63c7260dd8b6aafc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-08  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/ly-module.cc (ly_copy_module_variables): use
+       scm_internal_hash_fold() for iterating modules.
+
 2003-04-08  Juergen Reuter  <reuter@ipd.uka.de>
 
        * Documentation/user/refman.itely: Section Custodes: added more
index 7929b78523fee8181047ea4ed24923ff61ff9c3d..380f5ee301360606e5fcfd3adc1a71e03ff17a5b 100644 (file)
@@ -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}
 
 
index 35adbabbf37bdfeb461ac5780273ddcc6439a8e9..14a998009bdd63a244fbc5ba9f1da650d719ebc9 100644 (file)
@@ -76,7 +76,7 @@ if files:
                s = r"""
 @ifhtml
 @html
-<NAME=%s>
+<NAME="%s">
 @end html
 @end ifhtml
 """ % n
index f8b0750a0190d4c9e4da186b41a3e47c185d46aa..823c8e1c240112c75a63a08fef9f793609732ba4 100644 (file)
@@ -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
index 8d9378ccba853eff6bfdf5623500df6b293410dd..77870841126593da2f661af89ca6d3572d179b44 100644 (file)
@@ -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 {
index 3d409cd3f9f12034f75b0875af92f4ec2278bc27..0fed4234f6f203a874314af68370ac14657af0ad 100644 (file)
@@ -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); 
 }
 
 /*
index 9f6d693531f872fc4cce79cae97e087520d4ceb5..194a23780fe8c8767cdd1ac2c60c83a1a67d7536 100644 (file)
@@ -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;
index 4918481d47905cfd9aff258f2f20f46a638762b6..7e43bb8e1d1fc905d6215ae057c1e5ecc74d7623 100644 (file)
@@ -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)
 
index a00005398918f68bd95b235f0b2359236c37d4d3..e6532133637deee579e3bc14f8c3d6f54433bdd6 100644 (file)
@@ -1,4 +1,4 @@
 TITLE=LYs Doc
 
-NAME=$(notdir $(pwd))
+NAME=collated-files