[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: add suggestAccidentals = #'cautionary option (issue 577130043 by add
From: |
lilypond |
Subject: |
Re: add suggestAccidentals = #'cautionary option (issue 577130043 by address@hidden) |
Date: |
Fri, 22 Nov 2019 04:54:52 -0800 |
Reviewers: lemzwerg, Dan Eble, carl.d.sorensen_gmail.com,
Message:
On 2019/11/21 14:31:42, Carl wrote:
Very nice.
I think there should be a changes.tely entry.
Carl
I’ll add it as well as a change in the NR.
Description:
add suggestAccidentals = #'cautionary option
Setting suggestAccidentals to 'cautionary now prints only cautionary
accidentals (input by ?) as AccidentalSuggestion.
Please review this at https://codereview.appspot.com/577130043/
Affected files (+16, -13 lines):
M input/regression/accidental-suggestions.ly
M lily/accidental-engraver.cc
M scm/define-context-properties.scm
Index: input/regression/accidental-suggestions.ly
diff --git a/input/regression/accidental-suggestions.ly
b/input/regression/accidental-suggestions.ly
index
f3b5d46ec13b65103e0e24aa15e19dd79b48b70e..95d6fd1944d4343543d6c4bb16d442b1cf64dea3
100644
--- a/input/regression/accidental-suggestions.ly
+++ b/input/regression/accidental-suggestions.ly
@@ -4,21 +4,21 @@
texidoc = "setting the @code{suggestAccidentals} will print
accidentals vertically relative to the note. This is useful for
denoting Musica Ficta."
-
+
}
-\version "2.19.21"
+\version "2.21.0"
\paper {
ragged-right = ##t
}
\relative {
- \time 2/4
- \set suggestAccidentals = ##t
- cis''^> gis'-!
- \override AccidentalSuggestion.parenthesized = ##t
- cis,_"paren" gis'
+ \time 3/4
+ \set suggestAccidentals = ##t
+ cis''^> gis'-! c?
+ \set suggestAccidentals = #'cautionary
+ cis, gis' c?
+ \override AccidentalSuggestion.parenthesized = ##t
+ cis, gis' c?
}
-
-
Index: lily/accidental-engraver.cc
diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc
index
733fba1d63edcb0d8d02784b1f5aef63a717d66e..8074bb13653088b8ce64ec7aa606b8bc8b1e5af8
100644
--- a/lily/accidental-engraver.cc
+++ b/lily/accidental-engraver.cc
@@ -276,9 +276,11 @@ Accidental_engraver::create_accidental
(Accidental_entry *entry,
{
Stream_event *note = entry->melodic_;
Grob *support = entry->head_;
- bool as_suggestion = to_boolean (entry->origin_->get_property
("suggestAccidentals"));
+ SCM suggest = entry->origin_->get_property ("suggestAccidentals");
+ bool bsuggest = to_boolean (suggest);
Grob *a = 0;
- if (as_suggestion)
+ if (bsuggest
+ || (cautionary && scm_is_eq (suggest, ly_symbol2scm ("cautionary"))))
a = make_suggested_accidental (note, support, entry->origin_engraver_);
else
a = make_standard_accidental (note, support, entry->origin_engraver_,
cautionary);
Index: scm/define-context-properties.scm
diff --git a/scm/define-context-properties.scm
b/scm/define-context-properties.scm
index
9e80559467bc45309120bee03ab91bb8021b8faf..eb644d3a602508040364f116394614903c116cc6
100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -610,8 +610,9 @@ one).")
@code{fingeringOrientations}.")
(subdivideBeams ,boolean? "If set, multiple beams will be
subdivided at @code{baseMoment} positions by only drawing one beam over
the beat.")
- (suggestAccidentals ,boolean? "If set, accidentals are typeset as
-cautionary suggestions over the note.")
+ (suggestAccidentals ,boolean-or-symbol? "If set to @code{#t},
+accidentals are typeset as suggestions above the note. Setting it to
+@code{'cautionary} only applies that to cautionary accidentals.")
(supportNonIntegerFret ,boolean? "If set in @code{Score} the
@code{TabStaff} will print micro-tones as @samp{2½}")
(systemStartDelimiter ,symbol? "Which grob to make for the start