From: Keith OHara <k-ohara5a5a@oco.net>
Date: Sun, 19 Jun 2011 01:45:56 +0000 (-0700)
Subject: Print fewer cancelling naturals. issue 1701
X-Git-Tag: release/2.14.2-1~27
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8be41c09f28daa6f07201448b87163acecd8ba99;p=lilypond.git

Print fewer cancelling naturals. issue 1701

Print extra natural when a single sharp lowers a double sharp,
 but not when a single sharp raises a flat.
---

diff --git a/Documentation/notation/pitches.itely b/Documentation/notation/pitches.itely
index f253d35a0d..a256fd4274 100644
--- a/Documentation/notation/pitches.itely
+++ b/Documentation/notation/pitches.itely
@@ -1675,10 +1675,10 @@ musicB = {
 
 This rule corresponds to the common practice in the twentieth
 century.  It omits some extra natural signs, which were
-traditionally prefixed to accidentals that reduce or reverse
-the direction of a previous alteration.  The @code{modern} rule
+traditionally prefixed to a sharp following a double sharp,
+or a flat following a double flat.  The @code{modern} rule
 prints the same accidentals as @code{default}, with
-two exceptions that serve to avoid ambiguity: after temporary
+two additions that serve to avoid ambiguity: after temporary
 accidentals, cancellation marks are printed also in the following
 measure (for notes in the same octave) and, in the same measure,
 for notes in other octaves.  Hence the naturals before
diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index 31b6c8ad3c..7c52d41846 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -1093,8 +1093,8 @@ specifies whether accidentals should be canceled in different octaves."
 	      (begin
 		(set! need-accidental #t)
 		(if (and (not (= this-alt 0))
-			 (or (< (abs this-alt) (abs prev-alt))
-			     (< (* prev-alt this-alt) 0)))
+			 (and (< (abs this-alt) (abs prev-alt))
+			     (> (* prev-alt this-alt) 0)))
 		    (set! need-restore #t))))))
 
     (cons need-restore need-accidental)))