+propertyOverride =
+#(define-music-function (grob-property-path value)
+ (symbol-list? scheme?)
+ (_i "Set the grob property specified by @var{grob-property-path} to
+@var{value}. @var{grob-property-path} is a symbol list of the form
+@code{Context.GrobName.property} or @code{GrobName.property}, possibly
+with subproperties given as well. This music function is mostly intended
+for use from Scheme as a substitute for the built-in @code{\\override}
+command.")
+ (let ((p (check-grob-path grob-property-path (*location*)
+ #:default 'Bottom
+ #:min 3)))
+ (if p
+ (context-spec-music
+ (make-music 'OverrideProperty
+ 'symbol (cadr p)
+ 'origin (*location*)
+ 'grob-value value
+ 'grob-property-path (cddr p)
+ 'pop-first #t)
+ (car p))
+ (make-music 'Music))))
+
+propertyRevert =
+#(define-music-function (grob-property-path)
+ (symbol-list?)
+ (_i "Revert the grob property specified by @var{grob-property-path} to
+its previous value. @var{grob-property-path} is a symbol list of the form
+@code{Context.GrobName.property} or @code{GrobName.property}, possibly
+with subproperties given as well. This music function is mostly intended
+for use from Scheme as a substitute for the built-in @code{\\revert}
+command.")
+ (let ((p (check-grob-path grob-property-path (*location*)
+ #:default 'Bottom
+ #:min 3)))
+ (if p
+ (context-spec-music
+ (make-music 'RevertProperty
+ 'symbol (cadr p)
+ 'origin (*location*)
+ 'grob-property-path (cddr p))
+ (car p))
+ (make-music 'Music))))
+
+propertySet =
+#(define-music-function (property-path value)
+ (symbol-list-or-symbol? scheme?)
+ (_i "Set the context property specified by @var{property-path} to
+@var{value}. This music function is mostly intended for use from
+Scheme as a substitute for the built-in @code{\\set} command.")
+ (let ((p (check-context-path property-path (*location*))))
+ (if p
+ (context-spec-music
+ (make-music 'PropertySet
+ 'symbol (cadr p)
+ 'value value
+ 'origin (*location*))
+ (car p))
+ (make-music 'Music))))
+
+propertyTweak =
+#(define-music-function (prop value item)
+ (symbol-list-or-symbol? scheme? symbol-list-or-music?)
+ (_i "Add a tweak to the following @var{item}, usually music.
+This generally behaves like @code{\\tweak} but will turn into an
+@code{\\override} when @var{item} is a symbol list.
+
+In that case, @var{item} specifies the grob path to override. This is
+mainly useful when using @code{\\propertyTweak} as as a component for
+building other functions like @code{\\omit}. It is not the default
+behavior for @code{\\tweak} since many input strings in
+@code{\\lyricmode} can serve equally as music or as symbols which
+causes surprising behavior when tweaking lyrics using the less
+specific semantics of @code{\\propertyTweak}.
+
+@var{prop} can contain additional elements in which case a nested
+property (inside of an alist) is tweaked.")
+ ;; Why not instead make the parser treat strings preferably as
+ ;; music in lyrics mode rather than as symbol? Because then
+ ;;
+ ;; \tweak text "whatever" mylyrics
+ ;;
+ ;; will try putting a lyric event with text "whatever" in the text
+ ;; property of lyrics. So we want expressions allowing both
+ ;; strings and lyrics to deliver strings: more complex conversions
+ ;; should only be attempted when the simple uses don't match the
+ ;; given predicate.
+ (if (ly:music? item)
+ (tweak prop value item)
+ (propertyOverride (append item (if (symbol? prop) (list prop) prop))
+ value)))
+
+propertyUnset =
+#(define-music-function (property-path)
+ (symbol-list-or-symbol?)
+ (_i "Unset the context property specified by @var{property-path}.
+This music function is mostly intended for use from Scheme as a
+substitute for the built-in @code{\\unset} command.")
+ (let ((p (check-context-path property-path (*location*))))
+ (if p
+ (context-spec-music
+ (make-music 'PropertyUnset
+ 'symbol (cadr p)
+ 'origin (*location*))
+ (car p))
+ (make-music 'Music))))
+