Move add-grob-definition from a snippet to scm/translation-functions.scm
add-grob-definition should be public, as that's the "official" way to
create a new grob in Scheme.
It is not the "official" way to create a new grob definition, but a hack ...
12 years, 11 months ago
(2012-04-27 22:00:35 UTC)
#1
It is not the "official" way to create a new grob definition, but a hack from
Mike done without understanding the implementation of \grobdefinitions. It is
not just tampering with a global variable (session-wide instead of parser-wide)
to add stuff to all-grob-descriptions, it is also inefficient and unnecessary
since all-grob-descriptions _have_ already been pulled into the Score context
definition _before_ the user code is even started.
Instead, one can just add a single context mod adding the new grob definition to
the Score context definition.
We really don't need to pull code with bad side effects from a snippet into the
main code.
It would make more sense to revert the respective commit creating the snippet
completely.
On 4/27/12 4:00 PM, "dak@gnu.org" <dak@gnu.org> wrote: > >Instead, one can just add a single ...
12 years, 11 months ago
(2012-04-27 23:01:54 UTC)
#2
On 4/27/12 4:00 PM, "dak@gnu.org" <dak@gnu.org> wrote:
>
>Instead, one can just add a single context mod adding the new grob
>definition to the Score context definition.
>
<Snip>
>It would make more sense to revert the respective commit creating the
>snippet completely.
>
>http://codereview.appspot.com/6128048/
>
What about fixing the snippet in scheme-text-spanner.ly so that it creates
the grob the proper way?
Thanks,
Carl
Carl Sorensen <c_sorensen@byu.edu> writes: > On 4/27/12 4:00 PM, "dak@gnu.org" <dak@gnu.org> wrote: >> >>Instead, one ...
12 years, 11 months ago
(2012-04-27 23:21:08 UTC)
#3
Carl Sorensen <c_sorensen@byu.edu> writes:
> On 4/27/12 4:00 PM, "dak@gnu.org" <dak@gnu.org> wrote:
>>
>>Instead, one can just add a single context mod adding the new grob
>>definition to the Score context definition.
>>
>
> <Snip>
>
>>It would make more sense to revert the respective commit creating the
>>snippet completely.
>>
>>http://codereview.appspot.com/6128048/
>>
>
> What about fixing the snippet in scheme-text-spanner.ly so that it
> creates the grob the proper way?
Since scheme-text-spanner.ly patches around a _lot_ of global variables
(grobs, event classes...), that's not sufficient for fixing the problems
with it. I am currently working on repairing the concept of redefining
event classes. Takes enough concentration as it is without defining a
reasonable interface for extending grobs.
One can make the futzing of grobs less broken than Mike did it even
without creating a proper straightforward interface, and I outlined how
to do it if someone really wants to go ahead with that and/or creating
some general-purpose extension code outside of a snippet. But this
particular snippet plasters over so many different things that I can
just fix them one by one. The grob definitions _are_ already stored in
a context mod inside of a context def, so it is totally unnecessary to
mess with global variables that will affect future files in the same
run.
For the event classes, this is harder to unglobalize. But the user
interfaces should likely end up somewhat similar, to make things not
harder than necessary to learn. So if at all, I am going to fix it
after the event classes. But in the mean time, I don't want more crud
like define-event-class to migrate into the code base.
--
David Kastrup
OK, the problem I wanted to address is to have a documented way to define ...
12 years, 11 months ago
(2012-04-28 03:08:13 UTC)
#4
OK, the problem I wanted to address is to have a documented way to define new
grobs. I hoped that moving add-grob-definition to a "public place" would be a
good start. If it's not, sorry for the noise.
On 2012/04/28 03:08:13, Pavel Roskin wrote: > OK, the problem I wanted to address is ...
12 years, 11 months ago
(2012-04-28 05:00:31 UTC)
#5
On 2012/04/28 03:08:13, Pavel Roskin wrote:
> OK, the problem I wanted to address is to have a documented way to define new
> grobs. I hoped that moving add-grob-definition to a "public place" would be a
> good start. If it's not, sorry for the noise.
scheme-text-spanner.ly contains a lot of code violating the parser/session
border. I would not be surprised if turned out to be the main culprit for our
instable regtests (like graphviz.ly).
I am actively working on it
<URL:http://code.google.com/p/lilypond/issues/detail?id=2449>, but can't do
anything at once.
It was just unlucky timing when you picked up more parts of it at a moment I was
already annoyed with its disregard for locality and working on fixing the
situation.
Issue 6128048: Move add-grob-definition from a snippet to scm/translation-functions.scm
Created 12 years, 11 months ago by Pavel Roskin
Modified 12 years, 11 months ago
Reviewers: dak, c_sorensen
Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Comments: 0