lilypond-devel
[Top][All Lists]
Advanced

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

Re: input/regression/scheme-text-spanner.ly: fix problem with constants


From: david . nalesnik
Subject: Re: input/regression/scheme-text-spanner.ly: fix problem with constants (issue 11614044)
Date: Tue, 23 Jul 2013 20:05:40 +0000

On 2013/07/23 15:06:51, dak wrote:
On 2013/07/23 13:52:13, david.nalesnik wrote:

> Sorry, replied a bit hastily!

[...]

> I've thought some more about the issue of trying to change constants
elsewhere
> in the file.
>
> Specifically, regarding the addition of the new grob description to
> all-grob-descriptions, would the following be any better?
>
> So, as I understand it, remove add-grob-description, duplicating its
changes
to
> the description of 'SchemeTextSpanner, and creating a new variable
to avoid
> tampering with all-grob-descriptions, using that new variable in the
layout
> block.

No, that's not necessary.  all-grob-descriptions is defined as a
session
variable, so it will be restored at the end of the session.  You must
not change
it _destructively_ (meaning that you must not change any of its cons
cells or
what they point to), but you can replace with a different list as a
whole.

Since the code only added to the _front_ of all-grob-descriptions,
this part was
entirely harmless.

The problem is rather with the code in "complete-grob-entry" or what
it was.
That one worked destructively on constant lists (like, one may add,
our current
code for creating all-grob-descriptions originally does).

So what is being done is just as bad as our existing code elsewhere,
but there
is no interference with it.

The part adding stuff to the front of all-grob-descriptions is fine by
itself.

Hmmm, so if I understand correctly:

The problem in the regtest is that add-grob-definition should not be
applied to the quasiquoted list. In doing so, however, nothing is being
done that doesn't have precedent in define-grobs.scm.

I'm not understanding from your answer if you'd like me to change
anything here, though.

I hesitate to do something like the following!

#(add-grob-definition
  'SchemeTextSpanner
  (list
    (cons
      'bound-details
      (list
        (cons 'left
              (list
                (cons 'Y 0)
                (cons 'padding 0.25)
                (cons 'attach-dir LEFT)))
        (cons 'left-broken
              (list
                 (cons 'end-on-note #t)))
        (cons 'right
              (list
                (cons 'Y 0)
                (cons 'padding 0.25)))))
    (cons 'dash-fraction 0.2)
    (cons 'dash-period 3.0)
    (cons 'direction UP)
    (cons 'font-shape 'italic)
    (cons 'left-bound-info ly:line-spanner::calc-left-bound-info)
    (cons 'outside-staff-priority 350)
    (cons 'right-bound-info ly:line-spanner::calc-right-bound-info)
    (cons 'staff-padding 0.8)
    (cons 'stencil ly:line-spanner::print)
    (cons 'style 'dashed-line)
    (cons 'meta
          (list
            (cons 'class 'Spanner)
            (cons 'interfaces
                  (list
                    'font-interface
                    'line-interface
                    'line-spanner-interface
                    'side-position-interface))))))

https://codereview.appspot.com/11614044/



reply via email to

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