From 82e8427010b8e1a932e0642f03b0c94a8494f03a Mon Sep 17 00:00:00 2001 From: Thomas Morley Date: Tue, 22 Mar 2016 11:32:53 +0100 Subject: [PATCH] Issue 4808 Make chord-naming robust against unsetting majorSevenSymbol 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 | 7 ++++++- scm/chord-ignatzek-names.scm | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/input/regression/chord-name-major7.ly b/input/regression/chord-name-major7.ly index 285c41ce29..7a2109cd22 100644 --- a/input/regression/chord-name-major7.ly +++ b/input/regression/chord-name-major7.ly @@ -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+ } diff --git a/scm/chord-ignatzek-names.scm b/scm/chord-ignatzek-names.scm index f798c0fdf6..483b8cac8f 100644 --- a/scm/chord-ignatzek-names.scm +++ b/scm/chord-ignatzek-names.scm @@ -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))) -- 2.39.5