]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2930: Allow \tag to accept multiple tags, like \keepWithTag and \removeWithTag do.
authorDavid Kastrup <dak@gnu.org>
Fri, 26 Oct 2012 08:24:37 +0000 (10:24 +0200)
committerDavid Kastrup <dak@gnu.org>
Wed, 31 Oct 2012 05:22:08 +0000 (06:22 +0100)
ly/music-functions-init.ly

index f916551cc66a2b9c297a11e9ae6d57df9de1ce4d..df5d8a500523c5504bb4e6eec9ea325daef3de91 100644 (file)
@@ -1229,15 +1229,17 @@ styledNoteHeads =
    (style-note-heads heads style music))
 
 tag =
-#(define-music-function (parser location tag arg) (symbol? ly:music?)
-
-   (_i "Add @var{tag} to the @code{tags} property of @var{arg}.")
+#(define-music-function (parser location tag music) (symbol-list-or-symbol? ly:music?)
+   (_i "Tag the following @var{music} with @var{tag} and return the
+result, by adding the single symbol or symbol list @var{tag} to the
+@code{tags} property of @var{music}.")
 
    (set!
-    (ly:music-property arg 'tags)
-    (cons tag
-         (ly:music-property arg 'tags)))
-   arg)
+    (ly:music-property music 'tags)
+    ((if (symbol? tag) cons append)
+     tag
+     (ly:music-property music 'tags)))
+   music)
 
 temporary =
 #(define-music-function (parser location music)