Subject: automatic defaults in man page?

From: Dominik Vogt <[email-masked]>
Date: Fri, 20 Aug 1999 13:20:04 +0200

Here's a challenge for our configure experts:

THere is a file libs/defaults.h where lots of tuning/default
constants for fvwm are defined. I want to use the same constants
in the man page so that I don't need to update it every time
one of the defaults changes. Any hints how to do this?

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [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: Ben Winslow <[email-masked]>
Date: Fri, 20 Aug 1999 14:58:08 -0400 (EDT)

On Fri, 20 Aug 1999, Dominik Vogt wrote:

# Here's a challenge for our configure experts:
# 
# THere is a file libs/defaults.h where lots of tuning/default
# constants for fvwm are defined. I want to use the same constants
# in the man page so that I don't need to update it every time
# one of the defaults changes. Any hints how to do this?
# 
# Bye
# 
# Dominik ^_^
# 
# 
Well, libs/defaults.h isn't generated by configure, so it would be a bit of
a pain..  One option is to have this file generated by configure (perhaps
with options to set them as well), in which case it would be really easy--
just add the man pages to AC_OUTPUT() and use the appropriate @var@
replacements in the man pages.  The alternative is:

echo -n "Generating man pages..."
grep '^#define' libs/defaults.h | awk '{print "s/@"$2"@/"$3"/g"}' > config.tmp
for x in `find . -name "*.[1-8].in"`; do
	sed -f config.tmp $x > `echo $x | sed 's/\.in//'`
done
rm -f config.tmp
echo "Done."

That would accomplish what you're after. It looks pretty ugly, but
it's not straying too far from the way configure would do it... 

You'd end up using something like:
"... The default delay is @DEFAULT_CLICKTIME@ milliseconds...." 

-- 
Ben Winslow / [email-masked] / |Rain| / freshmeat news squad

Knowledge is of no value unless you put it into practice.
- Heber J. Grant

---

From: Dan Espen <[email-masked]>
Date: Fri, 20 Aug 1999 15:22:21 -0400

The idea   of   "configure" changing the content     of man pages,  is
interesting.   This way, the fvwm2 man  page could  drop references to
XPMs if they aren't installed, etc.

However, this would  create a bit of  a problem on our  web site.  The
generated man  pages would reflect the  options chosen by the last one
to generate the pages.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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: Dominik Vogt <[email-masked]>
Date: Sat, 21 Aug 1999 00:31:21 +0200

> 	sed -f config.tmp $x > `echo $x | sed 's/\.in//'`

I think that's not portable enough with sed and awk. If I use configure,
where would I put the default values? I'd like to be able to keep them
in defaults.h.in if possible.

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]