Re: FVWM: M4 vs. Cpp: pros and cons

From: Manfred Bartz <MBartz_at_werple.net.au>
Date: 17 Nov 1998 09:59:19 +1100

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_at_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_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Nov 16 1998 - 17:00:41 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:01 BST