You could just do (let ((post (music-is-of-type? e 'post-event))) (stuff)). No point in creating a lambda for it.

On 04/20/17 17:43, Simon Albrecht wrote:
Am 20.04.2017 um 17:25 schrieb caag...@gmail.com:
There's a `post-event?` predicate defined in scm/define-music-display-methods.scm. I don't think that one's easily accessible outside that module, but you can copy it:

(define (post-event? m)
  (music-is-of-type? m 'post-event))

Here’s the resulting function:

after =
#(define-music-function (t e m) (ly:duration? ly:music? ly:music?)
    (let* ((post-event? (lambda (m)
                          (music-is-of-type? m 'post-event)))
           (post (post-event? e)))
      #{
        \context Bottom <<
          #m
          {
            \skip $t
            #(if post
                 #{ <> -\tweak extra-spacing-width #empty-interval $e #}
                 e)
          }
        >>
      #}))

Best, Simon

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to