From 2ca356d824f37951de81d60f76eaaaefda436cff Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 11 Jul 2015 17:55:09 +0200 Subject: [PATCH] Issue 4492: Redundant music-has-type -> music-is-of-type? --- python/convertrules.py | 6 ++++++ scm/music-functions.scm | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/convertrules.py b/python/convertrules.py index c1506654e0..a824fcbd5a 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3826,6 +3826,12 @@ def conv(str): return str return inner (str) +@rule ((2, 19, 24), "music-has-type -> music-is-of-type?") +def conv (str): + str = re.sub (r'(?<=\s|["\\()])' + "music-has-type" + r'(?=\s|["\\()])', + "music-is-of-type?", str) + return str + # Guidelines to write rules (please keep this at the end of this file) # # - keep at most one rule per version; if several conversions should be done, diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 97bb8c4f67..a952a82846 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -953,9 +953,6 @@ NUMBER is 0-base, i.e., Voice=1 (upstems) has number 0. mus)) -(define-public (music-has-type music type) - (memq type (ly:music-property music 'types))) - (define-public (music-clone music . music-properties) "Clone @var{music} and set properties according to @var{music-properties}, a list of alternating property symbols and @@ -1908,7 +1905,7 @@ Entries that conform with the current key signature are not invalidated." (define-public (pitch-of-note event-chord) (let ((evs (filter (lambda (x) - (music-has-type x 'note-event)) + (music-is-of-type? x 'note-event)) (ly:music-property event-chord 'elements)))) (and (pair? evs) -- 2.39.5