Re: .dm macros

From Stefan Boddie
DateThu, 5 Dec 2002 14:56:51 +1300
Subject Re: .dm macros
In-Reply-To (20021204145613Z-tao-lib-uchicago-edu)
Hi Tod,

> I am seeing inconsistencies in the hows and whys of .dm macros
> expansion.
>
> I have the following lines in base.dm:
>
> page [c=chpdemo] {image }
> pages [c=chpdemo] {images}
> _textgoto_ [c=chpdemo] {go to image}
>
> These macros are used by the page-turning interface and apply to a
> collection of scanned piano scores. All three macros are defined in
> english.dm, and I try to override them, for one collection, with these
> defns in base.dm. page and pages expand as in base.dm, shown
> above, but _textgoto_ (the button label) expands as defined in
> english.dm. Anyone know why?
>

This is because _textgoto_ belongs to the "document" package while page
and pages belong to the "Global" package. You'll notice that somewhere
above the definition ot _textgoto_ in english.dm is a line reading "package
document". To do what you want you'd need to either put your overridden
_textgoto_ macro in the document.dm file or do something like the following
in base.dm:

page [c=chpdemo] {image }
pages [c=chpdemo] {images}
package document
_textgoto_ [c=chpdemo] {go to image}
package Global

> As a followup question, I'd like to use some macros from the .dm files
> in format strings in the collect.cfg format string, but my experiments
> have failed. Is this possible, and under what conditions?
>

You should be able to put any macros in your format strings. Once again you
need to keep in mind what package the macro belongs to though. If it's in
the Global package you can specify it simply as _macroname_. Otherwise
you'll need to use _packagename:macroname_.

cheers,
Stefan.