]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4492: Redundant music-has-type -> music-is-of-type?
authorDavid Kastrup <dak@gnu.org>
Sat, 11 Jul 2015 15:55:09 +0000 (17:55 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 18 Jul 2015 06:13:55 +0000 (08:13 +0200)
python/convertrules.py
scm/music-functions.scm

index c1506654e012aebe62207400edf0caf5bd6bc28a..a824fcbd5a83651ff57f36c9c11c194da611f2c7 100644 (file)
@@ -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,
index 97bb8c4f67f89aa0ce79482595f8d0f86d978f44..a952a8284649d78dfa71e19522111d55e2139b51 100644 (file)
@@ -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)