lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: storing and manipulating multi-chunk texts


From: Thomas Morley
Subject: Re: storing and manipulating multi-chunk texts
Date: Sat, 8 Mar 2014 01:58:17 +0100

2014-03-07 14:41 GMT+01:00 Kieren MacMillan <address@hidden>:
> Hi Harm,
>
>> Comments, hints, tests are highly apreciated.
>
> your snippet + my setup (including Mac OS X 10.9.2 + Lilypond 2.19.2-1) = 
> spinning beachball of death
>
> =\
>
> Kieren.

Hi Kieren,

could you retest with:

#(define-markup-list-command (line-parts layout props args)(markup-list?)
  (let* ((fromproperty-markup?
            (lambda (m) (if (procedure? m)
                        (eq? 'fromproperty-markup (procedure-name m))
                        #f)))
         (line-markup?
            (lambda (m) (if (procedure? m)
                            (eq? 'line-markup (procedure-name m))
                            #f)))
         (arg (if (not (null? args)) (car args))))

   (cond
      ;; deal with an empty markup-list:
      ((null? args) (list empty-stencil))

      ;; what to do, if (car arg) is not of type fromproperty/line-markup:
      ((and (list? arg) ;; hmm, can arg ever be not a list?
            (not (null? arg))
            (not (fromproperty-markup? (car arg)))
            (not (line-markup? (car arg))))
       (interpret-markup-list layout props args))

      ;; fromproperty-markup needs to be special-cased, because it's argument
      ;; is not a line-markup, but a symbol, looked up in props.
      ;;
      ;; hmm, do I need to do:
      ;;    (cons
      ;;       (list (cons symbol `(,property-recursive-markup ,symbol)))
      ;;       props)
      ;; again? (it's already done in fromproperty-def)
      ((and (list? arg) ;; hmm, can arg ever be not a list?
            (not (null? arg))
            (fromproperty-markup? (car arg)))

       (let* ((fromprop-arg (chain-assoc-get (last arg) props))
              (fromprop-arg-list (if (not (list? fromprop-arg))
                                     (list fromprop-arg)
                                     fromprop-arg)))
         (if fromprop-arg
             (interpret-markup-list layout props
                  (if (procedure? (car fromprop-arg-list))
                      (last fromprop-arg-list)
                      fromprop-arg-list))
             (list empty-stencil))))

      ;; what to do with a line-markup:
      ((and (list? arg)
            (not (null? arg))
            (line-markup? (car arg)))
       (interpret-markup-list layout props (last arg)))

      ;; in any other case return empty-stencil.
      ;; hmm, are other cases thinkable at all?
      (else (list empty-stencil)))))


If it fails again your test-file would be very helpfull.

Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]