]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/music-output-def.cc (Music_output_def): remove separate
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 May 2004 17:12:02 +0000 (17:12 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 May 2004 17:12:02 +0000 (17:12 +0000)
translator table. Lookup translators in scope directly. This
obviates Context suffix for context identifiers, i.e.

* Documentation/user/notation.itely (Chords mode): typo: 13 -> 3.

* Documentation/user/changing-defaults.itely (Horizontal spacing):
document spacing override hack.

17 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/changing-defaults.itely
Documentation/user/invoking.itexi
Documentation/user/notation.itely
input/test/ancient-font.ly
lily/auto-beam-engraver.cc
lily/include/music-output-def.hh
lily/include/paper-def.hh
lily/music-output-def.cc
lily/paper-def.cc
lily/rest-collision.cc
lily/system.cc
scm/document-translation.scm
scm/lily.scm
scm/page-layout.scm
scripts/convert-ly.py

index 6ab627920a54fdfec77e784180c4f6f16e704dc6..da3a853ce68bd661047570d33623375cccde6c17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2004-05-27  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/music-output-def.cc (Music_output_def): remove separate
+       translator table. Lookup translators in scope directly. This
+       obviates Context suffix for context identifiers, i.e.
+
+       \context {
+         \Staff
+         .. 
+         }
+
+
+       will work.
+       
+
+       * Documentation/user/notation.itely (Chords mode): typo: 13 -> 3.
+
+       * Documentation/user/changing-defaults.itely (Horizontal spacing):
+       document spacing override hack.
+
 2004-05-27  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/output-gnome.scm: Add C-q, C-w keybindings.  Update
@@ -6,6 +26,8 @@
 
 2004-05-26  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * VERSION: 2.3.2 released
+       
        * lily/parser.yy (book_body): set default bookpaper.
 
        * scm/output-tex.scm (header): kludge: hard code linewidth. 
index 1347d2791ec03a9c4a5b5276285db678a06adfe1..a79c2919062f84be1d61c237b937e9ec8909fbe1 100644 (file)
@@ -8,6 +8,17 @@
 
 @itemize @bullet
 
+@item Context definitions are now stored in identifiers that match the
+context name, in other words, to modify a @code{Staff} context, the
+following code may be used.
+
+@example
+       \context @{
+         \Staff
+         .. 
+         @}
+@end example
+
 @item A new block, @code{\bookpaper} has been introduced to
 hold settings for paper size and output scaling.
 
@@ -95,10 +106,9 @@ block at toplevel is encapsulated in a @code{book} block.  A
 The default value is one octave below middle C.
 
 @c update-me?  formal definition of newaddlyrics, once it works
-@item Combining lyrics with music can be @code{\newlyrics}
+@item Combining lyrics with music can be done with @code{\newlyrics}
 
 @example
-<<
     \relative @{
        \clef bass
        d2 d c4 bes a2 \break
@@ -109,7 +119,6 @@ The default value is one octave below middle C.
     \newlyrics @{
        Not much can go wrong!
     @}
->>
 @end example
 
 Syntactically, @code{\newlyrics} acts like an infix operator.
index 8f244a7c8efed906ae9e280eba887959f5b70124..9d82431678a2dd82dc4eb21f269590525d70cff5 100644 (file)
@@ -693,7 +693,7 @@ from the music, in the @code{\paper} block,
   \paper @{
      @dots{}
      \context @{
-        \StaffContext
+        \Staff
 
         \set fontSize = #-2
         \override Stem #'thickness
@@ -704,13 +704,12 @@ from the music, in the @code{\paper} block,
 
 Here
 @example
-  \StaffContext
+  \Staff
 @end example
 
 @noindent
 takes the existing definition @context{Staff} from the identifier
-@code{StaffContext}. This works analogously to other contexts, so that
-the existing definition  of @code{Voice} is in @code{\VoiceContext}.
+@code{Staff}. This works analogously to other contexts.
 
 The statements
 @example
@@ -764,7 +763,7 @@ to indicate improvisation in Jazz pieces,
     \override Stem #'transparent = ##t
     \alias Voice
   }
-  \context { \StaffContext
+  \context { \Staff
     \accepts "ImproVoice"
   }}
   \score { \notes \relative c'' {
@@ -1874,8 +1873,13 @@ changes its character (measured in durations) halfway during the
 score, the part containing the longer durations will be spaced too
 widely.
 
-There is no convenient mechanism to manually override spacing.
+There is no convenient mechanism to manually override spacing.  The
+following work-around may be used to insert extra space into a score.
+@example
+ \once \override Score.SeparationItem #'padding = #1
+@end example
 
+No work-around exists for decreasing the amount of space.
 
 
 @menu
index a66b62f6edd276fac9382876de25eb2d1b735b4b..3fdebf1ae0d2a553e2825a08c3dbd9efaa37f509 100644 (file)
@@ -427,6 +427,12 @@ intended to help the programmers and debuggers. Usually, they can be
 ignored. Sometimes, they come in such big quantities that they obscure
 other output. In this case, file a bug-report.
 
+@item Aborted (core dumped)
+This signals a serious programming error that caused the program to
+crash. Such errors are considered critical. If you stumble on one,
+send a bugreport.
+
+
 @end table
 
 @cindex errors, message format
index f67f948b676fd73e753714c26142a3fd7ac61be6..a37e99b822bad59404b6793a450ebb552124b38d 100644 (file)
@@ -3924,7 +3924,7 @@ Modifiers can be mixed with additions
 @cindex @code{m}
 
 Since an unaltered 11 does not sound good when combined with an
-unaltered 13, the 11 is removed in this case (unless it is added
+unaltered 3, the 11 is removed in this case (unless it is added
 explicitly)
 @c
 @lilypond[quote,fragment,verbatim]
index 71bc283ee20cefd7ebcf12a88d11846a151e50d9..9268eeb072ffc23b73aea777f4258a4a9976528e 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.3.1"
+\version "2.3.2"
 % TODO: split ancient-font into seperate files; possibly in
 % different locations.
 \header {
@@ -222,13 +222,13 @@ lowerStaff = \context MensuralStaff = lowerStaff <<
        linethickness = #(/ staffspace 5.0)
        indent = 0.0
        \context {
-           \ScoreContext
+           \Score
            \accepts MensuralStaff
            \accepts GregorianStaff
 %          timing = ##f %%%%%%%% FIXME: this has no effect
        }
        \context {
-           \VoiceContext
+           \Voice
            \name MensuralVoice
            \alias Voice
            \remove Ligature_bracket_engraver
@@ -240,7 +240,7 @@ lowerStaff = \context MensuralStaff = lowerStaff <<
            autoBeaming = ##f
        }
        \context {
-           \VoiceContext
+           \Voice
            \name GregorianVoice
            \alias Voice
            \remove Ligature_bracket_engraver
@@ -249,7 +249,7 @@ lowerStaff = \context MensuralStaff = lowerStaff <<
            autoBeaming = ##f
        }
        \context {
-           \StaffContext
+           \Staff
            \name MensuralStaff
            \alias Staff
            \accepts MensuralVoice
@@ -265,7 +265,7 @@ lowerStaff = \context MensuralStaff = lowerStaff <<
            clefOctavation = #0 
        }
        \context {
-           \StaffContext
+           \Staff
            \name GregorianStaff
            \alias Staff
            \accepts GregorianVoice
index cbeba2f4347f7126df658fc8c0350cd9486e600a..fda74a0cf00e8c05c92458a042aa78ae6bcb11c6 100644 (file)
@@ -21,9 +21,6 @@
 #include "duration.hh"
 #include "context.hh"
 
-/*
-  TODO: documentme.
- */
 class Auto_beam_engraver : public Engraver
 {
   TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
index bbaf79cfc48181163d6d90b611ec248c424dea86..d95ee038bc745c6bf0feb3557b083b4f7e668aac 100644 (file)
 class Music_output_def   
 {
 public:
-  Scheme_hash_table * translator_tab_;
   Input input_origin_;
-  Array<String> targets_;
   SCM scope_;
 
-  virtual void derived_mark ();
+  void assign_context_def (SCM transdef);
+  SCM find_context_def (SCM name) const;
+
   Music_output_def (Music_output_def const&);
   Music_output_def ();
   VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Music_output_def);
 
   Context *get_group_translator (String type) const;
-  void assign_context_def (SCM transdef);
-  SCM find_context_def (SCM name) const;
   String outname_string () ;
   SCM c_variable (String id) const;
   SCM lookup_variable (SCM sym) const;
   void set_variable (SCM, SCM sym);
-  // fixme: dependencies
-  //  virtual void add_target_file (String);
-  
   DECLARE_SMOBS (Music_output_def,);
 };
 
index f5ea1cacb41c467557ec73da83d8bdb1e9230822..a23afe7f455764337a1339857a1302a9026e4789 100644 (file)
@@ -55,7 +55,6 @@ public:
   Paper_def ();
   Paper_def (Paper_def const&);
   virtual ~Paper_def ();
-  virtual void derived_mark ();
   
   Paper_outputter* get_paper_outputter (String) const;
   SCM font_descriptions () const;
index 54b9b33cab3f61d47885467858e56a3780b89b0a..042398e6f05f59d03dfcd8c2a46efcde7ddfcefb 100644 (file)
 
 Music_output_def::Music_output_def ()
 {
-  translator_tab_ = new Scheme_hash_table;
   scope_ = SCM_EOL;
   smobify_self ();
 
-  scm_gc_unprotect_object (translator_tab_->self_scm ());
   scope_ = ly_make_anonymous_module (false);
 }
 
@@ -36,12 +34,8 @@ Music_output_def::~Music_output_def ()
 Music_output_def::Music_output_def (Music_output_def const &s)
 {
   scope_ = SCM_EOL;
-  translator_tab_ = 0;
   smobify_self ();
 
-  translator_tab_ =   new Scheme_hash_table (*s.translator_tab_);  
-  scm_gc_unprotect_object (translator_tab_->self_scm ());  
-  
   scope_= ly_make_anonymous_module (false);
   if (is_module (s.scope_))
     ly_import_module (scope_, s.scope_);
@@ -55,31 +49,22 @@ SCM
 Music_output_def::mark_smob (SCM m)
 {
   Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
-  if (mo->translator_tab_)
-    scm_gc_mark (mo->translator_tab_->self_scm ());
-
-  mo->derived_mark ();
-  
   return mo->scope_;
 }
 
-void
-Music_output_def::derived_mark ()
-{
-  
-}
-
 void
 Music_output_def::assign_context_def (SCM transdef)
 {
   Context_def *tp = unsmob_context_def (transdef);
   assert (tp);
 
-  translator_tab_->set (tp->get_context_name (), transdef);
+  if (tp)
+    {
+      SCM sym = tp->get_context_name ();
+      scm_module_define (scope_, sym, transdef);
+    }  
   
   String nm = ly_symbol2string (tp->get_context_name ()) + "Context";
-
-
   scm_module_define (scope_, ly_symbol2scm (nm.to_str0 ()), transdef);
 }
 
@@ -89,9 +74,16 @@ Music_output_def::assign_context_def (SCM transdef)
 SCM
 Music_output_def::find_context_def (SCM name) const
 {  
-  SCM val  =SCM_EOL;
-  translator_tab_->try_retrieve (name, &val);
-  return val;
+  SCM var = ly_module_lookup (scope_, name);
+
+  if (var != SCM_BOOL_F)
+    {
+      var = scm_variable_ref (var);
+      Context_def *cd = (unsmob_context_def (var));
+      return cd ? cd->self_scm () : SCM_EOL;
+    }
+  else
+    return SCM_EOL;
 }
 
 int
@@ -168,12 +160,19 @@ LY_DEFINE(ly_output_description, "ly:output-description",
          "Return the description of translators in @var{output-def}.")
 {
   Music_output_def *id = unsmob_music_output_def (output_def);
-  SCM al = id->translator_tab_->to_alist ();
+  
+  SCM al =ly_module_to_alist (id->scope_);
+
   SCM l = SCM_EOL;
   for (SCM s = al ; ly_c_pair_p (s); s = ly_cdr (s))
     {
       Context_def * td = unsmob_context_def (ly_cdar (s));
-      l = scm_cons (scm_cons (ly_caar (s), td->to_alist ()),  l);
+      SCM key = ly_caar (s);
+      if (td && key == td->get_context_name ())
+       {
+         
+         l = scm_cons (scm_cons (key, td->to_alist ()),  l);
+       }
     }
   return l;  
 }
index 85cb00b73e2724c61e45e027d094006a9613a30e..388235ab7d9f858042832daa4d0319ffd2aa6572 100644 (file)
@@ -44,13 +44,6 @@ Paper_def::~Paper_def ()
 {
 }
 
-void
-Paper_def::derived_mark ()
-{
-  if (bookpaper_)
-    scm_gc_mark (bookpaper_->self_scm ());
-}
-
 Real
 Paper_def::get_dimension (SCM s) const
 {
index 98151137c36894baa568dfc7f045cb09118d08ae..9f0aeef0cb288098465089249397f0ddeceffbc5 100644 (file)
@@ -150,9 +150,15 @@ Rest_collision::do_shift (Grob *me)
        ordered_rests[d].sort (Note_column::shift_compare);
       } while (flip (&d) != LEFT);
       
-      if (ordered_rests[UP].size () < 1
-         || ordered_rests[DOWN].size () < 1)
-       return SCM_UNSPECIFIED;
+      do {
+       if (ordered_rests[d].size () < 1)
+         {
+           if (ordered_rests[-d].size() > 1)
+             ordered_rests[-d][0]->warning (_("Too many colliding rests."));
+         
+           return SCM_UNSPECIFIED;
+         }
+      } while (flip (&d) != LEFT);
 
       Grob *common = common_refpoint_of_array (ordered_rests[DOWN], me, Y_AXIS);
       common =  common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
@@ -245,7 +251,7 @@ Rest_collision::do_shift (Grob *me)
 
 
 ADD_INTERFACE (Rest_collision,"rest-collision-interface",
-  "Move around ordinary rests (not multi-measure-rests) to avoid "
-"conflicts.",
-  "minimum-distance positioning-done elements");
+              "Move around ordinary rests (not multi-measure-rests) to avoid "
+              "conflicts.",
+              "minimum-distance positioning-done elements");
 
index 72937087f82c2104cfe7a09a2685a2833b08d8f4..fed4dfd7921beee1e5cfee0ae47eed959578fa45 100644 (file)
@@ -377,7 +377,7 @@ System::get_line ()
   Interval x (extent (this, X_AXIS));
   Interval y (extent (this, Y_AXIS));
   Paper_line *pl = new Paper_line (Offset (x.length (), y.length ()),
-                                  stencils, penalty);
+                                  stencils, (bool) penalty); // FIXME.
 
   return scm_gc_unprotect_object (pl->self_scm ());
 }
index a138bbc3997441cade3ba0ee8e9703d51363d8a6..b5ac64d3245a3d14dbdb1301a0b45afec823670f 100644 (file)
     ))
 
 ;; Second level, part of Context description
-
 (define name->engraver-table (make-vector 61 '()))
 (map
  (lambda (x)
index 186e92ade1be9e3c04afeb4b7808d4d3c13c90cb..6e6605703e6da67a670c2ac009b107b99c461296 100644 (file)
@@ -7,6 +7,7 @@
 
 ;;; Library functions
 
+
 (if (defined? 'set-debug-cell-accesses!)
     (set-debug-cell-accesses! #f))
 
index 26c37b474a177e28da4b189274a6541f4edfac8f..5d22f14c00ab64e18a251d0bcdcc907687a16141 100644 (file)
@@ -20,7 +20,7 @@
   (let ((props (page-properties paper)))
 
     (interpret-markup paper props
-                   (markup #:fill-line ("" (number->string page-number))))))
+                     (markup #:fill-line ("" (number->string page-number))))))
 
 
 (define TAGLINE
index 934e52ea78f41bb9c25b5c7a6d57c38c29257aa2..cabc4a0ba0b2fe0cf7e5a496695b65aa1b6117b4 100644 (file)
@@ -2088,6 +2088,19 @@ def conv (str):
 conversions.append (((2, 3, 1), conv,
                     '''\\apply -> \\applymusic'''))
 
+def conv (str):
+       def func(m):
+               if m.group(1) not in ['RemoveEmptyStaff',
+                                     ]:
+                       return '\\' + m.group (1)
+               else:
+                       return m.group (0)
+               
+       return re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+
+conversions.append (((2, 3, 2), conv,
+                    '''\\FooContext -> \\Foo'''))
+
 ################################
 #      END OF CONVERSIONS      
 ################################