From: Neil Puttock Date: Thu, 30 Apr 2009 19:29:09 +0000 (+0100) Subject: Add type-checking to \tweak. X-Git-Tag: release/2.13.1-1~7^2~11^2~3^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e44bc2cc48f9fb714603bdb5f8db532d55374087;p=lilypond.git Add type-checking to \tweak. --- diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index f14f543001..2dded22e3d 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -701,7 +701,8 @@ scoreTweak = (make-music 'SequentialMusic))) -tag = #(define-music-function (parser location tag arg) +tag = +#(define-music-function (parser location tag arg) (symbol? ly:music?) (_i "Add @var{tag} to the @code{tags} property of @var{arg}.") @@ -745,16 +746,20 @@ transposition = (ly:pitch-negate (pitch-of-note pitch-note))) 'Staff)) -tweak = #(define-music-function (parser location sym val arg) - (symbol? scheme? ly:music?) +tweak = +#(define-music-function (parser location sym val arg) + (symbol? scheme? ly:music?) + (_i "Add @code{sym . val} to the @code{tweaks} property of @var{arg}.") - (_i "Add @code{sym . val} to the @code{tweaks} property of @var{arg}.") - - (set! - (ly:music-property arg 'tweaks) - (acons sym val - (ly:music-property arg 'tweaks))) - arg) + (if (equal? (object-property sym 'backend-type?) #f) + (begin + (ly:warning (_ "cannot find property type-check for ~a") sym) + (ly:warning (_ "doing assignment anyway")))) + (set! + (ly:music-property arg 'tweaks) + (acons sym val + (ly:music-property arg 'tweaks))) + arg)