]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #106 and problems with 'modern accidental style.
authorRune Zedeler <rune@lilypond.org>
Mon, 18 Dec 2006 11:44:56 +0000 (12:44 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 18 Dec 2006 11:44:56 +0000 (12:44 +0100)
input/regression/accidentals-modern.ly [new file with mode: 0644]
lily/accidental-engraver.cc

diff --git a/input/regression/accidentals-modern.ly b/input/regression/accidentals-modern.ly
new file mode 100644 (file)
index 0000000..9f749ae
--- /dev/null
@@ -0,0 +1,16 @@
+\header {
+
+  texidoc = "In 'modern accidental style, the last note should
+have an accidental sign. "
+  
+}
+\version "2.10.3"
+
+\score {
+  \new Staff {
+    \relative c' {
+      #(set-accidental-style 'modern)
+      d4 dis'4 d,2^"this should have accidental"
+    }
+  }
+}
index 9d671c11e610a0e34420ca703689247d4ba382ef..00cf1de97e50a8871c6e895e04d982b9443452b8 100644 (file)
@@ -122,8 +122,7 @@ Accidental_engraver::update_local_key_signature ()
 
   /* Huh. Don't understand what this is good for. --hwn.  */
 
-  SCM val;
-  while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature"), &val))
+  while (trans)
     {
       trans->set_property ("localKeySignature", ly_deep_copy (last_keysig_));
       trans = trans->get_parent_context ();
@@ -193,11 +192,14 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
     {
       SCM entry = scm_car (s);
       if (scm_is_pair (scm_car (entry))
-         && scm_cdar (entry) == scm_from_int (n))
+         && scm_cdar (entry) == scm_from_int (n)) {
        from_other_octaves = scm_cdr (entry);
+       break;
+      }
     }
 
-  if (from_same_octave != SCM_BOOL_F
+  if (!ignore_octave
+      && from_same_octave != SCM_BOOL_F
       && recent_enough (bar_number, from_same_octave, laziness))
     previous_alteration = from_same_octave;
   else if (ignore_octave