Don't assume that Voice.instrumentCueName is a valid markup! If it is
empty (i.e. it has been manually unset), don't create an InstrumentSwitch
grob.
--- /dev/null
+\header {
+
+ texidoc = "The @code{Voice.instrumentCueName} property generates instrument
+names for cue notes. It can also be unset properly."
+ }
+
+\version "2.13.5"
+
+
+\relative c'' {
+ c4
+ \set Voice.instrumentCueName = "In.1"
+ c2.
+ \set Voice.instrumentCueName = "I.2"
+ c1
+ \unset Voice.instrumentCueName
+ c
+}
#include "engraver.hh"
#include "item.hh"
+#include "text-interface.hh"
#include "translator.icc"
if (!scm_is_eq (cue_name_, cue_text))
{
- text_ = make_item ("InstrumentSwitch", SCM_EOL);
- text_->set_property ("text", cue_text);
+ if (Text_interface::is_markup (cue_text))
+// if (!scm_is_null (cue_text))
+ {
+ text_ = make_item ("InstrumentSwitch", SCM_EOL);
+ text_->set_property ("text", cue_text);
+ }
cue_name_ = cue_text;
}
}