From: Valentin Villenave Date: Wed, 20 Oct 2010 15:20:07 +0000 (+0200) Subject: music-functions.scm: coding style improvement, take 2. X-Git-Tag: release/2.13.37-1~54 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bfff89ed872b84b570ae890dd7368f8420a36c58;p=lilypond.git music-functions.scm: coding style improvement, take 2. --- diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 78efe3e746..688900411f 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -864,28 +864,17 @@ Syntax: (ly:moment-main-numerator moment) (ly:moment-main-denominator moment))) -(define (skip-this moment) - "set skipTypesetting, make SkipMusic of the given MOMENT length, - and then unset skipTypesetting." +(define (make-skipped moment bool) + "Depending on BOOL, set or unset skipTypesetting, +then make SkipMusic of the given MOMENT length, and +then revert skipTypesetting." (make-sequential-music (list - (context-spec-music (make-property-set 'skipTypesetting #t) + (context-spec-music (make-property-set 'skipTypesetting bool) 'Score) (make-music 'SkipMusic 'duration (make-duration-of-length moment)) - (context-spec-music (make-property-set 'skipTypesetting #f) - 'Score)))) - -(define (unskip-this moment) - "unset skipTypesetting, make SkipMusic of the given MOMENT length, - and then set skipTypesetting." - (make-sequential-music - (list - (context-spec-music (make-property-set 'skipTypesetting #f) - 'Score) - (make-music 'SkipMusic 'duration - (make-duration-of-length moment)) - (context-spec-music (make-property-set 'skipTypesetting #t) + (context-spec-music (make-property-set 'skipTypesetting (not bool)) 'Score)))) (define (skip-as-needed music parser) @@ -924,11 +913,11 @@ Syntax: (list (make-sequential-music (list - (skip-this skip-length) + (make-skipped skip-length #t) ;; let's draw a separator between the beginning and the end (context-spec-music (make-property-set 'whichBar "||") 'Timing))) - (unskip-this show-first-length) + (make-skipped show-first-length #f) music)))) ;; we may only want to print the last length @@ -937,7 +926,7 @@ Syntax: ((skip-length (ly:moment-sub orig-length show-last-length))) (make-simultaneous-music (list - (skip-this skip-length) + (make-skipped skip-length #t) music)))) ;; we may only want to print the beginning; in this case