]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4808 Make chord-naming robust against unsetting majorSevenSymbol
authorThomas Morley <thomasmorley65@gmail.com>
Tue, 22 Mar 2016 10:32:53 +0000 (11:32 +0100)
committerThomas Morley <thomasmorley65@gmail.com>
Mon, 28 Mar 2016 13:00:02 +0000 (15:00 +0200)
This will likely be changed anyway as soon as rewriting
chord-names is seriously tackled.
At least it might be a reminder to take care of the possibility
a user wants to unset majorSevenSymbol.
Regtest amended.

input/regression/chord-name-major7.ly
scm/chord-ignatzek-names.scm

index 285c41ce29f15cd0435624d2d73088951edbbf6e..7a2109cd2276ff49bd1a032e8743427eba5e77b3 100644 (file)
@@ -1,11 +1,16 @@
 \version "2.16.0"
 \header {
     texidoc = "The layout of the major 7 can be tuned with
-@code{majorSevenSymbol}."
+@code{majorSevenSymbol}.  It does not break if @code{majorSevenSymbol} is unset.
+One should see: triangle - j7 - triangle - #7."
 }
 
 \chords {
     c:7+
     \set majorSevenSymbol = \markup { "j7" }
     c:7+
+    \unset majorSevenSymbol
+    c:7+
+    \unset Score.majorSevenSymbol
+    c:7+
 }
index f798c0fdf6aa7fc82aba8dceb62691cfeab4f9b5..483b8cac8f18fc6bb20598ae7ef7ccfb120c48ff 100644 (file)
@@ -161,10 +161,12 @@ work than classifying the pitches."
       (let* ((num-markup (make-simple-markup
                           (number->string (pitch-step pitch))))
              (args (list num-markup))
-             (total (if (= (ly:pitch-alteration pitch) 0)
-                        (if (= (pitch-step pitch) 7)
-                            (list (ly:context-property context 'majorSevenSymbol))
-                            args)
+             (major-seven-symbol (ly:context-property context 'majorSevenSymbol))
+             (total
+                    (if (and (= (ly:pitch-alteration pitch) 0)
+                             (= (pitch-step pitch) 7)
+                             (markup? major-seven-symbol))
+                        (list major-seven-symbol)
                         (cons (accidental->markup (step-alteration pitch)) args))))
 
         (make-line-markup total)))