Ok, I've taken another look at something that should help with this
amount of fine-grained definitions.  Do you think that the following
macro markup-when would be fine-grained enough to forego these kind of
definition?  I demonstrate it for implementing on-page-greater-than but
of course one may use it directly.  Its first argument is of the same
style as the #:properties keyword arg for define-markup-command .

#(define-macro (markup-when properties cond)
  `(lambda (layout props arg)
    (let ,(map (lambda (p)
                (if (pair? p)
                 `(,(car p) (chain-assoc-get ',(car p) props ,@(cdr p)))
                 `(,p (chain-assoc-get ',p props))))
           properties)
     (if ,cond (interpret-markup layout props arg)
      empty-stencil))))

#(define (on-page-greater-than nmbr)
  (markup-when ((page:page-number -1))
   (> page:page-number nmbr)))

\paper {
  #(set-paper-size "a7landscape")
  oddFooterMarkup = \markup \on-the-fly #(on-page-greater-than 3) "This
is long!"
}

\score {
  \repeat unfold 256 c'1
}


https://codereview.appspot.com/74540044/

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

Reply via email to