Subject: Re: FVWM: FvwmM4 question

From: Dominik Vogt <[email-masked]>
Date: Sun, 7 May 2000 05:36:00 +0200

On Sat, May 06, 2000 at 10:03:04PM -0230, Neil Zanella wrote:
> 
> Hello,
> 
> The FvwmM4 man page says:
> 
> FvwmM4 can be invoked by inserting the  line  'FvwmM4' in the
> .fvwm2rc file.
> 
> I would like to see an example of how FvwmM4 can be used in this way.
> 
> Then the man page also says:
> 
> It can also be called from a menu or mouse binding.
> 
> but again provides no examples of this. Perhaps an example or
> two would be useful here since I put the following in my .fvwm2rc
> but it's not working right:
> 
> FvwmM4
> define(`foo',`bar')
> 
> I would like to know a little bit more about the first two ways of
> invoking FvwmM4 described in the man page.

You need to understand how fvwm parses its configuration file.
When you run fvwm withour arguments, it executes the command

  Read <config file>

where <config file> is .fvwm2rc or (if this doesn't exist
system.fvwm2rc).  If you preprocess the config file you
run it with "-cmd FvwmM4/FvwmCpp $HOME/.fvwm2rc".  I.e.

  Read <config file>

is replaced by

  FvwmM4 <config file>

FvwmM4/Cpp work exactly like Read, except that they run
the preprocessor over the file before passing it to fvwm.
Thus, if FvwmM4 is invoked in the config file, you can't
use it to preprocess the config file anymore because that
step has already passed.

Since you simply put "FvwmM4" in the config file, the
module simply didn't know which file to parse.  Had you
used

  FvwmM4 .fvwm2rc

this would have started an endless loop because the file
would have been parsed again *from the start*, not from
behind the FvwmM4 command.

In short:

You can use the preprocessor modules from within the config
file or a menu to parse *other* files:

.fvwm2rc:
--------------------------
# parse sub config files
FvwmM4 .fvwm2rc.styles
FvwmM4 .fvwm2rc.menustyles
Read .fvwm2rc.modules

# menus
AddToMenu RootMenu
+ "Reset styles" FvwmM4 .fvwm2rc.styles
...
--------------------------

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Neil Zanella <[email-masked]>
Date: Sun, 7 May 2000 04:23:29 -0230 (NDT)

On Sun, 7 May 2000, Dominik Vogt wrote:

> If you preprocess the config file you

I tried some things such as:

+              "Restart Fvwm2" Restart fvwm2 -cmd
"FvwmM4 /etc/X11/fvwm2/system.fvwm2rc"

and

+              "Restart Fvwm2" Restart /usr/local/bin/fvwm2 -cmd "FvwmM4
/etc/X11/fvwm2/system.fvwm2rc"

but when I restart I get a totally different configuration menu than the
one I set up. My config file /etc/X11/fvwm2/system.fvwm2rc has no M4 stuff
in it (yet) and hence should not be modified upon restarting.

The following works fine but no M4 stuff can be preprocessed this way:

+              "Restart Fvwm2" Restart /usr/local/bin/fvwm2 -cmd "Read
/etc/X11/fvwm2/system.fvwm2rc"

BTW, all three mouse buttons pop up a builtin menu when I
restart with -cmd "FvwmM4 /etc/X11/fvwm2/system.fvwm2rc"

The relevant .xsession-errors are:

stdin: is not a tty

and

NONE:0: m4: ERROR: EOF in string
NONE:0: m4: ERROR: EOF in string
NONE:0: m4: ERROR: EOF in string

Thanks,

Neil

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 13 May 2000 05:41:29 +0300

> NONE:0: m4: ERROR: EOF in string

This means that m4 (not fvwm's tool) having problems processing your
system.fvwm2rc. You should have backquote and then code 255 in this file.
There is nothing fvwm can do if your input file can't be processed by m4.

Regards,
Mikhael.