Hi Dmitry,
This works. But as soon as I uncomment "music" definition, it starts
to give an error:
./test.ly:23:50: error: unrecognized string, not in text script or \lyricmode
music = \addArticulation #'("staccato") { | c4 d e f | }
/usr/local/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:56:23:
In expression (apply (ly:music-function-extract fun) parser ...):
/usr/local/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:56:23:
Wrong number of arguments to #<procedure #f (scripts music)>
Now that's a good moment to switch from 2.18.2 to a more recent version
of LilyPond :-).
David Nalesnik's code you copied used syntax simplifications from the
next LilyPond generation. It works with 2.18.2 if you replace
#(define-music-function (scripts music) (list? ly:music?)
by
#(define-music-function (parser location scripts music) (list? ly:music?)
Lukas