FVWM: M4 examples?

From: Nicholas Vargish <vargish_at_mailbox.sura.net>
Date: Fri, 29 Dec 1995 10:31:37 -0500

Hi,

Sorry to be an idiot, but I can't figure this m4 macro language out. I'm
trying to build an .fvwm2rc that will work both at home (on my Linux
box) and at work (Sparcstations). I'd like to use m4 to preprocess the
file, so I can set up paths and the like automatically, and not have
to hand-edit the file every time I copy it from work to home (and vice
versa).

Someone else must be doing this, right? I can't find any actual examples
in the docs or in the archives of this list. Let me just include the
stuff that I've been trying, perhaps some more enlightened soul can
show me where I'm going wrong?


My first effort was to do this:

This is the basic definition, establish the default:

m4_define(`icopath',`/homes/critters/vargish/lib/icons:/var/local/X11R6/include/X11/bitmaps:/usr/local/X11R6/include/X11/bitmaps')

Then check the HOSTNAME and change the definition if needed:

m4_ifelse(`HOSTNAME',`imrryr',`m4_define(`icopath',`/homes/nick/lib/icons:/usr/X11R6/include/X11/bitmaps')')

Which didn't really do the trick -- it didn't change the definition. I tried
removing the quotes around the `m4_define(...)' section, but that didn't
help -- it changed the definition every time, even when HOSTNAME was not
defined as imrryr.

Okay, so the second attempt was to do this:

m4_define(`modpath',m4_ifelse(`HOSTNAME',`imrryr',`/usr/X11R6/lib/X11/fvwm2:/usr/X11R6/bin',`/var/local/X11R6/lib/X11/fvwm2:/usr/local/X11R6/lib/X11/fvwm2:/var/local/X11R6/bin:/usr/local/X11R6/bin'))

But this doesn't work either... When HOSTNAME is imrryr, it still uses the
second definition, the not-clause.

I think I must be confused about m4 quoting rules, but I'm not sure
exactly where I'm going wrong. I'd appreciate any advice people might
have... Examples would be especially welcome -- I learn well from those.

Nick

p.s. Is there any way to make those m4 definitions "prettier"? I'm just not
a big fan of 220-character lines...


 +------------------------------------+ Love's not Time's fool, though
 | Nick Vargish, BBN Planet (SURAnet) | rosy lips and cheeks
 | vargish_at_sura.net 301/489-8134 | Within his bending sickle's
 | http://www.sura.net/~vargish | compass come [Shakespeare]


--
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Dec 29 1995 - 09:31:35 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:58 BST