.\" t
.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@
.de EX		\"Begin example
.ne 5
.if n .sp 1
.if t .sp .5
.nf
.in +.5i
..
.de EE
.fi
.in -.5i
.if n .sp 1
.if t .sp .5
..
.TH FvwmM4 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules"
.UC
.SH NAME
FvwmM4 \- the fvwm  M4 pre-processor
.SH SYNOPSIS
Module FvwmM4 [options] filename

The FvwmM4 module can only be invoked by fvwm.
Command line invocation of the FvwmM4 module will not work.

.SH DESCRIPTION
When fvwm executes the FvwmM4 module,
FvwmM4 invokes the M4 pre-processor on the file
specified in its invocation, then FvwmM4 causes fvwm to
execute the commands in the resulting file.

.SH INVOCATION
FvwmM4 can be invoked as a module using an fvwm command,
from the .fvwm2rc file, a menu,
mousebinding, or any of the many other ways fvwm commands
can be issued.

If the user wants his entire .fvwm2rc file pre-processed with FvwmM4,
then fvwm should be invoked as:
.EX
fvwm -cmd "Module FvwmM4 .fvwm2rc"
.EE

Note that the argument to the option "-cmd" should be enclosed
in quotes, and no other quoting should be used.

When FvwmM4 runs as a module, it runs asynchronously
from fvwm.
If FvwmM4 is invoked from the .fvwm2rc,
the commands
generated by FvwmM4
may or may not be executed by the time
fvwm processes the next command in the .fvwm2rc.
Invoke FvwmM4 this way for synchronous execution:

.EX
ModuleSynchronous FvwmM4 -lock filename
.EE

.SH OPTIONS
Some options can be specified following the modulename:
.IP -m4-prefix
I think this makes all the m4 directives require the prefix "m4_".

.IP -m4-prefix-defines
Causes built-in defines to be prefixed with "m4_" (i.e., m4_HOME
is defined instead of HOME, etc.)

.TP
-m4opt \fIoption\fP
Lets you pass an option to the m4 program.  Not really needed as any
unknown options will be passed on automatically.

.TP
-m4-squote \fIcharacter\fP
Lets you change the m4 start-of-quote character to \fIcharacter\fP.

.TP
-m4-equote \fIcharacter\fP
Lets you change the m4 end-of-quote character to \fIcharacter\fP.

.TP
-m4prog \fIname\fP
Instead of invoking "m4", fvwm will invoke \fIname\fP.

.TP
-outfile \fIfilename\fP
Instead of creating a random unique name for the temporary file for
the preprocessed rc file, this option specifies the name of
the temporary file created.  FvwmM4 attempts
to remove this file before writing to it, so don't point it at anything
important even if it has read-only protection.

.IP -debug
Causes the temporary file created by m4 to
be retained. This file is usually called "/tmp/fvwmrcXXXXXX"

.IP -lock
If you want to use this option you need to start FvwmM4 with
ModuleSynchronous. This option causes fvwm to wait that the pre-process to
finish and then FvwmM4 asks fvwm to Read the pre-processed file before
continuing. This can be useful at startup if you use a session manager like
Gnome. Also, this is useful if you want to process and run a Form in
an fvwm function.

.IP -noread
Causes the pre-processed file to be not read by fvwm. Useful for
pre-processing an FvwmScript script.


.SH CONFIGURATION OPTIONS
FvwmM4 defines some values for use in the pre-processor file:

.IP TWM_TYPE
Always set to "fvwm".
.IP SERVERHOST
The name of the machine running the X Server.
.IP CLIENTHOST
The name of the machine running fvwm.
.IP HOSTNAME
The hostname of the machine running fvwm. Generally the same as CLIENTHOST.
.IP OSTYPE
The operating system for CLIENTHOST.
.IP USER
The name of the person running fvwm.
.IP HOME
The home directory of the person running fvwm.
.IP VERSION
The X11 version.
.IP REVISION
The X11 revision number.
.IP VENDOR
The X server vendor.
.IP RELEASE
The X server release number.
.IP SCREEN
The screen number.
.IP WIDTH
The screen width in pixels.
.IP HEIGHT
The screen height in pixels.
.IP X_RESOLUTION
Some distance/pixel measurement for the horizontal direction, I think.
.IP Y_RESOLUTION
Some distance/pixel measurement for the vertical direction, I think.
.IP PLANES
Number of color planes for the X server display
.IP BITS_PER_RGB
Number of bits in each rgb triplet.
.IP CLASS
The X11 default visual class, e.g. PseudoColor.
.IP COLOR
Yes or No, Yes if the default visual class is neither StaticGrey or GreyScale.
.IP FVWM_CLASS
The visual class that fvwm is using, e.g. TrueColor.
.IP FVWM_COLOR
Yes or No, Yes if the FVWM_CLASS is neither StaticGrey or GreyScale.
.IP FVWM_VERSION
The fvwm version number, ie 2.0
.IP OPTIONS
Some combination of SHAPE, XPM, NO_SAVEUNDERS, and M4, as defined in
configure.h at compile time.
.IP FVWM_MODULEDIR
The directory where fvwm looks for .fvwm2rc and modules by default, as
determined at compile time.
.IP FVWM_USERDIR
The value of $FVWM_USERDIR.
.IP SESSION_MANAGER
The value of $SESSION_MANAGER. Undefined if this variable is not set.

.SH EXAMPLE PROLOG

.EX
define(TWM_TYPE,``fvwm'')dnl
define(SERVERHOST,``spx20'')dnl
define(CLIENTHOST,``grumpy'')dnl
define(HOSTNAME,``grumpy'')dnl
define(OSTYPE,``SunOS'')dnl
define(USER,``nation'')dnl
define(HOME,``/local/homes/dsp/nation'')dnl
define(VERSION,``11'')dnl
define(REVISION,``0'')dnl
define(VENDOR,``HDS human designed systems, inc. (2.1.2-D)'')dnl
define(RELEASE,``4'')dnl
define(SCREEN,``0'')dnl
define(WIDTH,``1280'')dnl
define(HEIGHT,``1024'')dnl
define(X_RESOLUTION,``3938'')dnl
define(Y_RESOLUTION,``3938'')dnl
define(PLANES,``8'')dnl
define(BITS_PER_RGB,``8'')dnl
define(CLASS,``PseudoColor'')dnl
define(COLOR,``Yes'')dnl
define(FVWM_VERSION,``1.24l'')dnl
define(OPTIONS,``SHAPE XPM M4 '')dnl
define(FVWM_MODULEDIR,``/local/homes/dsp/nation/modules'')dnl
define(FVWM_USERDIR,``/local/homes/dsp/nation/.fvwm'')dnl
define(SESSION_MANAGER,``local/grumpy:/tmp/.ICE-unix/440,tcp/spx20:1025'')dnl
.EE

.SH AUTHORS

FvwmM4 is the result of a random bit mutation on a hard disk,
presumably a result of a  cosmic-ray or some such thing.
