[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fvwm
Subject:    Re: FVWM: M4 vs. Cpp: pros and cons
From:       Manfred Bartz <MBartz () werple ! net ! au>
Date:       1998-11-16 22:59:19
[Download RAW message or body]



Someone wrote:
> Fine, but it would be nice to hear *your* opinion on M4 vs. Cpp as well.


I personally prefer the CPP syntax, but M4 allows me to run external
programs or scripts as part of it's pre-processing.  I am not aware of 
a way that would allow me to do that in CPP.

For example, I have this macro which checks the existence of a program
(1st argument).  If it exists, it expands to the 2nd argument,
otherwise it expands to a comment.  This is very useful if you want to
use the same fvwm config file on a number of different machines.

m4_define({INST_EXISTING},{m4_dnl
m4_syscmd(test -x $1)m4_dnl
m4_ifelse(m4_sysval,0,{$2},{{\#} "$1" does not exist or is not executable})})m4_dnl

AddToMenu Clients-Popup	"Clients"	Title
INST_EXISTING({xemacs},{+ "XEmacs%mini-xemacs.xpm%" Exec xemacs})

The only thing that bugs me a bit is that M4 preprocessing is slow.
It actually seems to be significantly slower when run under fvwm2 as
compared to running it straight from the command line.

-- 
Manfred Bartz <mbartz@werple.net.au>
---------------------------------------------------------
Computers are not intelligent.  They only think they are.


--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo@hpc.uh.edu.
To report problems, send mail to fvwm-owner@hpc.uh.edu.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic