>From 4f8846436a395f6fe7d7fecf0c54c8f4aa9f4e1a Mon Sep 17 00:00:00 2001 From: Mark Knoop Date: Sun, 31 Jul 2016 15:41:37 +0100 Subject: [PATCH] Keep a staff alive with multiple layers This allows the `VerticalAxisGroup.remove-layer' property to accept a list of values. The layer will stay alive with any other member of the Keep_alive_together_engrave group with a remove-layer value in that list. --- lily/keep-alive-together-engraver.cc | 9 ++++++++- scm/define-grob-properties.scm | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lily/keep-alive-together-engraver.cc b/lily/keep-alive-together-engraver.cc index 9b1cbe4..a1dcdea 100644 --- a/lily/keep-alive-together-engraver.cc +++ b/lily/keep-alive-together-engraver.cc @@ -65,11 +65,18 @@ Keep_alive_together_engraver::finalize () if (i == j) continue; SCM that_layer = group_spanners_[j]->get_property ("remove-layer"); + if (scm_is_pair (this_layer)) + { + // layer is kept alive if its list contains the other + if (scm_is_true (scm_memv (that_layer, this_layer))) + live->add (group_spanners_[j]); + continue; + } if (scm_is_false (that_layer)) continue; if (!scm_is_integer (this_layer)) { - // Unspecified layers are kept alive by anything else + // unset layers are kept alive by all but ignored layers live->add (group_spanners_[j]); continue; } diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index cb9103a..1b6a169 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -809,7 +809,7 @@ number, the quicker the slur attains its @code{height-limit}.") interesting items.") (remove-first ,boolean? "Remove the first staff of an orchestral score?") - (remove-layer ,integer? "The @code{Keep_alive_together_engraver} + (remove-layer ,number-or-pair? "The @code{Keep_alive_together_engraver} removes all @code{VerticalAxisGroup} grobs with a @code{remove-layer} larger than the smallest retained @code{remove-layer}. Set to @code{#f} to make a layer invisible to the -- 2.7.4