Christoph Wagner <[email protected]> writes:

> this is my first post here.
> Sorry for my bad english.
>
> I am the author of
> https://gitlab.com/lilypond/lilypond/-/merge_requests/2839 and while
> thinking about tags I had the idea to add just another command named
> \untag that could be used to remove tags but keep their content.
>
> People often are confused, that the \keepWithTag filter leaves the
> content with its tag.

Adding another command will not change the confusion.

> What we obviously want is to use the \keepWithTag #'foo to filter the
> \music and to use \keepWithTag #'one
> to filter \test, but without filtering the nested \music again.
>
> At the moment there are two possible ways to solve the problem.
> We can specify all the tags we want to keep as a list:
>
> \score {
>   \keepWithTag #'(one foo) \test
> }
>
> This is bad, because this means you can't do independent tag filtering
> with \keepWithTag
> and have to make all filtering at one place.
>
> Another way is to use \tagGroup to create different tag groups for
> #'(one two) and #'(foo bar).
> This way you can do independent filtering, but the \tagGroup command
> works globaly
> and is difficult to use, if you have multiple bookparts with multiple
> lilypond files,
> that have independent tag schemes.

Why would it be difficult to use?  The whole point of \tagGroup is to
support independent tag schemes.

> I want to introduce another idea that came to my mind.
> We could have an \untag command that just removes the tags, but keep
> the content.
>
> In our example we could write
> fooMusic = \untag \keepWithTag #'foo \music
> barMusic = \untag \keepWithTag #'bar \music
>
> fooMusic is now the same as { c } and the tag used for filtering is gone.
> If we do
> \score {
>   \keepWithTag #'one \test
> }
> it works as expected and leaves the { c }.

"as expected" if you understand the problem in the first place.  But why
else would you be using \untag ?  And this absolutely does _not_ work
with independent tag schemes because once you have used \untag, you can
no longer apply either \keepWithTag or \removeWithTag from a different
scheme.

> Does this make sense to you?

> I can create a merge request and implement it, if you think this is a
> good idea.

I don't see it being of much help, to be honest.  It doesn't allow for
multiple independent tag schemes.  It will cause tag-based commands to
stop working on tagged music because of independent code removing tags.

That will lead to users not understanding why their tagged music is not
being operated on as expected when it actually stopped being tagged
because of unrelated code.

-- 
David Kastrup


Reply via email to