lilypond-devel
[Top][All Lists]
Advanced

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

Re: guilev2 problem (user-markup-command sometimes not accepted)


From: Thomas Morley
Subject: Re: guilev2 problem (user-markup-command sometimes not accepted)
Date: Mon, 12 Nov 2018 10:16:02 +0100

Am So., 11. Nov. 2018 um 21:14 Uhr schrieb David Kastrup <address@hidden>:
>
> David Kastrup <address@hidden> writes:
>
> > Thomas Morley <address@hidden> writes:
> >
> >> Hi,
> >>
> >> the following works fine with current master (and every tested 
> >> lily-version):
> >> #(begin
> >>  (define-markup-command (dummy layout props arg) (markup?)
> >>    (interpret-markup layout props arg))
> >>  (display-scheme-music (markup #:dummy "foo")))
> >> #(display "whatever")
> >>
> >> With guilev2 I get:
> >> $ lilypond-git-guile-2.2 atest-85.ly
> >> GNU LilyPond 2.21.0
> >> Processing `atest-85.ly'
> >> Parsing...
> >> fatal error: Not a markup command: dummy
> >>
> >> Not even the later 'display' is reached.
> >>
> >> Though this works:
> >> #(define-markup-command (dummy layout props arg) (markup?)
> >>    (interpret-markup layout props arg)
> >> #(display-scheme-music (markup #:dummy "foo")))
> >> #(display "whatever")
> >>
> >>
> >> I'm not able to track this down, anyone with some insight?
> >
> > I think that Guilev2 may do the syntax form expansion concerning
> > "markup" before executing the define-markup-command when both are
> > contained in one begin form.  Macros are executed a bit differently in
> > Guilev2 than in Guilev1.

Followup questions:
Is this fixable?
If yes, it is worth the effort?

> The markup macro is a piece of crock anyway.  Use
> (display-scheme-music (make-dummy-markup "foo"))
> or
> (display-scheme-music #{ \markup \dummy foo #})
> here to get out of that predicament.

Yep, works.
Part of the problem is I have only a vague guess where in our source
which syntax possibility regarding markup is made available.

I _think_ 'make-dummy-markup' and 'dummy-markup' is done with
(defmacro-public define-markup-command ...) from markup-macros,scm.

Though not sure about (markup #:dummy ...), where is it made available?

The error "Not a markup command: ..." seems to come from (define
(compile-markup-expression expr) ...) triggered by (define
(lookup-markup-command-aux symbol) ...) which looks at
(current-module).
As far as I can tell 'lookup-markup-command-aux' searches the module
for 'dummy-markup', without success.

So the guess is for guilev2 'define-markup-command ' is not done for
'dummy', when 'lookup-markup-command-aux' starts?
Why does 'make-dummy-markup' work then?


Sorry if this message is a bit mazily. I _am_ confused ...


Cheers,
  Harm



reply via email to

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