On Tue, 07 Jan 2003 15:17:07 +1100 Bruce Badger wrote: 
> files into one big presentation, but $include is a one-shot thing for 
> establishing defaults :-(  So, it seems that there is no built-in way
> of doing this in mgp.  How, then, can I do what I want?

Sounds like a job for m4!  Well, it sounds like a job for cpp, chpp,
perl, python, or whatever your favourite scripting language happens to
be.  But today I chose m4. :-)

> I guess if i could have a file like "next-tuesday-talk.mgp.spec" that 
> looked like:
>     $include 'common-header.mgp'
>     $include 'funny-story-1.mgp'
>     $include 'technical-bit-1.mgp'
>     ...etc...

At it's simplest, next-tuesday-talk.mgp.m4 would be something like:
include(common-header.mgp)
include(funny-story-1.mgp)
include(technical-bit-1.mgp)
include(blah)

But there's nothing stopping you from creating a talk-header.m4 with
macros for all your files, like:
include(common-header.mgp)
define(FUNNY-STORY-1 `/path/to/funny-story-1.mgp')dnl

then include that in your talk file, and use commands like
include(FUNNY-STORY-1)

You can stick macros in the.mgp files themselves as well, say to include
the current date.

The info manual for m4 is fairly thorough as far as syntax.  I'm sure
google will find tutorials that are much more legible than my effort.

m4 is good for much more than just sendmail configs!

-- 
Pete
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to