From MAILER-DAEMON Sat Jul 02 15:09:46 2005
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1DonN4-00036A-GS
	for mharc-groff-commit@gnu.org; Sat, 02 Jul 2005 15:09:46 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1DomH8-000480-1J
	for groff-commit@gnu.org; Sat, 02 Jul 2005 13:59:34 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1DomH4-00047U-MO
	for groff-commit@gnu.org; Sat, 02 Jul 2005 13:59:33 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1DomGU-0003kh-Is
	for groff-commit@gnu.org; Sat, 02 Jul 2005 13:58:54 -0400
Received: from [199.232.41.3] (helo=savannah.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dom1e-00066c-G8
	for groff-commit@gnu.org; Sat, 02 Jul 2005 13:43:35 -0400
Received: from savannah.gnu.org ([127.0.0.1])
	by savannah.gnu.org with smtp (Exim 3.35 #1 (Debian))
	id 1DolwA-00076Y-00
	for <groff-commit@gnu.org>; Sat, 02 Jul 2005 13:37:54 -0400
To: groff-commit@gnu.org
From: Werner LEMBERG <wl@gnu.org>
Message-Id: <E1DolwA-00076Y-00@savannah.gnu.org>
Date: Sat, 02 Jul 2005 13:37:54 -0400
X-Mailman-Approved-At: Sat, 02 Jul 2005 15:09:44 -0400
Subject: [Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub RE...
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: groff-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/groff-commit>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jul 2005 17:59:34 -0000

CVSROOT:	/cvsroot/groff
Module name:	groff
Branch: 	
Changes by:	Werner LEMBERG <wl@savannah.gnu.org>	05/07/02 17:37:54

Modified files:
	contrib/groffer: ChangeLog Makefile.sub README README_SH TODO 
	                 groffer.man groffer.sh 

Log message:
	* release of groffer 0.9.18
	
	* groffer.sh: further shell compatibility
	- `echo': Remove options and possible options of `echo' by
	preceding the argument with a character `x' that is removed by
	`sed' or replace `echo' by `cat <<EOF'.  `echo -n' seems to be not
	portable, so it is omitted.
	- `for': Remove `;' from within `for' (because of ksh).
	- `ls': Old UNIX systems echoed the error message to standard
	output.  So handle the output with `sed'.  If the output contains
	`not found' map it to an empty string.
	- `true': Replace `true' by command `:'.  Remove test of `true'
	(because `ash' refuses the redefinition of builtins even in an
	unreachable `if' branch).
	- `false': Remove test of `false'; it isn't used any more.
	- `test': As `test -e' does not exist in Solaris 2.5 replace it by
	`test -f || test -d'.
	- `unset': `unset' is said to be not portable.  As `ash' protests
	against the definition of the function `unset()' in the test of
	`unset' replace the test by defining `$unset' to `unset' if it
	exists and to `:' otherwise.  Use `eval $unset' instead of the
	direct command `unset'.
	- _get_opt_shell(): Replace `for' loop with `shift' by `while'.
	- man_search_section(): Replace `for f in filename*' by a test on
	the existence of `filename*'.
	- `zsh' interprets `$...' as `"$..."'.  So `eval' must be called;
	This cannot be used in `for i in $f', so it must be rewritten as
	`for i in $(eval set x $f; shift; echo "$@")'
	
	* groffer.sh:
	- `--X', `--x', `--mode=X', `--mode=x': Make these options
	equivalent to chosing an X device by setting `-TX75-12'.  `-X' is
	still equivalent to `groff -X'.
	- main_init(): Choose the name of the temporary file by adding a
	number using `expr' if it exists and cannot be removed.
	- main_parse_args():Repair some options by replacing `$mpa_mode'
	by `$_OPT_MODE'.
	- catz(): Rename it to cat_z() to avoid problem with existing
	programs.
	- where(): Rename to where_is().
	- $_CONFFILES: Rename to $_CONF_FILES.
	- $_HAS_BZIP: export and preset it.
	
	* groffer.man:
	- Document the `X mode' changes.
	- Add `@g@' to `troff'.
	
	* README, README_SH, TODO:
	- Add date line `Latest update:'.
	- Add `...' quoting to essential terms.
	- Add Emacs mode at the end.
	
	* README_SH:
	- Add documentation on the above compatibility changes.
	- Add documentation on used commands.
	- Mention the tested shells.
	
	* Makefile.sub:
	Readd `@g@'.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/ChangeLog.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/Makefile.sub.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/README.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/README_SH.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/TODO.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.man.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.sh.diff?tr1=1.28&tr2=1.29&r1=text&r2=text

Patches:
Index: groff/contrib/groffer/ChangeLog
diff -u groff/contrib/groffer/ChangeLog:1.28 groff/contrib/groffer/ChangeLog:1.29
--- groff/contrib/groffer/ChangeLog:1.28	Fri Jun 24 19:52:39 2005
+++ groff/contrib/groffer/ChangeLog	Sat Jul  2 17:37:54 2005
@@ -1,9 +1,72 @@
 	________________________________________________________________
+	* release of groffer 0.9.18
+
+2005-07-01  Bernd Warken
+
+	* groffer.sh: further shell compatibility
+	- `echo': Remove options and possible options of `echo' by
+	preceding the argument with a character `x' that is removed by
+	`sed' or replace `echo' by `cat <<EOF'.  `echo -n' seems to be not
+	portable, so it is omitted.
+	- `for': Remove `;' from within `for' (because of ksh).
+	- `ls': Old UNIX systems echoed the error message to standard
+	output.  So handle the output with `sed'.  If the output contains
+	`not found' map it to an empty string.
+	- `true': Replace `true' by command `:'.  Remove test of `true'
+	(because `ash' refuses the redefinition of builtins even in an
+	unreachable `if' branch).
+	- `false': Remove test of `false'; it isn't used any more.
+	- `test': As `test -e' does not exist in Solaris 2.5 replace it by
+	`test -f || test -d'.
+	- `unset': `unset' is said to be not portable.  As `ash' protests
+	against the definition of the function `unset()' in the test of
+	`unset' replace the test by defining `$unset' to `unset' if it
+	exists and to `:' otherwise.  Use `eval $unset' instead of the
+	direct command `unset'.
+	- _get_opt_shell(): Replace `for' loop with `shift' by `while'.
+	- man_search_section(): Replace `for f in filename*' by a test on
+	the existence of `filename*'.
+	- `zsh' interprets `$...' as `"$..."'.  So `eval' must be called;
+	This cannot be used in `for i in $f', so it must be rewritten as
+	`for i in $(eval set x $f; shift; echo "$@")'
+
+	* groffer.sh:
+	- `--X', `--x', `--mode=X', `--mode=x': Make these options
+	equivalent to chosing an X device by setting `-TX75-12'.  `-X' is
+	still equivalent to `groff -X'.
+	- main_init(): Choose the name of the temporary file by adding a
+	number using `expr' if it exists and cannot be removed.
+	- main_parse_args():Repair some options by replacing `$mpa_mode'
+	by `$_OPT_MODE'.
+	- catz(): Rename it to cat_z() to avoid problem with existing
+	programs.
+	- where(): Rename to where_is().
+	- $_CONFFILES: Rename to $_CONF_FILES.
+	- $_HAS_BZIP: export and preset it.
+
+	* groffer.man:
+	- Document the `X mode' changes.
+	- Add `@g@' to `troff'.
+
+	* README, README_SH, TODO:
+	- Add date line `Latest update:'.
+	- Add `...' quoting to essential terms.
+	- Add Emacs mode at the end.
+	
+	* README_SH:
+	- Add documentation on the above compatibility changes.
+	- Add documentation on used commands.
+	- Mention the tested shells.
+
+	* Makefile.sub:
+	Readd `@g@'.
+
+	________________________________________________________________
 	* release of groffer 0.9.17
 
 2005-06-23  Bernd Warken
 
-	* groffer.sh: get rid of `local' in functions (non-POSIX)
+	* groffer.sh: get rid of `local' in functions (it is not POSIX)
 	- Replace local variables by variable names with a special prefix
 	that is an abbreviation of the corresponding function name (quasi-
 	local variables).
@@ -22,9 +85,9 @@
 	- obj*(): Add return modes.
 	- Rewrite tests for `true' and `false'.
 	- Add function names to error calls where it was forgotten.
-	- for: Replace `for x in "$@"' by `for x'.
-	- set: Replace `set -- ...' by `set x ...; shift'.
-	- sed: Replace `\|.*|s|...|...|' by `s|...|...|'.
+	- `for': Replace `for x in "$@"' by `for x'.
+	- `set': Replace `set -- ...' by `set x ...; shift'.
+	- `sed': Replace `\|.*|s|...|...|' by `s|...|...|'.
 
 	* README_SH:
 	- Add information on the removing of `local'.
@@ -960,10 +1023,12 @@
 	* development of `groffview' shell script started
 
 2001-11-28  Bernd Warken
+
 	________________________________________________________________
 	License
 
-	Copyright (C) 2001,2002,2003,2004 Free Software Foundation, Inc.
+	Copyright (C) 2001,2002,2003,2004,2005 Free Software Foundation,
+	Inc.
 	Written by Bernd Warken
 	Copying and distribution of this file, with or without
 	modification, are permitted provided the copyright notice and this
Index: groff/contrib/groffer/Makefile.sub
diff -u groff/contrib/groffer/Makefile.sub:1.9 groff/contrib/groffer/Makefile.sub:1.10
--- groff/contrib/groffer/Makefile.sub:1.9	Mon Jun 20 19:27:41 2005
+++ groff/contrib/groffer/Makefile.sub	Sat Jul  2 17:37:54 2005
@@ -2,7 +2,7 @@
 
 # File position: <groff-source>/contrib/groffer/Makefile.sub
 
-# Last update: 16 June 2005
+# Last update: 30 June 2005
 
 # Copyright (C) 2001,2002,2005 Free Software Foundation, Inc.
 # Written by Werner Lemberg <wl@gnu.org>
@@ -37,6 +37,7 @@
 groffer: groffer.sh $(SH_DEPS_SED_SCRIPT)
 	$(RM) $@; \
 	sed -f $(SH_DEPS_SED_SCRIPT) \
+            -e "s|@g@|$(g)|g" \
 	    -e "s|@BINDIR@|$(bindir)|g" \
 	    -e "s|@VERSION@|$(version)$(revision)|g" \
 	    -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@; \
Index: groff/contrib/groffer/README
diff -u groff/contrib/groffer/README:1.5 groff/contrib/groffer/README:1.6
--- groff/contrib/groffer/README:1.5	Thu May 26 21:01:57 2005
+++ groff/contrib/groffer/README	Sat Jul  2 17:37:54 2005
@@ -26,23 +26,23 @@
 
 Output
 
-All input is first sent to `grog' to determine the necessary groff
+All input is first sent to `grog' to determine the necessary `groff'
 options and then to `groff'.  So no special `groff' arguments must be
 given.  But all `groff' options can be specified when this seems to be
 appropriate.
 
 The following displaying modes for the output are available:
 - Display formatted input with
--- the X roff viewer `gxditview',
+-- the X `roff' viewer `gxditview',
 -- a Prostcript viewer,
 -- a PDF viewer,
 -- a DVI viewer,
 -- a web browser,
 -- a pager in a text terminal (tty).
-- Generate groff output on stdout without a viewer.
-- Generate the troff intermediate output on standard output without
+- Generate `groff' output on stdout without a viewer.
+- Generate the `groff intermediate output' on standard output without
   postprocessing.
-- Output the source code without any groff processing.
+- Output the source code without any `groff' processing.
 By default, the program tries to display with `gxditview' as graphical
 device in X; on non-X text terminals, the `tty' text mode with a pager
 is tried by default.
@@ -51,20 +51,23 @@
 Compatibility
 
 `groffer' is a shell script.  It should run on any POSIX or Bourne
-style shell that supports shell functions with local variables.
+style shell that supports shell functions.  See file `README_SH'.
 
 
 Mailing lists
 
 For reporting bugs of `groffer', groff's free mailing list
 <bug-groff@gnu.org> can be used.  For a general discussion, the
-mailing list <groff@gnu.org> is more useful; see the `README' file in
-the top directory of the `groff' source package for more details on
-these mailing lists.
+mailing list <groff@gnu.org> is more useful, but one has to subscribe
+to this list at http://lists.gnu.org/mailman/listinfo/groff.  See the
+`README' file in the top directory of the `groff' source package for
+more details on these mailing lists.
 
 
 ####### License
 
+Last update: 30 June 2005
+
 Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
 Written by Bernd Warken
 
@@ -84,3 +87,10 @@
 along with groff; see the files COPYING and LICENSE in the top
 directory of the groff source.  If not, write to the Free Software
 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: groff/contrib/groffer/README_SH
diff -u groff/contrib/groffer/README_SH:1.7 groff/contrib/groffer/README_SH:1.8
--- groff/contrib/groffer/README_SH:1.7	Fri Jun 24 19:52:39 2005
+++ groff/contrib/groffer/README_SH	Sat Jul  2 17:37:54 2005
@@ -20,18 +20,80 @@
 documentation `Portable shells' in the `info' page of `autoconf'
 (look-up in Emacs-Help-Manuals).
 
-- The command parts `then', `else', and `do' are written each on a
+- The command parts `then', `else', and `do' must be written each on a
   line of their own.
 
-- Replace `for i in "$@"' by `for i'.
+- Replace `for i in "$@"' by `for i' and remove internal `;' (kah).
 
 - Replace `set -- ...' by `set x ...; shift'.  After the first
   non-option argument, all arguments including those starting with `-'
   are accepted as non-option.
 
-- The name of the variable in `for' is chosen as a single character.
-  The content of such variables is not safe.  So it is often stored in
-  an additional quasi-local variable.
+- The name of the variable in `for' is chosen as a single character
+  (old ash).  The content of such variables is not safe because it can
+  also occur in other functions.  So it is often stored in an
+  additional quasi-local variable.
+
+- `echo' is not portable on options; some `echo' commands have many
+  options, others have none.  So `echo -n' cannot be used, such that
+  the output of each function has complete lines.  There are two
+  methods to avoid having `-' as the first character of any argument.
+  Either a character such as `x' can be prepended to the argument;
+  this must later on be removed by `sed'.  Otherwise, `echo' can be
+  replaced by `cat <<EOF'.
+
+- `ls' has problems.  Old UNIX systems echoed the error message to
+standard output.  So handle the output with `sed'.  If the output
+contains `not found' map it to an empty string.
+
+- As `test -e' is not available in Solaris 2.5 replace it by
+  `test -f || test -d'.
+
+- As `unset' is not supported by all shells replace ist by `eval
+  $unset' where this variable is `unset' if it exists and `:'
+  otherwise.
+
+- Replace `true' by `:', `false' isn't used.
+
+- Do not redefine builtins as functions (ash).
+
+The `groffer' script was tested under the shells `ash', `bash',
+`dash', 'ksh', `pdksh', and 'posh' without problems in Linux Debian.
+`zsh' works, but produces a minor problem (in the modes dvi, pdf, ps,
+and X, an empty page is added as first page.)
+
+The script uses the following commands:
+.
+:
+apropos
+break
+bzip2
+cat
+catz
+continue
+echo
+eval
+expr
+grep
+groff
+grog
+gs
+gzip
+ls
+man
+mkdir
+mv
+return
+rm
+rmdir
+sed
+set
+sh
+shift
+test
+trap
+umask
+unset
 
 The `groffer' script provides its own option parser.  It is compatible
 to the usual GNU style command line (option clusters, long option
@@ -82,7 +144,6 @@
 do_filearg (<filearg>)
 do_nothing ()
 echo2 (<text>*)
-echo2n (<text>*)
 error (<text>*)
 get_first_essential (<arg>*)
 is_dir (<name>)
@@ -197,6 +258,8 @@
 
 ####### License
 
+Last update: 1 July 2005
+
 Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
 Written by Bernd Warken
 
@@ -216,3 +279,10 @@
 along with groff; see the files COPYING and LICENSE in the top
 directory of the groff source.  If not, write to the Free Software
 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: groff/contrib/groffer/TODO
diff -u groff/contrib/groffer/TODO:1.12 groff/contrib/groffer/TODO:1.13
--- groff/contrib/groffer/TODO:1.12	Thu May 26 21:01:57 2005
+++ groff/contrib/groffer/TODO	Sat Jul  2 17:37:54 2005
@@ -6,30 +6,26 @@
 ####### TODO
 
 Revision:
-- Revise the `--all' feature to better reflect GNU man.
+- Revise the `--all' feature to better reflect GNU `man'.
 - The debug function stack is buggy (no effect on normal operation).
 - Check main_parse_MANOPT(), not too important.
 - Add long option shortcuts.
-- The actual replacement `dash' of the POSIX `ash' shell produces
-  strange errors with the groffer script, while the former `ash'
-  worked successfully.  Are these errors just bugs of `dash'?
 
 Optimization:
-- Optimize man path determination in manpath_add_lang_sys() for speed
-  by building-up the man path only by and by as far as necessary
+- Optimize `man' path determination in manpath_add_lang_sys() for speed
+  by building-up the `man' path only by and by as far as necessary
   (not trivial).
-- To increase the running speed write part of the groffer shell script
-  in C/C++.
-- Split the groffer.sh shell script into several files for better tests
-  of the shell compatibility.
+- To increase the running speed write part of the `groffer' shell
+  script in C/C++.
+- Split the `groffer.sh' shell script into several files for better
+  tests of the shell compatibility.
 
 Features of external programs:
 - Revise option handling of `grog'.
-- `gxditview' needs a complete shower.
 
 Documentation:
 - Improve the documentation of the search algorithm for man pages in
-  both the groffer script and the man page `groffer.man'.
+  both the `groffer' script and the man page `groffer.man'.
 - In `groff.man', add more documentation for parts that were taken over
   from GNU `man'.
 - The documentation in the headers for some function definitions in
@@ -38,7 +34,9 @@
 
 ####### License
 
-Copyright (C) 2003,2004 Free Software Foundation, Inc.
+Last update: 30 June 2005
+
+Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
 Written by Bernd Warken
 
 This file is part of groffer, which is part of groff.
@@ -57,3 +55,10 @@
 along with groff; see the files COPYING and LICENSE in the top
 directory of the groff source.  If not, write to the Free Software
 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: groff/contrib/groffer/groffer.man
diff -u groff/contrib/groffer/groffer.man:1.24 groff/contrib/groffer/groffer.man:1.25
--- groff/contrib/groffer/groffer.man:1.24	Mon Jun 20 19:27:41 2005
+++ groff/contrib/groffer/groffer.man	Sat Jul  2 17:37:54 2005
@@ -15,12 +15,12 @@
 Source file position:  <groff_source_top>/contrib/groffer/groffer.man
 Installed position:    $prefix/share/man/man1/groffer.1
 
-Last update : 21 May 2005
+Last update : 29 June 2005
 
 Source file position: <groff-source>/contrib/groffer/groffer.man
 ..
 .de author
-This file was written by Bernd Warken.
+This file was written by \m[blue]Bernd Warken\m[].
 ..
 .de copyleft
 Copyright (C) 2001,2002,2004,2005 Free Software Foundation, Inc.
@@ -669,7 +669,7 @@
 .\" --------------------------------------------------------------------
 .
 The
-.I \%groffer
+.B \%groffer
 program is the easiest way to use
 .BR \%groff (@MAN1EXT@).
 It can display arbitrary documents written in the
@@ -681,7 +681,7 @@
 language.
 .
 The
-.I \%groffer
+.B \%groffer
 program also includes many of the features for finding and displaying
 the \%UNIX manual pages
 .nh
@@ -718,20 +718,24 @@
 .
 This includes the
 .I \%groff
-native X viewer
+native X\~\%viewer
 .BR \%gxditview (@MAN1EXT@),
 each Postcript or
 .I \%dvi
 display program, a web browser by generating
 .I \%html
-in www-mode, or several text modes in text terminals.
+in
+.IR \%www\~mode ,
+or several
+.I \%text\~modes
+in text terminals.
 .
 .
 .P
 Most of the options that must be named when running
-.I \%groff
+.B \%groff
 directly are determined automatically for
-.IR \%groffer ,
+.BR \%groffer ,
 due to the internal usage of the
 .BR \%grog (@MAN1EXT@)
 program.
@@ -811,13 +815,13 @@
 .Opt_[alt] - Z -- intermediate\-output -- ditroff
 .P
 All further
-.I \%groff
+.B \%groff
 short options are accepted.
 .RE
 .
 .
 .TP
-.I X Window toolkit options
+.I X\~\%Window\~\%Toolkit options
 .RS
 .P
 .Opt_[alt] -- bd pixels
@@ -830,7 +834,7 @@
 .Opt_[alt] -- resolution value
 .Opt_[alt] -- rv
 .Opt_[alt] -- title string
-.Opt_[alt] -- xrm X_resource
+.Opt_[alt] -- xrm X-resource
 .RE
 .
 .
@@ -852,7 +856,7 @@
 .Opt_[alt] -- whatis
 .P
 Further long options of GNU
-.I man
+.B man
 are accepted as well.
 .RE
 .
@@ -934,7 +938,7 @@
 .\" --------------------------------------------------------------------
 .
 The
-.I \%groffer
+.B \%groffer
 program can usually be run with very few options.
 .
 But for special purposes, it supports many options.
@@ -944,12 +948,12 @@
 .
 .P
 All short options of
-.I \%groffer
+.B \%groffer
 are compatible with the short options of
 .BR \%groff (@MAN1EXT@).
 .
 All long options of
-.I \%groffer
+.B \%groffer
 are compatible with the long options of
 .BR \%man (1).
 .
@@ -960,7 +964,7 @@
 .
 As soon as one of these options is found on the command line it is
 executed, printed to standard output, and the running
-.I \%groffer
+.B \%groffer
 is terminated thereafter.
 .
 All other arguments are ignored.
@@ -1023,7 +1027,7 @@
 options.
 .
 If none of these mode and viewer options is specified
-.I \%groffer
+.B \%groffer
 tries to find a suitable display mode automatically.
 .
 .
@@ -1043,7 +1047,7 @@
 .
 .Opt_def -- default\-modes mode1,mode2,\*[Ellipsis]
 Set the sequence of modes for
-.I \%auto mode
+.I \%auto\~mode
 to the comma separated list given in the argument.
 .
 See
@@ -1064,7 +1068,8 @@
 .
 .
 .Opt_def -- dvi\-viewer prog
-Set the viewer program for dvi mode.
+Set the viewer program for
+.IR \%dvi\~mode .
 .
 This can be a file name or a program to be searched in
 .Env_var $PATH .
@@ -1091,8 +1096,7 @@
 .
 .Opt_def -- html\-viewer
 Set the web browser program for viewing in
-.I \%html
-mode.
+.I \%html\~mode .
 .
 Each program that accepts html input and allows the
 .BI \%file://localhost/ dir / file
@@ -1119,8 +1123,9 @@
 .Opt_long default\-modes
 option.
 .
-Useful for restoring the default mode when a different mode was
-specified before.
+Useful for restoring the
+.I \%default\~mode
+when a different mode was specified before.
 .
 .
 .TP
@@ -1138,7 +1143,7 @@
 .TP
 .Header_CB groff
 After the file determination, switch
-.I \%groffer
+.B \%groffer
 to process the input like
 .BR \%groff (@MAN1EXT@)
 would do.
@@ -1169,8 +1174,10 @@
 (Portable Document Format) viewer
 program.
 .
-By default, the input is formatted by groff using the Postscript
-device, then it is transformed into the PDF file format using
+By default, the input is formatted by
+.B \%groff
+using the Postscript device, then it is transformed into the PDF file
+format using
 .BR \%gs (1),
 and finally displayed either with the
 .BR \%xpdf (1)
@@ -1182,7 +1189,8 @@
 is searchable as well.
 .
 But as the transformation takes a considerable amount of time, this
-mode is not suitable as a default device for the auto mode.
+mode is not suitable as a default device for the
+.I \%auto\~mode .
 .
 .
 .TP
@@ -1197,9 +1205,9 @@
 .TP
 .Header_CB text
 Format in a
-.I \%groff
-text mode and write the result to standard output without a pager or
-viewer program.
+.I \%groff\~text\~mode
+and write the result to standard output without a pager or viewer
+program.
 .
 The text device,
 .I \%latin1
@@ -1210,9 +1218,9 @@
 .TP
 .Header_CB tty
 Format in a
-.I \%groff
-text mode and write the result to standard output using a text pager
-program, even when in X\~\%Window.
+.I \%groff\~text\~mode
+and write the result to standard output using a text pager program,
+even when in X\~\%Window.
 .
 .
 .TP
@@ -1223,13 +1231,25 @@
 .
 .TP
 .Header_CB X
-Display formatted input in a native roff viewer.
+Display the formatted input in a native
+.I roff
+viewer.
 .
 By default, the formatted input is displayed with the
 .BR \%gxditview (@MAN1EXT@)
-program, being distributed together with groff, or with
-.BR \%xditview (1),
-which is distributed as a standard X tool.
+program being distributed together with
+.BR \%groff .
+But the standard X\~tool
+.BR \%xditview (1)
+can also be chosen with the option
+Opt_long x\-viewer .
+This mode chooses the
+.I groff
+device
+.BR X75\-12 ,
+generates the corresponding
+.IR "groff intermediate output" ,
+and displays the result.
 .
 .
 .TP
@@ -1275,10 +1295,9 @@
 .Opt_long_arg mode pdf .
 .
 .
-.Opt_def -- pdf-viewer prog
+.Opt_def -- pdf\-viewer prog
 Set the viewer program for
-.I \%pdf
-mode.
+.IR \%pdf\~mode .
 .
 This can be a file name or a program to be searched in
 .Env_var $PATH .
@@ -1291,10 +1310,9 @@
 .Opt_long_arg mode ps .
 .
 .
-.Opt_def -- ps-viewer prog
+.Opt_def -- ps\-viewer prog
 Set the viewer program for
-.I \%ps
-mode.
+.IR \%ps\~mode .
 .
 This can be a file name or a program to be searched in
 .Env_var $PATH .
@@ -1334,19 +1352,18 @@
 .Opt_long html\-viewer .
 .
 .
-.Opt_def - X -- X -- x
+.Opt_def -- X -- x
 Equivalent to
 .Opt_long_arg mode X .
 .
 .
 .Opt_def -- X\-viewer -- x\-viewer prog
 Set the viewer program for
-.I x
-mode.
+.IR \%X\~mode .
 .
 Suitable viewer programs are
 .BR \%gxditview (@MAN1EXT@)
-and
+which is the default and
 .BR \%xditview (1).
 .
 But the argument can be any executable file or a program in
@@ -1365,17 +1382,20 @@
 .
 .P
 Besides these,
-.I \%groffer
+.B \%groffer
 accepts all arguments that are valid for the
 .BR \%groff (@MAN1EXT@)
 program.
 .
-All non-groffer options are sent unmodified via
-.I \%grog
+All
+.RB \%non- groffer
+options are sent unmodified via
+.B \%grog
 to
-.IR \%groff .
+.BR \%groff .
 .
-Postprocessors, macro packages, compatibility with classical
+Postprocessors, macro packages, compatibility with
+.I classical
 .IR \%troff ,
 and much more can be manually specified.
 .
@@ -1391,7 +1411,9 @@
 .
 .
 .Opt_def -- shell "shell_program"
-Specify the shell under which the groffer script should be run.
+Specify the shell under which the
+.B \%groffer
+script should be run.
 .
 The script first tests whether this option is set (either by
 configuration, within
@@ -1410,7 +1432,7 @@
 .
 .P
 Other useful debugging options are the
-.I \%groff
+.B \%groff
 options
 .Opt_short V
 and
@@ -1424,39 +1446,40 @@
 .\" --------------------------------------------------------------------
 .
 All short options of
-.I \%groffer
+.B \%groffer
 are compatible with the short options of
 .BR \%groff (@MAN1EXT@).
 .
 The following of
-.I \%groff
+.B \%groff
 options have either an additional special meaning within
-.I \%groffer
+.B \%groffer
 or make sense for normal usage.
 .
 .
 .P
 Because of the special outputting behavior of the
-.I \%groff
+.B \%groff
 options
 .Opt_short V
 and
 .Opt_short Z
-.I \%groffer
+.B \%groffer
 was designed to be switched into
-.I \%groff
-mode by these; the
+.I \%groff\~mode
+by these; the
 .I \%groffer
 viewing features are disabled there.
 .
 The other
-.I \%groff
+.B \%groff
 options do not switch the mode, but allow to customize the formatting
 process.
 .
 .
 .Opt_def - a
-This generates an ascii approximation of output in text modes.
+This generates an ascii approximation of output in
+.IR \%text\~modes .
 .
 That could be important when the text pager has problems with control
 sequences.
@@ -1476,14 +1499,14 @@
 Send the argument
 .I \%opt_or_arg
 as an option or option argument to the actual
-.I \%groff
+.B \%groff
 postprocessor.
 .
 .
 .Opt_def - T -- device devname
 .
 This option determines
-.IR \%groff 's
+.BR \%groff 's
 output device.
 .
 The most important devices are the text output devices for referring
@@ -1494,15 +1517,18 @@
 and others.
 .
 Each of these arguments switches
-.I \%groffer
-into a text mode using this device, to
-.I mode \%tty
-if the actual mode is not a text mode.
+.B \%groffer
+into a
+.I \%text\~mode
+using this device, to
+.I \%mode\~tty
+if the actual mode is not a
+.IR \%text\~mode .
 .
 The following
 .I \%devname
 arguments are mapped to the corresponding
-.I \%groffer
+.B \%groffer
 .Opt_long_arg mode \fIdevname\fR
 option:
 .BR \%dvi ,
@@ -1511,42 +1537,50 @@
 .BR \%ps .
 All
 .B \%X*
-arguments are mapped to mode
-.BR \%X .
+arguments are mapped to
+.IR \%mode\~X .
 Each other
 .I \%devname
 argument switches to
-.I mode \%groff
+.I \%mode\~groff
 using this device.
 .
 .
 .Opt_def - V
 Switch into
-.I \%groff
-mode and show only the
+.I \%groff\~mode
+and show only the
 .I \%groff
 calling pipe without formatting the input.
 .
-This an advanced option from
+This is an advanced option from
 .BR \%groff (@MAN1EXT@) ,
 only useful for debugging.
 .
 .
 .Opt_def - X
-was made equivalent to
-.Opt_long_arg mode x ;
-this slightly enhances the facility of
-.IR \%groff 's
-option.
+is equivalent to
+.BR "groff \-X" .
+It displays the
+.I groff intermediate output
+with
+.BR gxditview .
+As the quality is relatively bad this option is deprecated; use
+.Opt_long X
+instead because the
+.I X mode
+uses an
+.IR X *
+device for a better display.
 .
 .
 .Opt_def - Z -- intermediate-output -- ditroff
 Switch into
-.I \%groff
-mode and format the input with
-.I \%groff
-intermediate output without postprocessing; see
-.BR \%groff_out (@MAN1EXT@).
+.I \%groff\~mode
+and format the input with the
+.I \%groff intermediate output
+without postprocessing; see
+.BR \%groff_out (@MAN5EXT@).
 This is equivalent to option
 .Opt_long ditroff
 of
@@ -1556,36 +1590,36 @@
 .
 .P
 All other
-.I \%groff
+.B \%groff
 options are supported by
-.IR \%groffer ,
+.BR \%groffer ,
 but they are just transparently transferred to
-.I \%groff
+.B \%groff
 without any intervention.
 .
 The options that are not explicitly handled by
-.I \%groffer
+.B \%groffer
 are transparently passed to
-.IR \%groff .
+.BR \%groff .
 .
 Therefore these transparent options are not documented here, but in
 .BR \%groff (@MAN1EXT@).
 Due to the automatism in
-.IR \%groffer ,
+.BR \%groffer ,
 none of these
-.I \%groff
+.B \%groff
 options should be needed, except for advanced usage.
 .
 .
 .\" --------------------------------------------------------------------
-.SS "X Window toolkit Options"
+.SS "X\~\%Window\~\%Toolkit Options"
 .\" --------------------------------------------------------------------
 .
-The following long options were adapted from the corresponding X
-Toolkit options.
+The following long options were adapted from the corresponding
+X\~\%Toolkit options.
 .
-.I \%groffer
-will pass them to the actual viewer program if it is an X Window
+.B \%groffer
+will pass them to the actual viewer program if it is an X\~\%Window
 program.
 .
 Otherwise these options are ignored.
@@ -1596,15 +1630,13 @@
 long options.
 .
 For
-.I \%groffer
+.B \%groffer
 that was changed to the standard with using a double minus for long
 options, for example,
-.I \%groffer
+.B \%groffer
 uses the option
 .Opt_long font
-for the
-.I X
-option
+for the X\~\%option
 .Opt_short font .
 .
 .
@@ -1612,7 +1644,7 @@
 See
 .BR \%X (1),
 .BR \%X (7),
-and the documentation on the X toolkit options for more details on
+and the documentation on the X\~\%Toolkit\~\%options for more details on
 these options and their arguments.
 .
 .
@@ -1635,7 +1667,7 @@
 .
 .
 .Opt_def -- display X-display
-Set the X display on which the viewer program shall be started, see the
+Set the X\~\%display on which the viewer program shall be started, see the
 .I X\~\%Window
 documentation for the syntax of the argument.
 .
@@ -1652,7 +1684,7 @@
 .Opt_def -- font font_name
 Set the font used by the viewer window.
 .
-The argument is an X font name.
+The argument is an X\~\%font\~\%name.
 .
 .
 .Opt_def -- ft font_name
@@ -1670,7 +1702,7 @@
 .
 .
 .Opt_def -- resolution value
-Set X resolution in dpi (dots per inch) in some viewer programs.
+Set X\~\%resolution in dpi (dots per inch) in some viewer programs.
 .
 The only supported dpi values are
 .B 75
@@ -1678,7 +1710,7 @@
 .BR 100 .
 .
 Actually, the default resolution for
-.I \%groffer
+.B \%groffer
 is set to
 .BR 75 .
 .
@@ -1692,7 +1724,7 @@
 .
 .
 .Opt_def -- xrm "'resource'"
-Set X resource.
+Set X\~\%resource.
 .
 .
 .\" --------------------------------------------------------------------
@@ -1700,22 +1732,22 @@
 .\" --------------------------------------------------------------------
 .
 The long options of
-.I \%groffer
-were synchronized with the long options of
-.IR GNU man .
+.B \%groffer
+were synchronized with the long options of GNU
+.BR man .
 .
-All long options of
-.I GNU man
+All long options of GNU
+.I man
 are recognized, but not all of these options are important to
-.IR \%groffer ,
+.BR \%groffer ,
 so most of them are just ignored.
 .
 .
 .P
 The following two options were added to
-.I \%groffer
+.B \%groffer
 for choosing whether the file name arguments are interpreted as names
-for local files or as a search pattern for man pages.
+for local files or as a search pattern for man\~pages.
 .
 The default is looking up for local files.
 .
@@ -1738,27 +1770,27 @@
 .
 .Opt_long local-file
 is the corresponding
-.I man
+.B man
 option.
 .
 .
 .P
 In the following, the
-.I man
+.B man
 options that have a special meaning for
-.I \%groffer
+.B \%groffer
 are documented.
 .
 .
 .P
-The full set of long and short options of the
-.I GNU man
+The full set of long and short options of the GNU
+.B man
 program can be passed via the environment variable
 .Env_var $MANOPT ;
 see
 .BR \%man (1)
-if your system has
-.I GNU man
+if your system has GNU
+.B man
 installed.
 .
 .
@@ -1768,12 +1800,19 @@
 .
 .
 .Opt_def - 7 -- ascii
-In text modes, display ASCII translation of special characters.
+In
+.IR \%text\~modes ,
+display ASCII translation of special characters for critical environment.
+.
+This is equivalent to
+.BR "groff -mtty_char" ;
+see
+.BR groff_tmac (@MAN5EXT@).
 .
 .
 .Opt_def -- ditroff
 Eqivalent to
-.I \%groffer
+.B \%groffer
 .Opt_short Z .
 .
 .
@@ -1790,7 +1829,7 @@
 .
 .Opt_def -- locale language
 .
-Set the language for man pages.
+Set the language for man\~pages.
 .
 This has the same effect, but overwrites
 .Env_var $LANG
@@ -1806,7 +1845,7 @@
 .Opt_long location .
 .
 This was added by
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
@@ -1818,10 +1857,12 @@
 .
 .
 .Opt_def -- pager
-Set the pager program in tty mode; default is
-.IR \%less .
+Set the pager program in
+.IR \%tty\~mode ;
+default is
+.BR \%less .
 This is equivalent to
-.Opt_long tty-viewer .
+.Opt_long tty\-viewer .
 .
 .
 .Opt_def -- sections "'sec1:sec2:\*[Ellipsis]'"
@@ -1831,7 +1872,7 @@
 .
 .
 .Opt_def -- systems "'sys1,sys2,\*[Ellipsis]'"
-Search for man pages for the given operating systems; the argument
+Search for man\~pages for the given operating systems; the argument
 .I \%systems
 is a comma-separated list.
 .
@@ -1848,7 +1889,7 @@
 .
 .P
 Additionally, the following short option of
-.I \%man
+.B \%man
 is supported as well.
 .
 .
@@ -1863,12 +1904,12 @@
 .
 These input sources are collected and composed into a single output
 file such as
-.I \%groff
+.B \%groff
 does.
 .
 .
 .P
-The strange POSIX behavior that maps all arguments behind the first
+The strange \%POSIX behavior that maps all arguments behind the first
 non-option argument into
 .I \%filespec
 arguments is ignored.
@@ -1894,7 +1935,7 @@
 No
 .I \%filespec
 parameters means that
-.I \%groffer
+.B \%groffer
 waits for standard input.
 .
 The minus option
@@ -1909,7 +1950,7 @@
 .
 .
 .P
-On each system, the man pages are sorted according to their content
+On each system, the man\~pages are sorted according to their content
 into several sections.
 .
 The
@@ -1930,15 +1971,15 @@
 .
 .P
 The internal precedence of
-.I \%man
-for searching man pages with the same name within several sections
+.B \%man
+for searching man\~pages with the same name within several sections
 goes according to the classical single-character sequence.
 .
 On some systems, this single character can be extended by a following
 string.
 .
 But the special
-.I \%groffer
+.B \%groffer
 man\~page facility is based on the classical single character sections.
 .
 .
@@ -1978,8 +2019,7 @@
 Otherwise search for a man\~page named
 .IR \%name.s
 in the lowest
-.I man\~\c
-.IR section .
+.B man\~section .
 .
 .
 .P
@@ -1994,7 +2034,7 @@
 The pattern
 .I \%s\~name
 originates from a strange argument parsing of the
-.I man
+.B man
 program.
 .
 If
@@ -2028,7 +2068,7 @@
 Several file name arguments can be supplied.
 .
 They are mixed by
-.I \%groff
+.B \%groff
 into a single document.
 .
 Note that the set of option arguments must fit to all of these file
@@ -2044,19 +2084,19 @@
 .\" --------------------------------------------------------------------
 .
 By default, the
-.I \%groffer
+.B \%groffer
 program collects all input into a single file, formats it with the
-.I \%groff
+.B \%groff
 program for a certain device, and then chooses a suitable viewer
 program.
 .
 The device and viewer process in
-.I \%groffer
+.B \%groffer
 is called a
 .IR \%mode .
 .
 The mode and viewer of a running
-.I \%groffer
+.B \%groffer
 program is selected automatically, but the user can also choose it
 with options.
 .
@@ -2068,31 +2108,32 @@
 .Opt_long \fIanymode .
 Most of these modes have a viewer program, which can be chosen by an
 option that is constructed like
-.Opt_long \fIanymode\fR-viewer .
+.Opt_long \fIanymode\fR\-viewer .
 .
 .
 .P
-Several different modes are offered, graphical X modes, text modes,
+Several different modes are offered, graphical
+.IR \%X\~modes ,
+.IR \%text\~modes ,
 and some direct
-.I \%groff
-modes for debugging and development.
+.I \%groff\~modes
+for debugging and development.
 .
 .
 .P
 By default,
-.I \%groffer
+.B \%groffer
 first tries whether
-.B x
-mode is possible, then
-.B \%ps
-mode, and finally
-.B \%tty
-mode.
+.I \%x\~mode
+is possible, then
+.IR \%ps\~mode ,
+and finally
+.IR \%tty\~mode .
 .
 This mode testing sequence for
-.B \%auto
-mode can be changed by specifying a comma separated list of modes
-with the option
+.I \%auto\~mode
+can be changed by specifying a comma separated list of modes with the
+option
 .Opt_long default\-modes.
 .
 .
@@ -2106,57 +2147,56 @@
 .\" --------------------------------------------------------------------
 .
 The graphical display modes work only in the
-.I X\~Window environment
+.I X\~\%Window environment
 (or similar implementations within other windowing environments).
 .
 The environment variable
 .Env_var $DISPLAY
 and the option
 .Opt_long display
-are used for specifying the X display to be used.
+are used for specifying the X\~\%display to be used.
 .
 If neither is given,
-.I \%groffer
-assumes that no X and changes to one text mode.
+.B \%groffer
+assumes that no X and changes to one
+.IR \%text\~mode .
 .
 You can change this automatic behavior by the option
 .Opt_long default\-modes .
 .
 .
 .P
-Known viewers for the graphical display modes and their standard X
-Window viewer progams are
+Known viewers for the graphical display modes and their standard
+X\~\%Window viewer progams are
 .
 .Topic
-X Window roff viewers such as
+X\~\%Window
+.I roff
+viewers such as
 .BR \%gxditview (@MAN1EXT@)
 or
 .BR \%xditview (1)
 (in
 .I x
 or
-.I X
-mode),
+.IR \%X\~mode ),
 .
 .Topic
 in a Postscript viewer
 .nh
-.RI ( ps
-mode),
+.RI ( \%ps\~mode ),
 .hy
 .
 .Topic
 in a dvi viewer program
 .nh
-.RI ( dvi
-mode),
+.RI ( \%dvi\~mode ),
 .hy
 .
 .Topic
 in a PDF viewer
 .nh
-.RI ( pdf
-mode),
+.RI ( \%pdf\~mode ),
 .hy
 .
 .Topic
@@ -2164,17 +2204,16 @@
 .nh
 .RI ( html
 or
-.I www
-mode),
+.IR \%www\~mode ),
 .hy
 .RE
 .
 .
 .P
 The
-.I \%pdf
-mode has a major advantage \[em] it is the only graphical diplay mode
-that allows to search for text within the viewer; this can be a really
+.I \%pdf\~mode
+has a major advantage \[em] it is the only graphical diplay mode that
+allows to search for text within the viewer; this can be a really
 important feature.
 .
 Unfortunately, it takes some time to transform the input into the PDF
@@ -2182,40 +2221,43 @@
 .
 .
 .P
-These graphical viewers can be customized by options of the X Window
-Toolkit.
+These graphical viewers can be customized by options of the
+X\~\%Window\~\%Toolkit.
 .
 But the
-.I \%groffer
+.B \%groffer
 options use a leading double minus instead of the single minus used by
 the
-.I X\~Window\~\c
-.IR Toolkit .
+.I X\~\%Window\~\%Toolkit .
 .
 .
 .\" --------------------------------------------------------------------
 .SS "Text mode"
 .\" --------------------------------------------------------------------
 .
-There are to modes for text output, mode
-.I \%text
-for plain output without a pager and mode
-.I \%tty
+There are two modes for text output,
+.I \%mode\~text
+for plain output without a pager and
+.I \%mode\~tty
 for a text output on a text terminal using some pager program.
 .
 .
 .P
 If the variable
-.Env_var $DISPLAY
-is not set or empty, groffer assumes that it should use
-.I \%tty
-mode.
+.Env_var \%$DISPLAY
+is not set or empty,
+.B \%groffer
+assumes that it should use
+.IR \%tty\~\%mode .
 .
 .
 .P
-In the actual implementation, the groff output device
+In the actual implementation, the
+.I groff
+output device
 .I \%latin1
-is chosen for text modes.
+is chosen for
+.IR \%text\~modes .
 .
 This can be changed by specifying option
 .Opt_short T
@@ -2227,7 +2269,7 @@
 The pager to be used can be specified by one of the options
 .Opt_long pager
 and
-.Opt_long tty-viewer ,
+.Opt_long tty\-viewer ,
 or by the environment variable
 .Env_var $PAGER .
 If all of this is not used the
@@ -2247,7 +2289,7 @@
 file determination and decompression.
 .
 This is combined into a single input file that is fed directly into
-.I \%groff
+.B \%groff
 with different strategy without the
 .I \%groffer
 viewing facilities.
@@ -2258,15 +2300,21 @@
 .
 .P
 The
-.I \%source
-mode with just displays the generated input.
+.I \%source\~mode
+with option
+.Opt_short Q
+and
+.Opt_long source
+just displays the decompressed input.
+.
 .
+.P
 The
-.I \%groff
-mode passes the input to
-.I \%groff
+.I \%groff\~mode
+passes the input to
+.B \%groff
 using only some suitable options provided to
-.IR \%groffer .
+.BR \%groffer .
 .
 This enables the user to save the generated output into a file or pipe
 it into another program.
@@ -2274,8 +2322,8 @@
 .
 .P
 In
-.I \%groff
-mode, the option
+.IR \%groff\~\%mode ,
+the option
 .Opt_short Z
 disables post-processing, thus producing the
 .nh
@@ -2290,18 +2338,20 @@
 .
 .P
 All
-.I \%groff
+.B \%groff
 short options are supported by
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .\" --------------------------------------------------------------------
 .SH "MAN\~PAGE\~SEARCHING"
 .\" --------------------------------------------------------------------
 .
-The default behavior of groffer is to first test whether a file
-parameter represents a local file; if it is not an existing file name,
-it is assumed to represent a name of a man\~page.
+The default behavior of
+.B \%groffer
+is to first test whether a file parameter represents a local file; if
+it is not an existing file name, it is assumed to represent a name of
+a man\~page.
 .
 This behavior can be modified by the following options.
 .
@@ -2325,7 +2375,9 @@
 .
 .
 .P
-The groffer program provides a search facility for man\~pages.
+The
+.B \%groffer
+program provides a search facility for man\~pages.
 .
 All long options, all environment variables, and most of the
 functionality of the GNU
@@ -2334,7 +2386,7 @@
 .
 This inludes the extended file names of man\~pages, for example,
 the man\~page of
-.I \%groff
+.B \%groff
 in man\~section 7 may be stored under
 .File_name /usr/share/man/man7/groff.7.gz ,
 where
@@ -2352,7 +2404,11 @@
 The
 .I cat\~pages
 (preformatted man\~pages) are intentionally excluded from the search
-because groffer is a roff program that wants to format by its own.
+because
+.B \%groffer
+is a
+.I roff
+program that wants to format by its own.
 .
 With the excellent performance of the actual computers, the
 preformatted man\~pages aren't necessary any longer.
@@ -2412,8 +2468,9 @@
 .
 .
 .P
-The locale (language) is determined like in GNU man, that is from
-highest to lowest precedence:
+The locale (language) is determined like in GNU
+.BR man ,
+that is from highest to lowest precedence:
 .Topic
 .Opt_long locale
 .
@@ -2434,7 +2491,7 @@
 .
 .
 .P
-The language locale is usually specified in the POSIX 1003.1 based
+The language locale is usually specified in the \%POSIX 1003.1 based
 format:
 .P
 .nh
@@ -2461,7 +2518,7 @@
 is used instead.
 .
 As usual, this default can be specified by one of \f[CR]C\f[] or
-\f[CR]POSIX\f[].
+\f[CR]\%POSIX\f[].
 .
 The man\~pages in the default language are usually in English.
 .
@@ -2553,8 +2610,10 @@
 .SH "ENVIRONMENT"
 .\" --------------------------------------------------------------------
 .
-The groffer programs supports many system variables, most of them by
-courtesy of other programs.
+The
+.B \%groffer
+program supports many system variables, most of them by courtesy of
+other programs.
 .
 All environment variables of
 .BR \%groff (@MAN1EXT@)
@@ -2569,7 +2628,8 @@
 .
 .TP
 .Env_var $GROFFER_OPT
-Store options for a run of groffer.
+Store options for a run of
+.BR \%groffer .
 .
 The options specified in this variable are overridden by the options
 given on the command line.
@@ -2583,28 +2643,34 @@
 .SS "System Variables"
 .\" --------------------------------------------------------------------
 .
-The groffer program is a shell script that is run through
+The
+.B \%groffer
+program is a shell script that is run through
 .File_name /bin/sh ,
 which can be internally linked to programs like
 .BR \%bash (1).
 The corresponding system environment is automatically effective.
 .
-The following variables have a special meaning for groffer.
+The following variables have a special meaning for
+.BR \%groffer .
 .
 .
 .TP
 .Env_var $DISPLAY
-If this variable is set this indicates that the X Window system is
+If this variable is set this indicates that the X\~\%Window system is
 running.
 .
 Testing this variable decides on whether graphical or text output is
 generated.
 .
 This variable should not be changed by the user carelessly, but it can
-be used to start the graphical groffer on a remote X terminal.
+be used to start the graphical
+.B \%groffer
+on a remote X\~\%terminal.
 .
-For example, depending on your system, groffer can be started on the
-second monitor by the command
+For example, depending on your system,
+.B \%groffer
+can be started on the second monitor by the command
 .Shell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
 .
 .
@@ -2661,21 +2727,24 @@
 .
 .TP
 .Env_var $PATH
-All programs within the groffer shell script are called without a
-fixed path.
+All programs within the
+.B \%groffer
+shell script are called without a fixed path.
 .
 Thus this environment variable determines the set of programs used
-within the run of groffer.
+within the run of
+.BR \%groffer .
 .
 .
 .TP
 .Env_var $POSIXLY_CORRECT
-If set to a non-empty value this chooses the POSIX mode.
+If set to a non-empty value this chooses the \%POSIX mode of the shell.
 .
-This is done internally by some shells.
+This is done internally by some shells, such as
+.IR bash .
 .
-.I \%groffer
-ignores the bad POSIX behavior for option processing, that means that
+.B \%groffer
+ignores the bad \%POSIX behavior for option processing, that means that
 option processing will be finished as soon as a non-option argument is
 found.
 .
@@ -2690,17 +2759,24 @@
 .SS "Groff Variables"
 .\" --------------------------------------------------------------------
 .
-The groffer program internally calls groff, so all environment
-variables documented in
+The
+.B \%groffer
+program internally calls
+.BR \%groff ,
+so all environment variables documented in
 .BR \%groff (@MAN1EXT@)
-are internally used within groffer as well.
+are internally used within
+.B \%groffer
+as well.
 .
-The following variables have a direct meaning for the groffer program.
+The following variables have a direct meaning for the
+.B \%groffer
+program.
 .
 .TP
 .Env_var $GROFF_TMPDIR
 If the value of this variable is an existing, writable directory,
-.I \%groffer
+.B \%groffer
 uses it for storing its temporary files, just as groff does.
 .
 .
@@ -2709,13 +2785,18 @@
 .\" --------------------------------------------------------------------
 .
 Parts of the functionality of the man\~program were implemented in
-groffer; support for all environment variables documented in
+.BR \%groffer ;
+support for all environment variables documented in
 .BR \%man (1)
-was added to groffer, but the meaning was slightly modified due to the
-different approach in groffer; but the user interface is the same.
+was added to
+.BR \%groffer ,
+but the meaning was slightly modified due to the different approach in
+.BR \%groffer ;
+but the user interface is the same.
 .
-The man environment variables can be overwritten by options provided
-with
+The
+.B man
+environment variables can be overwritten by options provided with
 .Env_var $MANOPT ,
 which in turn is overwritten by the command line.
 .
@@ -2733,8 +2814,9 @@
 .Env_var $MANOPT
 This variable contains options as a preset for
 .BR \%man (1).
-As not all of these are relevant for groffer only the essential parts
-of its value are extracted.
+As not all of these are relevant for
+.B \%groffer
+only the essential parts of its value are extracted.
 .
 The options specified in this variable overwrite the values of the
 other environment variables taht are specific to man.
@@ -2774,8 +2856,9 @@
 .P
 The environment variable
 .Env_var $MANROFFSEQ
-is ignored by groffer because the necessary preprocessors are
-determined automatically.
+is ignored by
+.B \%groffer
+because the necessary preprocessors are determined automatically.
 .
 .
 .\" --------------------------------------------------------------------
@@ -2783,7 +2866,7 @@
 .\" --------------------------------------------------------------------
 .
 The
-.I \%groffer
+.B \%groffer
 program can be preconfigured by two configuration files.
 .
 This configuration can be overridden at each program start by command
@@ -2793,12 +2876,15 @@
 .
 .TP
 .File_name /etc/groff/groffer.conf
-System-wide configuration file for groffer.
+System-wide configuration file for
+.BR \%groffer .
 .
 .
 .TP
 .File_name $HOME/.groff/groffer.conf
-User-specific configuration file for groffer, where
+User-specific configuration file for
+.BR \%groffer ,
+where
 .Env_var $HOME
 denotes the user's home directory.
 .
@@ -2815,9 +2901,9 @@
 of $GROFFER_OPT.
 .
 This easily allows to set general
-.I \%groffer
+.B \%groffer
 options that are used with any call of
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .P
@@ -2828,7 +2914,7 @@
 .IR filename '
 .hy
 shell syntax within
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .P
@@ -2840,7 +2926,7 @@
 .Opt_long shell .
 The reason is that its argument must be retrieved at a very early
 stage of
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .P
@@ -2853,7 +2939,7 @@
 .
 .Topic
 Preset environment variables recognized by
-.IR \%groffer .
+.BR \%groffer .
 .
 .Topic
 Write a function for calling a viewer program for a special
@@ -2865,7 +2951,8 @@
 Note that the name of such a function must coincide with some existing
 program in the system path
 .Env_var $PATH
-in order to be recognized by groffer.
+in order to be recognized by
+.BR groffer .
 .
 .
 .P
@@ -2880,10 +2967,10 @@
 # groffer configuration file
 #
 # groffer options that are used in each call of groffer
---shell=/bin/bash
---resolution=100
---foreground=DarkBlue
---x-viewer='gxditview -geometry 850x800'
+\-\-shell=/bin/bash
+\-\-resolution=100
+\-\-foreground=DarkBlue
+\-\-x\-viewer='gxditview \-geometry 850x800'
 #
 # some shell commands
 if test "$DISPLAY" = ""; then
@@ -2897,8 +2984,8 @@
 .
 .P
 This configuration sets four
-.I \%groffer
-options (the lines starting with `-') and runs two shell commands (the
+.B \%groffer
+options (the lines starting with `\-') and runs two shell commands (the
 rest of the script).
 .
 This has the following effects:
@@ -2908,7 +2995,7 @@
 Use
 .B /bin/bash
 as the shell to run the
-.I \%groffer
+.B \%groffer
 script.
 .
 .
@@ -2927,8 +3014,9 @@
 .Topic
 Force
 .BR \%gxditview (@MAN1EXT@)
-as the X-mode viewer using the geometry option for setting the width
-to
+as the
+.I \%X-mode
+viewer using the geometry option for setting the width to
 .B 850\~dpi
 and the height to
 .B 800\~\c
@@ -2942,14 +3030,14 @@
 .IR localhost:0.0 .
 .
 That allows to start
-.I \%groffer
-in the standard X\~display, even when the program is called from a text
-console.
+.B \%groffer
+in the standard X\~\%display, even when the program is called from a
+text console.
 .
 .
 .Topic
 Just for fun, the date of each
-.I \%groffer
+.B \%groffer
 start is written to the file
 .File_name mygroffer.log
 in the home directory.
@@ -2960,13 +3048,14 @@
 .\" --------------------------------------------------------------------
 .
 The usage of
-.I \%groffer
+.B \%groffer
 is very easy.
 .
 Usually, it is just called with a file name or man\~page.
 .
-The following examples, however, show that groffer has much more fancy
-capabilities.
+The following examples, however, show that
+.B \%groffer
+has much more fancy capabilities.
 .
 .
 .TP
@@ -2976,8 +3065,8 @@
 in the directory
 .File_name /usr/local/share/doc/groff ,
 using
-.I \%gxditview
-as graphical viewer when in X Window, or the
+.B \%gxditview
+as graphical viewer when in X\~\%Window, or the
 .BR \%less (1)
 pager program when not in X.
 .
@@ -2985,18 +3074,18 @@
 .TP
 .Shell_cmd "groffer\~groff"
 If the file
-.I \%./groff
+.File_name \%./groff
 exists use it as input.
 .
 Otherwise interpret the argument as a search for the man\~page named
-.I \%groff
+.B \%groff
 in the smallest possible man\~section, being section 1 in this case.
 .
 .
 .TP
 .Shell_cmd "groffer\~man:groff"
 search for the man\~page of
-.I \%groff
+.B \%groff
 even when the file
 .File_name ./groff
 exists.
@@ -3007,7 +3096,7 @@
 .TP+
 .Shell_cmd "groffer\~7\~groff"
 search the man\~page of
-.I \%groff
+.B \%groff
 in man\~section
 .BR 7 .
 This section search works only for a digit or a single character from
@@ -3019,12 +3108,12 @@
 If the file
 .File_name ./fb.modes
 does not exist interpret this as a search for the man\~page of
-.IR fb.modes .
+.BR fb.modes .
 As the extension
 .I \%modes
 is not a single character in classical section style the argument is
 not split to a search for
-.IR fb .
+.BR fb .
 .
 .
 .TP
@@ -3032,12 +3121,12 @@
 .
 The arguments that are not existing files are looked-up as the
 following man\~pages:
-.I \%groff
+.B \%groff
 (automatic search, should be found in man\~section\~1),
-.I \%troff
+.B \%troff
 (in section\~1),
 and
-.I \%roff
+.B \%roff
 (in the section with the lowest number, being\~7 in this case).
 .
 The quotes around
@@ -3065,15 +3154,14 @@
 .I \%html
 format
 .nh
-.RI ( www
-mode)
+.RI ( \%www\~mode )
 .hy
 and view the result in the web browser
-.IR \%galeon .
+.BR \%galeon .
 The option
 .Opt_long man
 guarantees that the man\~page is retrieved, even when a local file
-.I \%ls
+.File_name \%ls
 exists in the actual directory.
 .
 .
@@ -3090,12 +3178,15 @@
 .Shell_cmd "cat\~file.gz\~|\~groffer\~-Z\~-mfoo"
 .
 Decompress the standard input, send this to
-.I \%groff
-intermediate mode without post-processing (groff option
+.I \%groff intermediate output mode
+without post-processing
+.RB ( groff
+option
 .Opt_short Z ),
 using macro package by
 .I \%foo
-(groff option
+.RB ( groff
+option
 .Opt_short m ) .
 .
 .
@@ -3114,38 +3205,38 @@
 .
 The
 .B \%groffer
-shell script is compatible with both GNU and POSIX.
+shell script is compatible with both GNU and \%POSIX.
 .
-POSIX compatibility refers to
+\%POSIX compatibility refers to
 .B IEEE P1003.2/D11.2
-of September 1991, a very early version of the POSIX standard that is
-still freely available in the internet at
+of September 1991, a very early version of the \%POSIX standard that
+is still freely available in the internet at
 .URL http://\:www.funet.fi/pub/doc/posix/p1003.2/d11.2/all \
-"POSIX P1003.2 draft 11.2" .
+"\%POSIX P1003.2 draft 11.2" .
 .
 Unfortunately, this version of the standard removed `local' for shell
-function variables, but later POSIX versions restored this again.
+function variables, but later \%POSIX versions restored this again.
 .
-As `local' is needed for serious programming this temporary POSIX
+As `local' is needed for serious programming this temporary \%POSIX
 deprecation was ignored.
 .
 .
 .P
-Most GNU shells are compatible with this interpretation of POSIX, but
-provide much more facilities.
+Most GNU shells are compatible with this interpretation of \%POSIX,
+but provide much more facilities.
 .
 Nevertheless this script uses only a restricted set of shell language
 elements and shell builtins.
 .
 The
-.I \%groffer
+.B \%groffer
 script should work on most actual free and commercial operating
 systems.
 .
 .
 .P
 The
-.I \%groffer
+.B \%groffer
 program provides its own parser for command line options; it can
 handle option arguments and file names containing white space and a
 large set of special characters.
@@ -3153,7 +3244,7 @@
 .
 .P
 The
-.I \%groffer
+.B \%groffer
 shell script was tested with the following common implementations of
 the GNU shells:
 .I \%POSIX
@@ -3174,7 +3265,7 @@
 This option can also be given to the environment variable
 .Env_var $GROFF_OPT .
 If you want to write it to one of the
-.I \%groffer
+.B \%groffer
 configuration files you must use the single option style, a line
 starting with
 .Opt_long shell .
@@ -3182,7 +3273,7 @@
 .
 .P
 The
-.I \%groffer
+.B \%groffer
 program provides its own parser for command line arguments that is
 compatible to both
 .I \%POSIX
@@ -3198,7 +3289,7 @@
 .Topic
 A single minus always refers to single character option or a
 combination thereof, for example, the
-.I \%groffer
+.B \%groffer
 short option combination
 .Opt_short Qmfoo
 is equivalent to
@@ -3236,10 +3327,10 @@
 .
 .P
 This behavior can be changed by setting the environment variable
-.Env_var $POSIXLY_CORRECT
+.Env_var \%$POSIXLY_CORRECT
 to a non-empty value.
 .
-Then the strange POSIX non-option behavior is adopted, i. e. option
+Then the strange \%POSIX non-option behavior is adopted, i. e. option
 processing is stopped as soon as the first non-option argument is
 found and each following argument is taken as a file name.
 .
@@ -3249,7 +3340,7 @@
 .Shell_cmd "groffer -- file1 -a -o arg file 2"
 As this leads to unwanted behavior in most cases, most people do not
 want to set
-.Env_var $POSIXLY_CORRECT .
+.Env_var \%$POSIXLY_CORRECT .
 .
 .
 .\" --------------------------------------------------------------------
@@ -3261,7 +3352,7 @@
 .
 Include a complete, self-contained example that will allow the bug to
 be reproduced, and say which version of
-.I \%groffer
+.B \%groffer
 you are using.
 .
 .
@@ -3288,10 +3379,11 @@
 .TP
 .BR \%groff (@MAN1EXT@)
 .TP+
-.BR \%troff (@MAN1EXT@)
+.BR \%@g@troff (@MAN1EXT@)
 Details on the options and environment variables available in
-.IR \%groff ;
-all of them can be used with groffer.
+.BR \%groff ;
+all of them can be used with
+.BR \%groffer .
 .
 .
 .TP
@@ -3304,9 +3396,9 @@
 .TP
 .BR \%grog (@MAN1EXT@)
 Internally,
-.I \%groffer
+.B \%groffer
 tries to guess the
-.I \%groff
+.B \%groff
 command line options from the input using this program.
 .
 .
@@ -3321,14 +3413,21 @@
 .
 .
 .TP
+.BR groff_tmac (@MAN5EXT@)
+Documentation on the
+.I \%groff
+macro files.
+.
+.
+.TP
 .BR \%man (1)
 The standard program to diplay man\~pages.
 .
-The information there is only useful if it is the man\~page for
-.IR "GNU\~man" .
+The information there is only useful if it is the man\~page for GNU
+.BR man .
 Then it documents the options and environment variables that are
 supported by
-.IR \%groffer .
+.BR \%groffer .
 .
 .
 .TP
@@ -3336,9 +3435,8 @@
 .TP+
 .BR \%xditview (1x)
 Viewers for
-.IR \%groffer 's
-.I x
-mode.
+.BR \%groffer 's
+.IR \%x\~mode .
 .
 .
 .TP
@@ -3353,8 +3451,7 @@
 .BR \%gs (1)
 Viewers for
 .IR \%groffer 's
-.I ps
-mode.
+.IR \%ps\~mode .
 .
 .
 .TP
@@ -3369,8 +3466,7 @@
 .BR \%kpdf (1)
 Viewers for
 .IR \%groffer 's
-.I \%pdf
-mode.
+.IR \%pdf\~mode .
 .
 .
 .TP
@@ -3380,9 +3476,8 @@
 .TP+
 .BR \%dvilx (1)
 Viewers for
-.IR \%groffer 's
-.I \%dvi
-mode.
+.BR \%groffer 's
+.IR \%dvi\~mode .
 .
 .
 .TP
@@ -3392,25 +3487,24 @@
 .TP+
 .BR \%lynx (1)
 Web-browsers for
-.IR \%groffer 's
+.BR \%groffer 's
 .I \%html
 or
-.I \%www
-mode.
+.IR \%www\~mode .
 .
 .
 .TP
 .BR \%less (1)
 Standard pager program for the
-.I \%tty
-.IR mode .
+.I \%tty\~mode .
 .
 .
 .TP
 .BR \%gzip (1)
 .TP+
 .BR \%bzip2 (1)
-The decompression programs supported by groffer.
+The decompression programs supported by
+.BR \%groffer .
 .
 .
 .\" --------------------------------------------------------------------
@@ -3425,7 +3519,7 @@
 .copyleft
 .
 .
-\" --------------------------------------------------------------------
+.\" --------------------------------------------------------------------
 .\" Emacs settings
 .\" --------------------------------------------------------------------
 .
Index: groff/contrib/groffer/groffer.sh
diff -u groff/contrib/groffer/groffer.sh:1.28 groff/contrib/groffer/groffer.sh:1.29
--- groff/contrib/groffer/groffer.sh:1.28	Fri Jun 24 19:52:39 2005
+++ groff/contrib/groffer/groffer.sh	Sat Jul  2 17:37:54 2005
@@ -4,7 +4,8 @@
 
 # Source file position: <groff-source>/contrib/groffer/groffer.sh
 
-# Copyright (C) 2001,2002,2003,2004,2005 Free Software Foundation, Inc.
+# Copyright (C) 2001,2002,2003,2004,2005 Free Software Foundation,
+# Inc.
 # Written by Bernd Warken
 
 # This file is part of groff version @VERSION@.
@@ -25,9 +26,10 @@
 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
 
 _PROGRAM_NAME='groffer';
-_PROGRAM_VERSION='0.9.17';
-_LAST_UPDATE='23 Jun 2005';
+_PROGRAM_VERSION='0.9.18';
+_LAST_UPDATE='1 July 2005';
 
+# This script is part of groff 1.19.2.
 
 ########################################################################
 # Determine the shell under which to run this script from the command
@@ -49,8 +51,8 @@
   export _GROFFER_SH;		# file name of this shell script
   export _OUTPUT_FILE_NAME;	# output generated, see main_set_res..()
 
-  export _CONFFILES;		# configuration files
-  _CONFFILES="/etc/groff/groffer.conf ${HOME}/.groff/groffer.conf";
+  export _CONF_FILES;		# configuration files
+  _CONF_FILES="/etc/groff/groffer.conf ${HOME}/.groff/groffer.conf";
 
   case "$0" in
   *${_PROGRAM_NAME}*)
@@ -72,6 +74,15 @@
   fi;
 
 
+  # test of `unset'
+  _foo=bar;
+  if unset _foo >${_NULL_DEV} 2>&1; then
+    unset='unset';
+  else
+    unset=':';
+  fi;
+
+
   ###########################
   # _get_opt_shell ("$@")
   #
@@ -88,7 +99,7 @@
           eval set x "${GROFFER_OPT}" '"$@"';
           shift;
           _gos_sh='';
-          for i;
+          while test $# != 0
           do
             case "$1" in
               --shell)
@@ -100,16 +111,21 @@
                 ;;
               --shell=?*)
                 # delete up to first `=' character
-                _gos_sh="$(echo -n "$1" | sed -e 's/^[^=]*=//')";
+                _gos_sh="$(echo x"$1" | sed -e '
+s/^x//
+s/^[^=]*=//
+')";
                 ;;
             esac;
             shift;
           done;
-          echo -n "${_gos_sh}";
+          cat <<EOF
+${_gos_sh}
+EOF
         )
         ;;
     esac;
-    unset _gos_sh;
+    eval ${unset} _gos_sh;
   }
 
 
@@ -125,30 +141,33 @@
       return 1;
     fi;
     # do not quote $1 to allow arguments
-    test _"$($1 -c 's=ok; echo -n "$s"' 2>${_NULL_DEV})"_ = _ok_;
+    test _"$(eval $1 -c 's=ok; echo "$s"' 2>${_NULL_DEV})"_ = _ok_;
   }
 
+
+  ###########################
   # do the shell determination from command line and $GROFFER_OPT
   _shell="$(_get_opt_shell "$@")";
-
   if test _"${_shell}"_ = __;
   then
     # none found, so look at the `--shell' lines in configuration files
     export f;
-    for f in ${_CONFFILES};
+    # for f in $_CONF_FILES
+    for f in $(eval set x ${_CONF_FILES}; shift; echo "$@")
     do
-      if test -f $f;
+      if test -f "$f";
       then
-        _all="$(cat $f | sed -n -e '/^--shell[= ] *\([^ ]*\)$/s//\1/p')"
-        for s in ${_all};
+        _all="$(cat "$f" | sed -n -e 's/^--shell[= ] *\([^ ]*\)$/\1/p')"
+        # for s in $_all
+        for s in $(eval set x ${_all}; shift; echo "$@")
         do
-          _shell=$s;
+          _shell="$s";
         done;
       fi;
     done;
-    unset f;
-    unset s;
-    unset _all;
+    eval ${unset} f;
+    eval ${unset} s;
+    eval ${unset} _all;
   fi;
 
   # restart the script with the last found $_shell, if it is a shell
@@ -161,7 +180,7 @@
   fi;
 
   _groffer_run='second';
-  unset _shell;
+  eval ${unset} _shell;
 
 fi; # end of first run
 
@@ -171,7 +190,7 @@
   exit 1
 fi;
 
-unset _groffer_run
+eval ${unset} _groffer_run
 
 
 ########################################################################
@@ -416,7 +435,8 @@
 export _FUNC_STACK;		# Store debugging information.
 export _REGISTERED_TITLE;	# Processed file names.
 # _HAS_* from availability tests
-export _HAS_COMPRESSION;	# `yes' if compression is available
+export _HAS_COMPRESSION;	# `yes' if gzip compression is available
+export _HAS_BZIP;		# `yes' if bzip2 compression is available
 # _MAN_* finally used configuration of man searching
 export _MAN_ALL;		# search all man pages per filespec
 export _MAN_ENABLE;		# enable search for man pages
@@ -498,8 +518,12 @@
 ########################################################################
 # Test of `echo' and the `$()' construct.
 #
-echo -n '' >${_NULL_DEV} || exit "${_ERROR}";
-if test _"$(echo -n 'te' && echo -n '' && echo -n 'st')"_ != _test_;
+echo '' >${_NULL_DEV} || exit "${_ERROR}";
+if test _"$(t1="$(echo te)" &&
+            t2="$(echo '')" &&
+            t3="$(echo 'st')" &&
+            echo "${t1}${t2}${t3}")"_ \
+     != _test_;
 then
   exit "${_ERROR}";
 fi;
@@ -533,6 +557,7 @@
 
 # _HAS_* from availability tests
 _HAS_COMPRESSION='';
+_HAS_BZIP='';
 
 # _TMP_* temporary files
 _TMP_DIR='';
@@ -672,20 +697,9 @@
 #
 echo2()
 {
-  echo "$*" >&2;
-}
-
-
-##############
-# echo2n (<text>*)
-#
-# Output to stderr.
-#
-# Arguments : arbitrary text.
-#
-echo2n()
-{
-  echo -n "$*" >&2;
+  cat >&2 <<EOF
+$*
+EOF
 }
 
 
@@ -711,7 +725,7 @@
 {
   err_code="${_ERROR}";
   case "$#" in
-    0) true; ;;
+    0) :; ;;
     1) echo2 'groffer error: '"$1"; ;;
     2)
       echo2 'groffer error: '"$1";
@@ -727,7 +741,7 @@
   kill "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
   kill -9 "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
   n="${err_code}";
-  unset err_code;
+  eval ${unset} err_code;
   exit "$n";
 }
 
@@ -751,7 +765,7 @@
 #
 # Arguments: >=3
 #   <func_name>: name of the calling function.
-#   <rel_op>:    a relational operator: = != < > <= >= 
+#   <rel_op>:    a relational operator: = != < > <= >=
 #   <nr_args>:   number of arguments to be checked against <operator>
 #   "$@":        the arguments of the calling function.
 #
@@ -802,12 +816,14 @@
       fc_op='-ne';
       fc_comp='not';
       ;;
-    *) 
+    *)
       error \
         'func_check(): second argument is not a relational operator.';
       ;;
   esac;
-  shift 3;
+  shift;
+  shift;
+  shift;
   if test "$#" "${fc_op}" "${fc_nargs}";
   then
     do_nothing;
@@ -819,11 +835,11 @@
   then
     func_push "${fc_fname} $*";
   fi;
-  unset fc_comp;
-  unset fc_fname;
-  unset fc_nargs;
-  unset fc_op;
-  unset fc_s;
+  eval ${unset} fc_comp;
+  eval ${unset} fc_fname;
+  eval ${unset} fc_nargs;
+  eval ${unset} fc_op;
+  eval ${unset} fc_s;
 }
 
 
@@ -852,8 +868,10 @@
         ;;
       *!*)
         # split at first bang `!'.
-        _FUNC_STACK="$(echo -n ${_FUNC_STACK} \
-                       | sed -e 's/^[^!]*!//')";
+        _FUNC_STACK="$(echo x"${_FUNC_STACK}" | sed -e '
+s/^x//
+s/^[^!]*!//
+')";
         ;;
       *)
         _FUNC_STACK='';
@@ -886,7 +904,10 @@
     case "$1" in
       *'!'*)
         # remove all bangs `!'.
-        fp_element="$(echo -n "$1" | sed -e 's/!//g')";
+        fp_element="$(echo x"$1" | sed -e '
+s/^x//
+s/!//g
+')";
         ;;
       *)
         fp_element="$1";
@@ -899,7 +920,7 @@
       _FUNC_STACK="${fp_element}!${_FUNC_STACK}";
     fi;
   fi;
-  unset fp_element;
+  eval ${unset} fp_element;
 }
 
 
@@ -917,9 +938,15 @@
       while test _"${_rest}"_ != __;
       do
         # get part before the first bang `!'.
-        diag "$(echo -n "${_rest}" | sed -e 's/!.*$//')";
+        diag "$(echo x"${_rest}" | sed -e '
+s/^x//
+s/!.*$//
+')";
         # delete part before and including the first bang `!'.
-        _rest="$(echo -n "${_rest}" | sed -e 's/^[^!]*!//')";
+        _rest="$(echo x"${_rest}" | sed -e '
+s/^x//
+s/^[^!]*!//
+')";
       done;
       ;;
     *)
@@ -939,46 +966,6 @@
 
 
 ########################################################################
-# Test of `true' and `false'.
-#
-_res="$(true 2>&1)";
-if test "$?" != 0 || test -n "${_res}";
-then
-  true()
-  {
-    return "${_GOOD}";
-  }
-fi;
-_res="$(false 2>&1)";
-if test "$?" = 0 || test -n "${_res}";
-then
-  false()
-  {
-    return "${_BAD}";
-  }
-fi;
-
-
-########################################################################
-# Test of `unset'.
-#
-_test='test';
-if unset _test >${_NULL_DEV} 2>&1 && test _"${_test}"_ = __;
-then
-  true;
-else
-  unset()
-  {
-    for v in "$@";
-    do
-      eval "$v"='';
-    done;
-  }
-fi;
-unset _test;
-unset _res;
-
-########################################################################
 # Test of function `sed'.
 #
 
@@ -1007,7 +994,7 @@
   _HAS_COMPRESSION='yes';
   if echo 'test' | bzip2 -c 2>${_NULL_DEV} | bzip2 -t 2>${_NULL_DEV} \
      && test _"$(echo 'test' | bzip2 -c 2>${_NULL_DEV} \
-                            | bzip2 -d -c 2>${_NULL_DEV})"_ \
+                             | bzip2 -d -c 2>${_NULL_DEV})"_ \
              = _test_;
   then
     _HAS_BZIP='yes';
@@ -1037,7 +1024,7 @@
 ########################################################################
 # apropos_run (<name>)
 #
-# 
+#
 apropos_run() {
   func_check apropos_run = 1 "$@";
   if apropos apropos >${_NULL_DEV} 2>${_NULL_DEV};
@@ -1072,29 +1059,37 @@
   case "${bn_name}" in
     */)
       # delete all final slashes
-      bn_name="$(echo -n "${bn_name}" | sed -e 's|//*$||')";
+      bn_name="$(echo x"${bn_name}" | sed -e '
+s/^x//
+s|//*$||
+')";
       ;;
   esac;
   case "${bn_name}" in
     /|'')
-      unset bn_name;
+      eval ${unset} bn_name;
       eval "${return_bad}";
       ;;
     */*)
       # delete everything before and including the last slash `/'.
-      echo -n "${bn_name}" | sed -e 's|^.*//*\([^/]*\)$|\1|';
+      echo x"${bn_name}" | sed -e '
+s/^x//
+s|^.*//*\([^/]*\)$|\1|
+';
       ;;
     *)
-      echo -n "${bn_name}";
+      cat <<EOF
+${bn_name}
+EOF
       ;;
   esac;
-  unset bn_name;
+  eval ${unset} bn_name;
   eval "${return_ok}";
 }
 
 
 ########################################################################
-# catz (<file>)
+# cat_z (<file>)
 #
 # Decompress if possible or just print <file> to standard output.
 #
@@ -1105,15 +1100,15 @@
 #
 if test _"${_HAS_COMPRESSION}"_ = _yes_;
 then
-  catz()
+  cat_z()
   {
-    func_check catz = 1 "$@";
+    func_check cat_z = 1 "$@";
     case "$1" in
       '')
-        error 'catz(): empty file name';
+        error 'cat_z(): empty file name';
         ;;
       '-')
-        error 'catz(): for standard input use save_stdin()';
+        error 'cat_z(): for standard input use save_stdin()';
         ;;
     esac;
     if obj _HAS_BZIP is_yes;
@@ -1128,9 +1123,9 @@
     eval "${return_ok}";
   }
 else
-  catz()
+  cat_z()
   {
-    func_check catz = 1 "$@";
+    func_check cat_z = 1 "$@";
     cat "$1";
     eval "${return_ok}";
   }
@@ -1174,7 +1169,9 @@
   fi;
   if is_empty "$2";
   then
-    echo -n "$1";
+    cat <<EOF
+$1
+EOF
   else
     dirname_chop "$1"/"$2";
   fi;
@@ -1196,15 +1193,24 @@
 {
   func_check dirname_chop = 1 "$@";
   # replace all multiple slashes by a single slash `/'.
-  dc_res="$(echo -n "$1" | sed -e 's|///*|/|g')";
+  dc_res="$(echo x"$1" | sed -e '
+s/^x//
+s|///*|/|g
+')";
   case "${dc_res}" in
     ?*/)
       # remove trailing slash '/';
-      echo -n "${dc_res}" | sed -e 's|/$||';
+      echo x"${dc_res}" | sed -e '
+s/^x//
+s|/$||
+';
       ;;
-    *) echo -n "${dc_res}"; ;;
+    *) cat <<EOF
+${dc_res}
+EOF
+  ;;
   esac;
-  unset dc_res;
+  eval ${unset} dc_res;
   eval "${return_ok}";
 }
 
@@ -1239,12 +1245,12 @@
   # store sequence into positional parameters
   case "${df_filespec}" in
     '')
-       unset df_filespec;
+       eval ${unset} df_filespec;
        eval "${return_good}";
        ;;
     '-')
       register_file '-';
-      unset df_filespec;
+      eval ${unset} df_filespec;
       eval "${return_good}";
       ;;
     */*)			# with directory part; so no man search
@@ -1264,7 +1270,7 @@
       fi;
       ;;
   esac;
-  for i;
+  for i
   do
     case "$i" in
       File)
@@ -1273,11 +1279,11 @@
           if test -r "${df_filespec}";
           then
             register_file "${df_filespec}";
-            unset df_filespec;
+            eval ${unset} df_filespec;
             eval "${return_good}";
           else
 	    echo2 "could not read \`${df_filespec}'";
-            unset df_filespec;
+            eval ${unset} df_filespec;
             eval "${return_bad}";
           fi;
         else
@@ -1291,7 +1297,7 @@
         fi;
         if man_do_filespec "${df_filespec}";
         then
-          unset df_filespec;
+          eval ${unset} df_filespec;
           eval "${return_good}";
         else
           continue;
@@ -1299,7 +1305,7 @@
         ;;
     esac;
   done;
-  unset df_filespec;
+  eval ${unset} df_filespec;
   eval "${return_bad}";
 } # do_filearg()
 
@@ -1324,14 +1330,6 @@
 
 
 ########################################################################
-# echo2n (<text>*)
-#
-# Print to standard error without final line break.
-#
-# defined above
-
-
-########################################################################
 # error (<text>*)
 #
 # Print error message and exit with error code.
@@ -1346,7 +1344,7 @@
 #
 # Arguments: >=3
 #   <func_name>: name of the calling function.
-#   <rel_op>:    a relational operator: = != < > <= >= 
+#   <rel_op>:    a relational operator: = != < > <= >=
 #   <nr_args>:   number of arguments to be checked against <operator>
 #   "$@":        the arguments of the calling function.
 #
@@ -1393,17 +1391,19 @@
   then
     eval "${return_ok}";
   fi;
-  for i;
+  for i
   do
     gfe_var="$i";
     if obj gfe_var is_not_empty;
     then
-      echo -n "${gfe_var}";
-      unset gfe_var;
+      cat <<EOF
+${gfe_var}
+EOF
+      eval ${unset} gfe_var;
       eval "${return_ok}";
     fi;
   done;
-  unset gfe_var;
+  eval ${unset} gfe_var;
   eval "${return_bad}";
 }
 
@@ -1472,7 +1472,8 @@
 ########################################################################
 # is_existing (<name>)
 #
-# Test whether `name' is an existing file or directory.
+# Test whether `name' is an existing file or directory.  Solaris 2.5 does
+# not have `test -e'.
 #
 # Arguments : 1
 # Return    : `0' if arg1 exists, `1' otherwise.
@@ -1480,7 +1481,7 @@
 is_existing()
 {
   func_check is_existing = 1 "$@";
-  if test -e "$1";
+  if test -f "$1" || test -d "$1";
   then
     eval "${return_yes}";
   fi;
@@ -1613,7 +1614,7 @@
 is_not_prog()
 {
   func_check is_not_prog '>=' 1 "$@";
-  if where "$1" >${_NULL_DEV};
+  if where_is "$1" >${_NULL_DEV};
   then
     eval "${return_no}";
   fi;
@@ -1658,12 +1659,12 @@
 
 
 ########################################################################
-# is_prog (<name>)
+# is_prog (<name> [<arg>*])
 #
-# Determine whether arg is a program in $PATH
+# Determine whether <name> is a program in $PATH
 #
 # Arguments : >=0 (empty allowed)
-#   more args are ignored, this allows to specify progs with arguments
+#   <arg>* are ignored, this allows to specify progs with arguments.
 #
 is_prog()
 {
@@ -1673,7 +1674,7 @@
     eval "${return_no}";
     ;;
   *)
-    if where "$1" >${_NULL_DEV};
+    if where_is "$1" >${_NULL_DEV};
     then
       eval "${return_yes}";
     fi;
@@ -1774,7 +1775,7 @@
   la_name="$1";
   eval la_list='"${'$1'}"';
   shift;
-  for s;
+  for s
   do
     la_s="$s";
     case "${la_s}" in
@@ -1782,9 +1783,12 @@
       # escape each single quote by replacing each
       # "'" (squote) by "'\''" (squote bslash squote squote);
       # note that the backslash must be doubled in the following `sed'
-      la_element="$(echo -n "${la_s}" | sed -e 's/'"${_SQUOTE}"'/&\\&&/g')";
+      la_element="$(echo x"${la_s}" | sed -e '
+s/^x//
+s/'"${_SQUOTE}"'/&\\&&/g
+')";
       ;;
-    '')  
+    '')
       la_element="";
       ;;
     *)
@@ -1799,10 +1803,10 @@
     fi;
   done;
   eval "${la_name}"='"${la_list}"';
-  unset la_element;
-  unset la_list;
-  unset la_name;
-  unset la_s;
+  eval ${unset} la_element;
+  eval ${unset} la_list;
+  eval ${unset} la_name;
+  eval ${unset} la_s;
   eval "${return_ok}";
 }
 
@@ -1874,14 +1878,16 @@
   lfc_fn='list_from_cmdline():';	 # for error messages
   if is_equal "$#" 0;
   then
-    echo -n "'--'";
-    unset lfc_fparams;
-    unset lfc_fn;
-    unset lfc_short_a;
-    unset lfc_short_n;
-    unset lfc_long_a;
-    unset lfc_long_n;
-    unset lfc_result;
+    cat <<EOF
+--
+EOF
+    eval ${unset} lfc_fparams;
+    eval ${unset} lfc_fn;
+    eval ${unset} lfc_short_a;
+    eval ${unset} lfc_short_n;
+    eval ${unset} lfc_long_a;
+    eval ${unset} lfc_long_n;
+    eval ${unset} lfc_result;
     eval "${return_ok}";
   fi;
   lfc_fparams='';
@@ -1894,7 +1900,7 @@
       --) break; ;;
       --?*)
         # delete leading '--';
-        lfc_opt="$(echo -n "${lfc_arg}" | sed -e 's/^..//')";
+        lfc_opt="$(echo x"${lfc_arg}" | sed -e 's/^x--//')";
         if list_has lfc_long_n "${lfc_opt}";
         then
           # long option, no argument
@@ -1905,11 +1911,17 @@
         if string_contains "${lfc_opt}" '=';
         then
           # extract option by deleting from the first '=' to the end
-          lfc_lopt="$(echo -n "${lfc_opt}" | sed -e 's/=.*$//')";
+          lfc_lopt="$(echo x"${lfc_opt}" | sed -e '
+s/^x//
+s/=.*$//
+')";
           if list_has lfc_long_a "${lfc_lopt}";
           then
             # get the option argument by deleting up to first `='
-            lfc_optarg="$(echo -n "${lfc_opt}" | sed -e 's/^[^=]*=//')";
+            lfc_optarg="$(echo x"${lfc_opt}" | sed -e '
+s/^x//
+s/^[^=]*=//
+')";
             list_append lfc_result "--${lfc_lopt}" "${lfc_optarg}";
             continue;
           fi;
@@ -1930,13 +1942,13 @@
         ;;
       -?*)			# short option (cluster)
         # delete leading `-';
-        lfc_rest="$(echo -n "${lfc_arg}" | sed -e 's/^-//')";
+        lfc_rest="$(echo x"${lfc_arg}" | sed -e 's/^x-//')";
         while obj lfc_rest is_not_empty;
         do
           # get next short option from cluster (first char of $lfc_rest)
-          lfc_optchar="$(echo -n "${lfc_rest}" | sed -e 's/^\(.\).*$/\1/')";
+          lfc_optchar="$(echo x"${lfc_rest}" | sed -e 's/^x\(.\).*$/\1/')";
           # remove first character from ${lfc_rest};
-          lfc_rest="$(echo -n "${lfc_rest}" | sed -e 's/^.//')";
+          lfc_rest="$(echo x"${lfc_rest}" | sed -e 's/^x.//')";
           if list_has lfc_short_n "${lfc_optchar}";
           then
             list_append lfc_result "-${lfc_optchar}";
@@ -1985,20 +1997,22 @@
   then
     list_append lfc_result "$@";
   fi;
-  echo -n "${lfc_result}";
-  unset lfc_fparams;
-  unset lfc_fn;
-  unset lfc_short_a;
-  unset lfc_short_n;
-  unset lfc_long_a;
-  unset lfc_long_n;
-  unset lfc_result;
-  unset lfc_arg;
-  unset lfc_opt;
-  unset lfc_opt_arg;
-  unset lfc_opt_char;
-  unset lfc_lopt;
-  unset lfc_rest;
+  cat <<EOF
+${lfc_result}
+EOF
+  eval ${unset} lfc_fparams;
+  eval ${unset} lfc_fn;
+  eval ${unset} lfc_short_a;
+  eval ${unset} lfc_short_n;
+  eval ${unset} lfc_long_a;
+  eval ${unset} lfc_long_n;
+  eval ${unset} lfc_result;
+  eval ${unset} lfc_arg;
+  eval ${unset} lfc_opt;
+  eval ${unset} lfc_opt_arg;
+  eval ${unset} lfc_opt_char;
+  eval ${unset} lfc_lopt;
+  eval ${unset} lfc_rest;
   eval "${return_ok}";
 } # list_from_cmdline()
 
@@ -2020,21 +2034,30 @@
   func_check list_from_split = 2 "$@";
 
   # precede each space or tab by a backslash `\' (doubled for `sed')
-  lfs_s="$(echo -n "$1" | sed -e 's/\(['"${_SPACE}${_TAB}"']\)/\\\1/g')";
+  lfs_s="$(echo x"$1" | sed -e '
+s/^x//
+s/\(['"${_SPACE}${_TAB}"']\)/\\\1/g
+')";
 
   # replace split character of string by the list separator ` ' (space).
   case "$2" in
     /)				# cannot use normal `sed' separator
-      echo -n "${lfs_s}" | sed -e 's|'"$2"'| |g';
+      echo x"${lfs_s}" | sed -e '
+s/^x//
+s|'"$2"'| |g
+';
       ;;
     ?)				# use normal `sed' separator
-      echo -n "${lfs_s}" | sed -e 's/'"$2"'/ /g';
+      echo x"${lfs_s}" | sed -e '
+s/^x//
+s/'"$2"'/ /g
+';
       ;;
     ??*)
       error 'list_from_split(): separator must be a single character.';
       ;;
   esac;
-  unset lfs_s;
+  eval ${unset} lfs_s;
   eval "${return_ok}";
 }
 
@@ -2064,24 +2087,27 @@
   func_check list_get = 1 "$@";
   eval lg_list='"${'$1'}"';
   # remove leading and final space characters
-  lg_list="$(echo -n "${lg_list}" | \
-           sed -e 's/^['"${_SPACE}${_TAB}"']*//' | \
-           sed -e 's/['"${_SPACE}${_TAB}"']*$//')";
+  lg_list="$(echo x"${lg_list}" | sed -e '
+s/^x['"${_SPACE}${_TAB}"']*//
+s/['"${_SPACE}${_TAB}"']*$//
+')";
   case "${lg_list}" in
   '')
-    unset lg_list;
+    eval ${unset} lg_list;
     eval "${return_ok}";
     ;;
   \'*\')
-    echo -n "${lg_list}";
-    unset lg_list;
+    cat <<EOF
+${lg_list}
+EOF
+    eval ${unset} lg_list;
     eval "${return_ok}";
     ;;
   *)
     error "list_get(): bad list: $1"
     ;;
   esac;
-  unset lg_list;
+  eval ${unset} lg_list;
   eval "${return_ok}";
 }
 
@@ -2191,38 +2217,38 @@
   mdf_section='';
   case "${mdf_spec}" in
     */*)			# not a man spec when it contains '/'
-      unset mdf_got_one;
-      unset mdf_name;
-      unset mdf_section;
-      unset mdf_spec;
+      eval ${unset} mdf_got_one;
+      eval ${unset} mdf_name;
+      eval ${unset} mdf_section;
+      eval ${unset} mdf_spec;
       eval "${return_bad}";
       ;;
     man:?*\(?*\))		# man:name(section)
-      mdf_name="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^man:\(..*\)(\(..*\))$/\1/')";
-      mdf_section="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^man:\(..*\)(\(..*\))$/\2/')";
+      mdf_name="$(echo x"${mdf_spec}" \
+               | sed -e 's/^xman:\(..*\)(\(..*\))$/\1/')";
+      mdf_section="$(echo x"${mdf_spec}" \
+               | sed -e 's/^xman:\(..*\)(\(..*\))$/\2/')";
       ;;
     man:?*.[0-9on])			# man:name.section
-      mdf_name="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^man:\(..*\)\..$/\1/')";
-      mdf_section="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^.*\(.\)$/\1/')";
+      mdf_name="$(echo x"${mdf_spec}" \
+               | sed -e 's/^xman:\(..*\)\..$/\1/')";
+      mdf_section="$(echo x"${mdf_spec}" \
+               | sed -e 's/^x.*\(.\)$/\1/')";
       ;;
     man:?*)			# man:name
-      mdf_name="$(echo -n "${mdf_spec}" | sed -e 's/^man://')";
+      mdf_name="$(echo x"${mdf_spec}" | sed -e 's/^xman://')";
       ;;
     ?*\(?*\))			# name(section)
-      mdf_name="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^\(..*\)(\(..*\))$/\1/')";
-      mdf_section="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^\(..*\)(\(..*\))$/\2/')";
+      mdf_name="$(echo x"${mdf_spec}" \
+               | sed -e 's/^x\(..*\)(\(..*\))$/\1/')";
+      mdf_section="$(echo x"${mdf_spec}" \
+               | sed -e 's/^x\(..*\)(\(..*\))$/\2/')";
       ;;
     ?*.[0-9on])			# name.section
-      mdf_name="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^\(..*\)\..$/\1/')";
-      mdf_section="$(echo -n "${mdf_spec}" \
-               | sed -e 's/^.*\(.\)$/\1/')";
+      mdf_name="$(echo x"${mdf_spec}" \
+               | sed -e 's/^x\(..*\)\..$/\1/')";
+      mdf_section="$(echo x"${mdf_spec}" \
+               | sed -e 's/^x.*\(.\)$/\1/')";
       ;;
     ?*)
       mdf_name="${mdf_spec}";
@@ -2230,10 +2256,10 @@
   esac;
   if obj mdf_name is_empty;
   then
-    unset mdf_got_one;
-    unset mdf_name;
-    unset mdf_section;
-    unset mdf_spec;
+    eval ${unset} mdf_got_one;
+    eval ${unset} mdf_name;
+    eval ${unset} mdf_section;
+    eval ${unset} mdf_spec;
     eval "${return_bad}";
   fi;
   mdf_got_one='no';
@@ -2241,7 +2267,7 @@
   then
     eval set x "${_MAN_AUTO_SEC}";
     shift;
-    for s;
+    for s
     do
       mdf_s="$s";
       if man_search_section "${mdf_name}" "${mdf_s}";
@@ -2250,11 +2276,11 @@
         then
           mdf_got_one='yes';
         else
-          unset mdf_got_one;
-          unset mdf_name;
-          unset mdf_s;
-          unset mdf_section;
-          unset mdf_spec;
+          eval ${unset} mdf_got_one;
+          eval ${unset} mdf_name;
+          eval ${unset} mdf_s;
+          eval ${unset} mdf_section;
+          eval ${unset} mdf_spec;
           eval "${return_good}";
         fi;
       fi;
@@ -2262,34 +2288,34 @@
   else
     if man_search_section "${mdf_name}" "${mdf_section}";
     then
-      unset mdf_got_one;
-      unset mdf_name;
-      unset mdf_s;
-      unset mdf_section;
-      unset mdf_spec;
+      eval ${unset} mdf_got_one;
+      eval ${unset} mdf_name;
+      eval ${unset} mdf_s;
+      eval ${unset} mdf_section;
+      eval ${unset} mdf_spec;
       eval "${return_good}";
     else
-      unset mdf_got_one;
-      unset mdf_name;
-      unset mdf_section;
-      unset mdf_spec;
+      eval ${unset} mdf_got_one;
+      eval ${unset} mdf_name;
+      eval ${unset} mdf_section;
+      eval ${unset} mdf_spec;
       eval "${return_bad}";
     fi;
   fi;
   if obj _MAN_ALL is_yes && is_yes "${mdf_got_one}";
   then
-    unset mdf_got_one;
-    unset mdf_name;
-    unset mdf_s;
-    unset mdf_section;
-    unset mdf_spec;
+    eval ${unset} mdf_got_one;
+    eval ${unset} mdf_name;
+    eval ${unset} mdf_s;
+    eval ${unset} mdf_section;
+    eval ${unset} mdf_spec;
     eval "${return_good}";
   fi;
-  unset mdf_got_one;
-  unset mdf_name;
-  unset mdf_s;
-  unset mdf_section;
-  unset mdf_spec;
+  eval ${unset} mdf_got_one;
+  eval ${unset} mdf_name;
+  eval ${unset} mdf_s;
+  eval ${unset} mdf_section;
+  eval ${unset} mdf_spec;
   eval "${return_bad}";
 } # man_do_filespec()
 
@@ -2363,131 +2389,157 @@
   mss_got_one='no';
   if obj _MAN_EXT is_empty;
   then
-    for d;
+    for d
     do
       mss_dir="$(dirname_append "$d" "man${mss_section}")";
       if obj mss_dir is_dir;
       then
         mss_prefix="$(\
           dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
-        for f in $(echo -n ${mss_prefix}*);
-        do
-          mss_f="$f";
-          if obj mss_f is_file;
-          then
-            if is_yes "${mss_got_one}";
-            then
-              register_file "${mss_f}";
-            elif obj _MAN_ALL is_yes;
+        mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+                     sed -e '\| found|s|.*||'
+                     )";
+        if obj mss_files is_not_empty;
+        then
+          # for f in $mss_files
+          for f in $(eval set x ${mss_files}; shift; echo "$@")
+          do
+            mss_f="$f";
+            if obj mss_f is_file;
             then
-              man_register_file "${mss_f}" "${mss_name}";
-            else
-              man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-              unset mss_dir;
-              unset mss_ext;
-              unset mss_f;
-              unset mss_got_one;
-              unset mss_name;
-              unset mss_prefix;
-              unset mss_section;
-              eval "${return_good}";
+              if is_yes "${mss_got_one}";
+              then
+                register_file "${mss_f}";
+              elif obj _MAN_ALL is_yes;
+              then
+                man_register_file "${mss_f}" "${mss_name}";
+              else
+                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+                eval ${unset} mss_dir;
+                eval ${unset} mss_ext;
+                eval ${unset} mss_f;
+                eval ${unset} mss_files;
+                eval ${unset} mss_got_one;
+                eval ${unset} mss_name;
+                eval ${unset} mss_prefix;
+                eval ${unset} mss_section;
+                eval "${return_good}";
+              fi;
+              mss_got_one='yes';
             fi;
-            mss_got_one='yes';
-          fi;
-        done;
+          done;
+        fi;
       fi;
     done;
   else
     mss_ext="${_MAN_EXT}";
     # check for directory name having trailing extension
-    for d;
+    for d
     do
       mss_dir="$(dirname_append $d man${mss_section}${mss_ext})";
       if obj mss_dir is_dir;
       then
         mss_prefix=\
           "$(dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
-        for f in ${mss_prefix}*;
-        do
-          mss_f="$f";
-          if obj mss_f is_file;
-          then
-            if is_yes "${mss_got_one}";
-            then
-              register_file "${mss_f}";
-            elif obj _MAN_ALL is_yes;
+        mss_files="$( eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+                     sed -e '\|not found|s|.*||'
+                     )";
+        if obj mss_files is_not_empty;
+        then
+          # for f in $mss_files
+          for f in $(eval set x ${mss_files}; shift; echo "$@")
+          do
+            mss_f="$f";
+            if obj mss_f is_file;
             then
-              man_register_file "${mss_f}" "${mss_name}";
-            else
-              man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-              unset mss_dir;
-              unset mss_ext;
-              unset mss_f;
-              unset mss_got_one;
-              unset mss_name;
-              unset mss_prefix;
-              unset mss_section;
-              eval "${return_good}";
+              if is_yes "${mss_got_one}";
+              then
+                register_file "${mss_f}";
+              elif obj _MAN_ALL is_yes;
+              then
+                man_register_file "${mss_f}" "${mss_name}";
+              else
+                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+                eval ${unset} mss_dir;
+                eval ${unset} mss_ext;
+                eval ${unset} mss_f;
+                eval ${unset} mss_files;
+                eval ${unset} mss_got_one;
+                eval ${unset} mss_name;
+                eval ${unset} mss_prefix;
+                eval ${unset} mss_section;
+                eval "${return_good}";
+              fi;
+              mss_got_one='yes';
             fi;
-            mss_got_one='yes';
-          fi;
-        done;
+          done;
+        fi;
       fi;
     done;
     # check for files with extension in directories without extension
-    for d;
+    for d
     do
       mss_dir="$(dirname_append "$d" "man${mss_section}")";
       if obj mss_dir is_dir;
       then
         mss_prefix="$(dirname_append "${mss_dir}" \
                         "${mss_name}.${mss_section}${mss_ext}")";
-        for f in ${mss_prefix}*;
-        do
-          mss_f="$f";
-          if obj mss_f is_file;
-          then
-            if is_yes "${mss_got_one}";
-            then
-              register_file "${mss_f}";
-            elif obj _MAN_ALL is_yes;
+        mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+                     sed -e '\|not found|s|.*||'
+                     )";
+        if obj mss_files is_not_empty;
+        then
+          # for f in $mss_files
+          for f in $(eval set x ${mss_files}; shift; echo "$@")
+          do
+            mss_f="$f";
+            if obj mss_f is_file;
             then
-              man_register_file "${mss_f}" "${mss_name}";
-            else
-              man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-              unset mss_dir;
-              unset mss_ext;
-              unset mss_f;
-              unset mss_got_one;
-              unset mss_name;
-              unset mss_prefix;
-              unset mss_section;
-              eval "${return_good}";
+              if is_yes "${mss_got_one}";
+              then
+                register_file "${mss_f}";
+              elif obj _MAN_ALL is_yes;
+              then
+                man_register_file "${mss_f}" "${mss_name}";
+              else
+                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+                eval ${unset} mss_dir;
+                eval ${unset} mss_ext;
+                eval ${unset} mss_f;
+                eval ${unset} mss_files;
+                eval ${unset} mss_got_one;
+                eval ${unset} mss_name;
+                eval ${unset} mss_prefix;
+                eval ${unset} mss_section;
+                eval "${return_good}";
+              fi;
+              mss_got_one='yes';
             fi;
-            mss_got_one='yes';
-          fi;
-        done;
+          done;
+        fi;
       fi;
     done;
   fi;
   if obj _MAN_ALL is_yes && is_yes "${mss_got_one}";
   then
-    unset mss_dir;
-    unset mss_ext;
-    unset mss_f;
-    unset mss_got_one;
-    unset mss_name;
-    unset mss_prefix;
-    unset mss_section;
+    eval ${unset} mss_dir;
+    eval ${unset} mss_ext;
+    eval ${unset} mss_f;
+    eval ${unset} mss_files;
+    eval ${unset} mss_got_one;
+    eval ${unset} mss_name;
+    eval ${unset} mss_prefix;
+    eval ${unset} mss_section;
     eval "${return_good}";
   fi;
-  unset mss_dir;
-  unset mss_ext;
-  unset mss_f;
-  unset mss_got_one;
-  unset mss_name;
-  unset mss_prefix;
-  unset mss_section;
+  eval ${unset} mss_dir;
+  eval ${unset} mss_ext;
+  eval ${unset} mss_f;
+  eval ${unset} mss_files;
+  eval ${unset} mss_got_one;
+  eval ${unset} mss_name;
+  eval ${unset} mss_prefix;
+  eval ${unset} mss_section;
   eval "${return_bad}";
 } # man_search_section()
 
@@ -2575,7 +2627,7 @@
     *)
       _MAN_LANG="${ms_lang}";
       # get first two characters of $ms_lang
-      _MAN_LANG2="$(echo -n "${ms_lang}" | sed -e 's/^\(..\).*$/\1/')";
+      _MAN_LANG2="$(echo x"${ms_lang}" | sed -e 's/^x\(..\).*$/\1/')";
       ;;
   esac;
   # from now on, use only $_LANG, forget about $_OPT_LANG, $LC_*.
@@ -2587,13 +2639,13 @@
   if obj _MAN_PATH is_empty;
   then
     _MAN_ENABLE="no";
-    unset ms_lang;
+    eval ${unset} ms_lang;
     eval "${return_ok}";
   fi;
 
   _MAN_EXT="$(get_first_essential \
               "${_OPT_EXTENSION}" "${_MANOPT_EXTENSION}")";
-  unset ms_lang;
+  eval ${unset} ms_lang;
   eval "${return_ok}";
 } # man_setup()
 
@@ -2629,18 +2681,18 @@
   eval set x "$(path_split "${_MAN_PATH}")";
   shift;
   mals_mp='';
-  for p;
+  for p
   do				# loop on man path directories
     mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
   done;
   eval set x "$(path_split "${mals_mp}")";
   shift;
-  for p;
+  for p
   do				# loop on man path directories
     mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
   done;
   _MAN_PATH="$(path_chop "${mals_mp}")";
-  unset mals_mp;
+  eval ${unset} mals_mp;
   eval "${return_ok}";
 }
 
@@ -2661,7 +2713,7 @@
   _mals_parent="$2";
   eval set x "$(list_from_split "${_MAN_SYS}" ',')";
   shift;
-  for d in "$@" "${_MAN_LANG}" "${_MAN_LANG2}";
+  for d in "$@" "${_MAN_LANG}" "${_MAN_LANG2}"
   do
     _mals_dir="$(dirname_append "${_mals_parent}" "$d")";
     if obj _mals_res path_not_contains "${_mals_dir}" && \
@@ -2675,9 +2727,9 @@
     _mals_res="${_mals_res}:${_mals_parent}";
   fi;
   path_chop "${_mals_res}";
-  unset _mals_dir;
-  unset _mals_parent;
-  unset _mals_res;
+  eval ${unset} _mals_dir;
+  eval ${unset} _mals_parent;
+  eval ${unset} _mals_res;
   eval "${return_ok}";
 }
 
@@ -2708,11 +2760,14 @@
   then
     eval set x "$(path_split "${PATH}")";
     shift;
-    for d;
+    for d
     do
       # delete the final `/bin' part
-      msfp_base="$(echo -n "$d" | sed -e 's|//*bin/*$||')";
-      for e in /share/man /man;
+      msfp_base="$(echo x"$d" | sed -e '
+s/^x//
+s|//*bin/*$||
+')";
+      for e in /share/man /man
       do
         msfp_mandir="${msfp_base}$e";
         if test -d "${msfp_mandir}" && test -r "${msfp_mandir}";
@@ -2728,7 +2783,7 @@
            /usr/share/man /usr/man \
            /usr/X11R6/man /usr/openwin/man \
            /opt/share/man /opt/man \
-           /opt/gnome/man /opt/kde/man;
+           /opt/gnome/man /opt/kde/man
   do
     msfp_d="$d";
     if obj msfp_manpath path_not_contains "${msfp_d}" && obj mfsp_d is_dir;
@@ -2738,10 +2793,10 @@
   done;
 
   _MAN_PATH="${msfp_manpath}";
-  unset msfp_base;
-  unset msfp_d;
-  unset msfp_mandir;
-  unset msfp_manpath;
+  eval ${unset} msfp_base;
+  eval ${unset} msfp_d;
+  eval ${unset} msfp_mandir;
+  eval ${unset} msfp_manpath;
   eval "${return_ok}";
 } # manpath_set_from_path()
 
@@ -2779,8 +2834,8 @@
   shift;
   eval "${o_func}"' "${o_arg1}" "$@"';
   n="$?";
-  unset o_arg1;
-  unset o_func;
+  eval ${unset} o_arg1;
+  eval ${unset} o_func;
   eval "${return_var} $n";
 } # obj()
 
@@ -2795,6 +2850,8 @@
 #            <object>: a variable name
 # Output:    the data of <object>
 #
+# Variable prefix: od
+#
 obj_data()
 {
   func_check obj '=' 1 "$@";
@@ -2802,7 +2859,11 @@
   then
     error "obj_data(): object name is empty."
   fi;
-  eval echo -n '"${'$1'}"';
+  eval od_res='"${'$1'}"';
+  cat <<EOF
+${od_res}
+EOF
+  eval ${unset} od_res;
   eval "${return_ok}";
 }
 
@@ -2875,9 +2936,11 @@
 
   # replace multiple colons by a single colon `:'
   # remove leading and trailing colons
-  echo -n "$1" | sed -e 's/:::*/:/g' |
-                 sed -e 's/^:*//' |
-                 sed -e 's/:*$//';
+  echo x"$1" | sed -e '
+s/^x:*//
+s/:::*/:/g
+s/:*$//
+';
   eval "${return_ok}";
 }
 
@@ -2903,7 +2966,7 @@
   eval set x "$(path_split "${pc_arg}")";
   shift;
   pc_res="";
-  for i;
+  for i
   do
     pc_i="$i";
     if obj pc_i is_not_empty \
@@ -2916,9 +2979,9 @@
       esac;
     fi;
   done;
-  unset pc_arg;
-  unset pc_i;
-  unset pc_res;
+  eval ${unset} pc_arg;
+  eval ${unset} pc_i;
+  eval ${unset} pc_res;
   if path_chop "${pc_res}";
   then
     eval "${return_ok}";
@@ -3035,18 +3098,24 @@
     eval "${return_ok}";
   fi;
   rt_title="$(base_name "$1")";	# remove directory part
-  
+
   # remove extension `.gz'
-  rt_title="$(echo -n "${rt_title}" | sed -e 's/\.gz$//')";
+  rt_title="$(echo x"${rt_title}" | sed -e '
+s/^x//
+s/\.gz$//
+')";
   # remove extension `.Z'
-  rt_title="$(echo -n "${rt_title}" | sed -e 's/\.Z$//')";
+  rt_title="$(echo x"${rt_title}" | sed -e '
+s/^x//
+s/\.Z$//
+')";
 
   if obj rt_title is_empty;
   then
     eval "${return_ok}";
   fi;
   _REGISTERED_TITLE="${_REGISTERED_TITLE} ${rt_title}";
-  unset rt_title;
+  eval ${unset} rt_title;
   eval "${return_ok}";
 }
 
@@ -3074,9 +3143,9 @@
     func_check save_stdin = 0 "$@";
     ss_f="${_TMP_DIR}"/INPUT;
     cat >"${ss_f}";
-    catz "${ss_f}" >"${_TMP_STDIN}";
+    cat_z "${ss_f}" >"${_TMP_STDIN}";
     rm -f "${ss_f}";
-    unset ss_f;
+    eval ${unset} ss_f;
     eval "${return_ok}";
   }
 else
@@ -3160,6 +3229,8 @@
 # It's safe to use the shell process ID together with a suffix to
 # have multiple temporary files.
 #
+# Globals: $_TMP_DIR
+#
 # Output : name of created file
 #
 # Variable prefix: tc
@@ -3169,9 +3240,12 @@
   func_check tmp_create '<=' 1 "$@";
   # the output file does not have `,' as first character
   tc_tmp="${_TMP_DIR}/,$1";
-  echo -n >"${tc_tmp}";
-  echo -n "${tc_tmp}";		# output file name
-  unset tc_tmp;
+  cat >"${tc_tmp}" <<EOF
+EOF
+  cat <<EOF
+${tc_tmp}
+EOF
+  eval ${unset} tc_tmp;
   eval "${return_ok}";
 }
 
@@ -3194,7 +3268,7 @@
     then
       what_is "$1" >>"${_TMP_CAT}";
     else
-      catz "$1" >>"${_TMP_CAT}";
+      cat_z "$1" >>"${_TMP_CAT}";
     fi;
   else
     error "to_tmp(): could not read file \`$1'.";
@@ -3214,9 +3288,10 @@
 trap_clean()
 {
   func_check trap_clean = 0 "$@";
-  for i in ${_ALL_EXIT};
+  # for i in $_ALL_EXIT
+  for i in $(eval set x ${_ALL_EXIT}; shift; echo "$@")
   do
-    trap "" "$i" 2>${_NULL_DEV} || true;
+    trap "" "$i" 2>${_NULL_DEV} || :;
   done;
   eval "${return_ok}";
 }
@@ -3233,9 +3308,10 @@
 trap_set()
 {
   func_check trap_set = 1 "$@";
-  for i in ${_ALL_EXIT};
+  # for i in $_ALL_EXIT
+  for i in $(eval set x ${_ALL_EXIT}; shift; echo "$@")
   do
-    trap "$1" "$i" 2>${_NULL_DEV} || true;
+    trap "$1" "$i" 2>${_NULL_DEV} || :;
   done;
   eval "${return_ok}";
 }
@@ -3274,7 +3350,7 @@
 -V               display the groff execution pipe instead of formatting.
 -X --X --x       display with "gxditview" using groff -X.
 -Z --ditroff --intermediate-output
-                 generate groff intermediate output without 
+                 generate groff intermediate output without
                  post-processing and viewing, like groff -Z.
 All other short options are interpreted as "groff" formatting options.
 
@@ -3339,7 +3415,7 @@
   func_check version = 0 "$@";
   echo2 "${_PROGRAM_NAME} ${_PROGRAM_VERSION} of ${_LAST_UPDATE}";
   # also display groff's version, but not the called subprograms
-  groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /' >&2;  
+  groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /' >&2;
 }
 
 
@@ -3370,12 +3446,13 @@
     error "what_is(): argument is not a readable file."
   fi;
   wi_dot='^\.['"${_SPACE}${_TAB}"']*';
-  echo '.br';
-  echo "$1: ";
-    echo '.br';
-  echo -n '  ';
+  cat <<EOF
+.br
+  $1:
+.br
+EOF
   # grep the line containing `.TH' macro, if any
-  wi_res="$(catz "$1" | sed -e '/'"${wi_dot}"'TH /p
+  wi_res="$(cat_z "$1" | sed -e '/'"${wi_dot}"'TH /p
 d')";
   if obj wi_res is_not_empty;
   then				# traditional man style
@@ -3383,16 +3460,16 @@
     # - delete up to first .SH;
     # - of this, print everything up to next .SH, and delete the rest;
     # - of this, delete the final .SH line;
-    catz "$1" | sed -e '1,/'"${wi_dot}"'SH/d' \
+    cat_z "$1" | sed -e '1,/'"${wi_dot}"'SH/d' \
               | sed -e '1,/'"${wi_dot}"'SH/p
 d' \
               | sed -e '/'"${wi_dot}"'SH/d';
-    unset wi_dot;
-    unset wi_res;
+    eval ${unset} wi_dot;
+    eval ${unset} wi_res;
     eval "${return_ok}";
   fi;
   # grep the line containing `.Dd' macro, if any
-  wi_res="$(catz "$1" | sed -e '/'"${wi_dot}"'Dd /p
+  wi_res="$(cat_z "$1" | sed -e '/'"${wi_dot}"'Dd /p
 d')";
   if obj wi_res is_not_empty;
   then				# BSD doc style
@@ -3400,23 +3477,23 @@
     # - delete up to first .Nd;
     # - of this, print everything up to next .Nd, and delete the rest;
     # - of this, delete the final .Nd line;
-    catz "$1" | sed -e '1,/'"${wi_dot}"'Nd/d' \
+    cat_z "$1" | sed -e '1,/'"${wi_dot}"'Nd/d' \
               | sed -e '1,/'"${wi_dot}"'Nd/p
 d' \
               | sed -e '/'"${wi_dot}"'Nd/d';
-    unset wi_dot;
-    unset wi_res;
+    eval ${unset} wi_dot;
+    eval ${unset} wi_res;
     eval "${return_ok}";
   fi;
   echo 'is not a man page.';
-  unset wi_dot;
-  unset wi_res;
+  eval ${unset} wi_dot;
+  eval ${unset} wi_res;
   eval "${return_bad}";
 }
 
 
 ########################################################################
-# where (<program>)
+# where_is (<program>)
 #
 # Output path of a program if in $PATH.
 #
@@ -3426,19 +3503,19 @@
 #
 # Variable prefix: w
 #
-where()
+where_is()
 {
-  func_check where '>=' 1 "$@";
+  func_check where_is '>=' 1 "$@";
   w_arg="$1";
   if obj w_arg is_empty;
   then
-    unset w_arg;
+    eval ${unset} w_arg;
     eval "${return_bad}";
   fi;
   case "${w_arg}" in
     /*)
-      unset w_arg;
-      unset w_file;
+      eval ${unset} w_arg;
+      eval ${unset} w_file;
       if test -f "${w_arg}" && test -x "${w_arg}";
       then
         eval "${return_ok}";
@@ -3449,7 +3526,7 @@
   esac;
   eval set x "$(path_split "${PATH}")";
   shift;
-  for p;
+  for p
   do
     case "$p" in
       */) w_file=${p}${w_arg}; ;;
@@ -3457,14 +3534,16 @@
     esac;
     if test -f "${w_file}" && test -x "${w_file}";
     then
-      echo -n "${w_file}";
-      unset w_arg;
-      unset w_file;
+      cat <<EOF
+${w_file}
+EOF
+      eval ${unset} w_arg;
+      eval ${unset} w_file;
       eval "${return_ok}";
     fi;
   done;
-  unset w_arg;
-  unset w_file;
+  eval ${unset} w_arg;
+  eval ${unset} w_file;
   eval "${return_bad}";
 }
 
@@ -3507,10 +3586,10 @@
   umask 0022;
   _TMP_DIR='';
   for d in "${GROFF_TMPDIR}" "${TMPDIR}" "${TMP}" "${TEMP}" \
-           "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.';
+           "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.'
   do
-   mi_dir="$d";
-   if obj mi_dir is_empty || obj mi_dir is_not_dir || \
+    mi_dir="$d";
+    if obj mi_dir is_empty || obj mi_dir is_not_dir || \
        obj mi_dir is_not_writable;
     then
       continue;
@@ -3525,19 +3604,28 @@
       ;;
     esac;
     _TMP_DIR="${_TMP_DIR}${_PROGRAM_NAME}${_PROCESS_ID}";
-    while obj _TMP_DIR is_existing;
-    do
+    if obj _TMP_DIR is_existing;
+    then
       rm -f -r "${_TMP_DIR}" 2>${_NULL_DEV};
       if obj _TMP_DIR is_existing;
       then
-        # $_TMP_DIR could not be removed
-        _TMP_DIR="${_TMP_DIR}"'X';
-        continue;
-      else
-        # $_TMP_DIR was removed
-        break;
+        mi_tdir_="${_TMP_DIR}"_;
+        mi_n=1;
+        mi_tdir_n="${mi_tdir_}${mi_n}";
+        while obj mi_tdir_n is_existing;
+        do
+          rm -f -r "${mi_tdir_n}" 2>${_NULL_DEV};
+          if obj mi_tdir_n is_existing;
+          then
+            # directory could not be removed
+            mi_n="$(expr "${mi_n}" + 1)";
+            mi_tdir_n="${mi_tdir_}${mi_n}";
+            continue;
+          fi;
+        done;
+        _TMP_DIR="${mi_tdir_n}";
       fi;
-    done;
+    fi;
     mkdir "${_TMP_DIR}";
     if is_not_equal "$?" 0;
     then
@@ -3570,7 +3658,8 @@
   _TMP_STDIN="$(tmp_create groffer_input)";
 
   # groffer configuration files
-  for f in ${_CONFFILES};
+  # for f in $_CONF_FILES
+  for f in $(eval set x ${_CONF_FILES}; shift; echo "$@")
   do
     mi_file="$f";
     if obj mi_file is_file;
@@ -3587,8 +3676,11 @@
   . "${_TMP_CAT}";
   _TMP_CAT="$(tmp_create groffer_cat)";
 
-  unset mi_dir;
-  unset mi_file;
+  eval ${unset} mi_dir;
+  eval ${unset} mi_file;
+  eval ${unset} mi_n;
+  eval ${unset} mi_tdir_;
+  eval ${unset} mi_tdir_n;
   eval "${return_ok}";
 } # main_init()
 
@@ -3613,13 +3705,12 @@
   mpm_list='';
   if obj MANOPT is_not_empty;
   then
-    MANOPT="$(echo -n "${MANOPT}" | \
-      sed -e 's/^'"${_SPACE}${_SPACE}"'*//')";
+    MANOPT="$(echo x"${MANOPT}" | sed -e 's/^x'"${_SPACE}${_SPACE}"'*//')";
   fi;
   if obj MANOPT is_empty;
   then
-    unset mpm_list;
-    unset mpm_opt;
+    eval ${unset} mpm_list;
+    eval ${unset} mpm_opt;
     eval "${return_ok}";
   fi;
   # add arguments in $MANOPT by mapping them to groffer options
@@ -3728,8 +3819,8 @@
   then
     GROFFER_OPT="${mpm_list} ${GROFFER_OPT}";
   fi;
-  unset mpm_list;
-  unset mpm_opt;
+  eval ${unset} mpm_list;
+  eval ${unset} mpm_opt;
   eval "${return_ok}";
 } # main_parse_MANOPT()
 
@@ -3793,12 +3884,12 @@
       -Z|--ditroff|--intermediate-output) # groff intermediate output
         _OPT_Z='yes';
         ;;
-      -X|--X|--x)
+      -X)
         _OPT_MODE=x;
         ;;
       -?)
         # delete leading `-'
-        mpa_optchar="$(echo -n "${mpa_opt}" | sed -e 's/^.//')";
+        mpa_optchar="$(echo x"${mpa_opt}" | sed -e 's/^x-//')";
         if list_has _OPTS_GROFF_SHORT_NA "${mpa_optchar}";
         then
           list_append _ADDOPTS_GROFF "${mpa_opt}";
@@ -3839,13 +3930,13 @@
         ;;
       --ascii)
         list_append _ADDOPTS_GROFF '-mtty-char';
-        if obj mpa_mode is_empty;
+        if obj _OPT_MODE is_empty;
         then
-          mpa_mode='text';
+         _OPT_MODE='text';
         fi;
         ;;
       --auto)			# the default automatic mode
-        mpa_mode='';
+        _OPT_MODE='';
         ;;
       --bd)			# border color for viewers, arg;
         _OPT_BD="$1";
@@ -3935,40 +4026,40 @@
         shift;
         case "${mpa_arg}" in
           auto|'')		# search mode automatically among default
-	    mpa_mode='';
+	    _OPT_MODE='';
             ;;
           groff)		# pass input to plain groff
-            mpa_mode='groff';
+            _OPT_MODE='groff';
             ;;
           html|www)		# display with a web browser
-            mpa_mode='html';
+            _OPT_MODE='html';
             ;;
           dvi)			# display with xdvi viewer
-            mpa_mode='dvi';
+            _OPT_MODE='dvi';
             ;;
           pdf)			# display with PDF viewer
-            mpa_mode='pdf';
+            _OPT_MODE='pdf';
             ;;
           ps)			# display with Postscript viewer
-            mpa_mode='ps';
+            _OPT_MODE='ps';
             ;;
           text)			# output on terminal
-            mpa_mode='text';
+            _OPT_MODE='text';
             ;;
           tty)			# output on terminal
-            mpa_mode='tty';
+            _OPT_MODE='tty';
             ;;
           X|x)			# output on X roff viewer
-            mpa_mode='x';
+            _OPT_MODE='x';
+            _OPT_DEVICE='X75-12';
             ;;
           Q|source)		# display source code
-            mpa_mode="source";
+            _OPT_MODE="source";
             ;;
 	  *)
             error "main_parse_args(): unknown mode ${mpa_arg}";
             ;;
         esac;
-        _OPT_MODE="${mpa_mode}";
         ;;
       --no-location)		# disable former call to `--location'
         _OPT_LOCATION='yes';
@@ -4047,6 +4138,10 @@
       --whatis)
         _OPT_WHATIS='yes';
         ;;
+      ---X|--x)
+        _OPT_MODE=x;
+        _OPT_DEVICE='X75-12';
+        ;;
       --xrm)			# pass X resource string, arg;
         list_append _OPT_XRM "$1";
         shift;
@@ -4084,12 +4179,11 @@
     save_stdin;
   fi;
   # $_FILEARGS must be retrieved with `eval set x "$_FILEARGS"; shift;'
-  unset mpa_arg;
-  unset mpa_code;
-  unset mpa_dpi;
-  unset mpa_mode;
-  unset mpa_opt;
-  unset mpa_optchar;
+  eval ${unset} mpa_arg;
+  eval ${unset} mpa_code;
+  eval ${unset} mpa_dpi;
+  eval ${unset} mpa_opt;
+  eval ${unset} mpa_optchar;
   eval "${return_ok}";
 } # main_parse_args()
 
@@ -4204,20 +4298,20 @@
   fi;
   if obj _DISPLAY_MODE is_equal 'groff';
   then
-    unset msm_code;
-    unset msm_modes;
-    unset msm_viewer;
-    unset msm_viewers;
+    eval ${unset} msm_code;
+    eval ${unset} msm_modes;
+    eval ${unset} msm_viewer;
+    eval ${unset} msm_viewers;
     eval "${return_ok}";
   fi;
 
   if obj _OPT_MODE is_equal 'source';
   then
     _DISPLAY_MODE='source';
-    unset msm_code;
-    unset msm_modes;
-    unset msm_viewer;
-    unset msm_viewers;
+    eval ${unset} msm_code;
+    eval ${unset} msm_modes;
+    eval ${unset} msm_viewer;
+    eval ${unset} msm_viewers;
     eval "${return_ok}";
   fi;
 
@@ -4231,10 +4325,10 @@
 no X display found for device ${_OPT_DEVICE}";
           fi;
           _DISPLAY_MODE='x';
-          unset msm_code;
-          unset msm_modes;
-          unset msm_viewer;
-          unset msm_viewers;
+          eval ${unset} msm_code;
+          eval ${unset} msm_modes;
+          eval ${unset} msm_viewer;
+          eval ${unset} msm_viewers;
           eval "${return_ok}";
           ;;
         ascii|cp1047|latin1|utf8)
@@ -4242,20 +4336,20 @@
           then
             _DISPLAY_MODE='tty';
           fi;
-          unset msm_code;
-          unset msm_modes;
-          unset msm_viewer;
-          unset msm_viewers;
+          eval ${unset} msm_code;
+          eval ${unset} msm_modes;
+          eval ${unset} msm_viewer;
+          eval ${unset} msm_viewers;
           eval "${return_ok}";
           ;;
       esac;
       if obj DISPLAY is_empty;
       then
         _DISPLAY_MODE='tty';
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
       fi;
 
@@ -4268,18 +4362,18 @@
       ;;
     text)
       _DISPLAY_MODE='text';
-      unset msm_code;
-      unset msm_modes;
-      unset msm_viewer;
-      unset msm_viewers;
+      eval ${unset} msm_code;
+      eval ${unset} msm_modes;
+      eval ${unset} msm_viewer;
+      eval ${unset} msm_viewers;
       eval "${return_ok}";
       ;;
     tty)
       _DISPLAY_MODE='tty';
-      unset msm_code;
-      unset msm_modes;
-      unset msm_viewer;
-      unset msm_viewers;
+      eval ${unset} msm_code;
+      eval ${unset} msm_modes;
+      eval ${unset} msm_viewer;
+      eval ${unset} msm_viewers;
       eval "${return_ok}";
       ;;
     *)				# display mode was given
@@ -4302,18 +4396,18 @@
     case "$m" in
       text)
         _DISPLAY_MODE='text';
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       tty)
         _DISPLAY_MODE='tty';
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       x)
@@ -4330,10 +4424,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE='x';
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       dvi)
@@ -4350,10 +4444,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="dvi";
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       pdf)
@@ -4370,10 +4464,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="pdf";
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       ps)
@@ -4390,10 +4484,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="ps";
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
       html)
@@ -4410,18 +4504,18 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE=html;
-        unset msm_code;
-        unset msm_modes;
-        unset msm_viewer;
-        unset msm_viewers;
+        eval ${unset} msm_code;
+        eval ${unset} msm_modes;
+        eval ${unset} msm_viewer;
+        eval ${unset} msm_viewers;
         eval "${return_ok}";
         ;;
     esac;
   done;
-  unset msm_code;
-  unset msm_modes;
-  unset msm_viewer;
-  unset msm_viewers;
+  eval ${unset} msm_code;
+  eval ${unset} msm_modes;
+  eval ${unset} msm_viewer;
+  eval ${unset} msm_viewers;
   error "main_set_mode(): no suitable display mode found.";
 }
 
@@ -4451,21 +4545,23 @@
   fi;
   eval set x "$(list_from_split "$1" ',')";
   shift;
-  for i;
+  for i
   do
     _gfp_i="$i";
     if obj _gfp_i is_empty;
     then
       continue;
     fi;
-    if is_prog "$(get_first_essential $i)";
+    if eval is_prog "$(get_first_essential ${_gfp_i})";
     then
-      echo -n "${_gfp_i}";
-      unset _gfp_i;
+      cat <<EOF
+${_gfp_i}
+EOF
+      eval ${unset} _gfp_i;
       return "${_GOOD}";
     fi;
   done;
-  unset _gfp_i;
+  eval ${unset} _gfp_i;
   return "${_BAD}";
 } # main_set_mode()
 
@@ -4487,7 +4583,7 @@
   mdfa_exitcode="${_BAD}";
   eval set x "${_FILEARGS}";
   shift;
-  unset _FILEARGS;
+  eval ${unset} _FILEARGS;
   # temporary storage of all input to $_TMP_CAT
   while test "$#" -ge 2;
   do
@@ -4558,14 +4654,14 @@
   rm -f "${_TMP_STDIN}";
   if is_equal "${mdfa_exitcode}" "${_BAD}";
   then
-    unset mdfa_exitcode;
-    unset mdfa_filespec;
-    unset mdfa_name;
+    eval ${unset} mdfa_exitcode;
+    eval ${unset} mdfa_filespec;
+    eval ${unset} mdfa_name;
     eval "${return_bad}";
   fi;
-  unset mdfa_exitcode;
-  unset mdfa_filespec;
-  unset mdfa_name;
+  eval ${unset} mdfa_exitcode;
+  eval ${unset} mdfa_filespec;
+  eval ${unset} mdfa_name;
   eval "${return_ok}";
 } # main_do_fileargs()
 
@@ -4575,7 +4671,7 @@
 # main_set_resources ()
 #
 # Determine options for setting X resources with $_DISPLAY_PROG.
-# 
+#
 # Globals: $_DISPLAY_PROG, $_OUTPUT_FILE_NAME
 #
 # Variable prefix: msr
@@ -4588,17 +4684,17 @@
   msr_title="$(get_first_essential \
                  "${_OPT_TITLE}" "${_REGISTERED_TITLE}")";
   _OUTPUT_FILE_NAME='';
-  set x ${msr_title};
+  eval set x "${msr_title}";
   shift;
   until is_equal "$#" 0;
-  do 
+  do
     msr_n="$1";
     case "${msr_n}" in
     '')
       continue;
       ;;
     ,*)
-      msr_n="$(echo -n "$1" | sed -e 's/^,,*//')";
+      msr_n="$(echo x"$1" | sed -e 's/^x,,*//')";
       ;;
     esac
     if obj msr_n is_empty;
@@ -4607,7 +4703,7 @@
     fi;
     if obj _OUTPUT_FILE_NAME is_not_empty;
     then
-      _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME},";
+      _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}"',';
     fi;
     _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}${msr_n}";
     shift;
@@ -4625,14 +4721,14 @@
   if obj _DISPLAY_PROG is_empty;
   then				# for example, for groff mode
     _DISPLAY_ARGS='';
-    unset msr_n;
-    unset msr_prog;
-    unset msr_rl;
-    unset msr_title;
+    eval ${unset} msr_n;
+    eval ${unset} msr_prog;
+    eval ${unset} msr_rl;
+    eval ${unset} msr_title;
     eval "${return_ok}";
   fi;
 
-  set x ${_DISPLAY_PROG};
+  eval set x "${_DISPLAY_PROG}";
   shift;
   msr_prog="$(base_name "$1")";
   msr_rl='';
@@ -4746,7 +4842,7 @@
       ghostview|gv|gxditview|xditview|xdvi|xpdf)
         eval set x "${_OPT_XRM}";
         shift;
-        for i;
+        for i
         do
           list_append msr_rl '-xrm' "$i";
         done;
@@ -4761,11 +4857,11 @@
         ;;
     esac;
   fi;
-  _DISPLAY_ARGS="${msr_rl}"; 
-  unset msr_n;
-  unset msr_prog;
-  unset msr_rl;
-  unset msr_title;
+  _DISPLAY_ARGS="${msr_rl}";
+  eval ${unset} msr_n;
+  eval ${unset} msr_prog;
+  eval ${unset} msr_rl;
+  eval ${unset} msr_title;
   eval "${return_ok}";
 } # main_set_resources
 
@@ -4780,7 +4876,8 @@
 #   in: $_DISPLAY_MODE, $_OPT_DEVICE,
 #       $_ADDOPTS_GROFF, $_ADDOPTS_POST, $_ADDOPTS_X,
 #       $_REGISTERED_TITLE, $_TMP_CAT,
-#       $_OPT_PAGER $PAGER $_MANOPT_PAGER
+#       $_OPT_PAGER $PAGER, $_MANOPT_PAGER,
+#       $_OUTPUT_FILE_NAME
 #
 # Variable prefix: md
 #
@@ -4797,7 +4894,7 @@
     md_modefile="${_OUTPUT_FILE_NAME}";
   else
     clean_up;
-    unset md_modefile;
+    eval ${unset} md_modefile;
     eval "${return_ok}";
   fi;
   case "${_DISPLAY_MODE}" in
@@ -4810,7 +4907,7 @@
       md_groggy="$(tmp_cat | eval grog "${md_options}")";
       trap_clean;
       # start a new shell program to get another process ID.
-      sh -c '
+      /bin/sh -c '
         set -e;
         test -f "${md_modefile}" && rm -f "${md_modefile}";
         mv "${_TMP_CAT}" "${md_modefile}";
@@ -4820,11 +4917,11 @@
           {
             if test -d "${_TMP_DIR}";
             then
-              rm -f "${_TMP_DIR}"/* || true;
+              rm -f "${_TMP_DIR}"/* || :;
               rmdir "${_TMP_DIR}";
             fi;
           }
-          trap clean_up 0 2>${_NULL_DEV} || true;
+          trap clean_up 0 2>${_NULL_DEV} || :;
           eval "${md_groggy}" "${_ADDOPTS_GROFF}";
         ) &'
       ;;
@@ -4850,10 +4947,10 @@
       else
         md_pager='';
         for p in "${_OPT_PAGER}" "${PAGER}" "${_MANOPT_PAGER}" \
-                 'less -r -R' 'more' 'pager' 'cat';
+                 'less -r -R' 'more' 'pager' 'cat'
         do
           md_p="$p";
-          if is_prog ${md_p};
+          if eval is_prog ${md_p};
           then		      # no "" for is_prog() allows args for $p
             md_pager="${md_p}";
             break;
@@ -4868,6 +4965,10 @@
       fi;
       clean_up;
       ;;
+    source)
+      tmp_cat;
+      clean_up;
+      ;;
 
     #### viewer modes
 
@@ -4876,7 +4977,7 @@
         ''|dvi) do_nothing; ;;
         *)
           warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}"
           ;;
       esac;
       md_modefile="${md_modefile}".dvi;
@@ -4908,7 +5009,7 @@
       md_groggy="$(tmp_cat | grog -Tps)";
       trap_clean;
       # start a new shell program to get another process ID.
-      sh -c '
+      /bin/sh -c '
         set -e;
         _psfile="${md_modefile}.ps";
         md_modefile="${md_modefile}.pdf";
@@ -4925,11 +5026,11 @@
             rm -f "${md_modefile}";
             if test -d "${_TMP_DIR}";
             then
-              rm -f "${_TMP_DIR}"/* || true;
+              rm -f "${_TMP_DIR}"/* || :;
               rmdir "${_TMP_DIR}";
             fi;
           }
-          trap clean_up 0 2>${_NULL_DEV} || true;
+          trap clean_up 0 2>${_NULL_DEV} || :;
           eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
         ) &'
       ;;
@@ -4947,10 +5048,6 @@
       md_groggy="$(tmp_cat | grog -Tps)";
       _do_display;
       ;;
-    source)
-      tmp_cat;
-      clean_up;
-      ;;
     x)
       case "${_OPT_DEVICE}" in
         '')
@@ -4971,13 +5068,13 @@
       error "main_display(): unknown mode \`${_DISPLAY_MODE}'";
       ;;
   esac;
-  unset md_addopts;
-  unset md_device;
-  unset md_groggy;
-  unset md_modefile;
-  unset md_options;
-  unset md_p;
-  unset md_pager;
+  eval ${unset} md_addopts;
+  eval ${unset} md_device;
+  eval ${unset} md_groggy;
+  eval ${unset} md_modefile;
+  eval ${unset} md_options;
+  eval ${unset} md_p;
+  eval ${unset} md_pager;
   eval "${return_ok}";
 } # main_display()
 
@@ -4989,7 +5086,7 @@
   trap_clean;
   # start a new shell program for another process ID and better
   # cleaning-up of the temporary files.
-  sh -c '
+  /bin/sh -c '
     set -e;
     test -f "${md_modefile}" && rm -f "${md_modefile}";
     cat "${_TMP_CAT}" | \
@@ -4999,11 +5096,11 @@
       clean_up() {
         if test -d "${_TMP_DIR}";
         then
-          rm -f "${_TMP_DIR}"/* || true;
+          rm -f "${_TMP_DIR}"/* || :;
           rmdir "${_TMP_DIR}";
         fi;
       }
-      trap clean_up 0 2>${_NULL_DEV} || true;
+      trap clean_up 0 2>${_NULL_DEV} || :;
       eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
     ) &'
 }



From MAILER-DAEMON Sun Jul 03 08:34:28 2005
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Dp3g4-0005ar-0K
	for mharc-groff-commit@gnu.org; Sun, 03 Jul 2005 08:34:28 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Dp3g1-0005Zv-Ku
	for groff-commit@gnu.org; Sun, 03 Jul 2005 08:34:25 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Dp3ew-0005A0-5R
	for groff-commit@gnu.org; Sun, 03 Jul 2005 08:33:37 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Dp3eu-000566-0B
	for groff-commit@gnu.org; Sun, 03 Jul 2005 08:33:16 -0400
Received: from [199.232.41.3] (helo=savannah.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dp3WZ-0003Kk-SY
	for groff-commit@gnu.org; Sun, 03 Jul 2005 08:24:40 -0400
Received: from savannah.gnu.org ([127.0.0.1])
	by savannah.gnu.org with smtp (Exim 3.35 #1 (Debian))
	id 1Dp3R1-0003Od-00
	for <groff-commit@gnu.org>; Sun, 03 Jul 2005 08:18:55 -0400
To: groff-commit@gnu.org
From: Werner LEMBERG <wl@gnu.org>
Message-Id: <E1Dp3R1-0003Od-00@savannah.gnu.org>
Date: Sun, 03 Jul 2005 08:18:55 -0400
Subject: [Groff-commit] groff ./ChangeLog man/groff_out.man src/devices...
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: groff-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/groff-commit>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 03 Jul 2005 12:34:26 -0000

CVSROOT:	/cvsroot/groff
Module name:	groff
Branch: 	
Changes by:	Werner LEMBERG <wl@savannah.gnu.org>	05/07/03 12:18:55

Modified files:
	.              : ChangeLog 
	man            : groff_out.man 
	src/devices/xditview: gxditview.man 
	src/preproc/pic: troff.cpp 
	src/roff/groff : groff.man 

Log message:
	* src/devices/xditview/gxditview.man: Change many `.I' to `.B'.
	* man/groff_out.man: More markup and minor improvements.
	* src/roff/groff/groff.man: Minor improvements.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/ChangeLog.diff?tr1=1.841&tr2=1.842&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/man/groff_out.man.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/devices/xditview/gxditview.man.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/preproc/pic/troff.cpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/roff/groff/groff.man.diff?tr1=1.41&tr2=1.42&r1=text&r2=text

Patches:
Index: groff/ChangeLog
diff -u groff/ChangeLog:1.841 groff/ChangeLog:1.842
--- groff/ChangeLog:1.841	Tue Jun 28 16:19:21 2005
+++ groff/ChangeLog	Sun Jul  3 12:18:54 2005
@@ -1,3 +1,9 @@
+2005-07-02  Bernd Warken
+
+	* src/devices/xditview/gxditview.man: Change many `.I' to `.B'.
+	* man/groff_out.man: More markup and minor improvements.
+	* src/roff/groff/groff.man: Minor improvements.
+
 2005-06-28  Werner LEMBERG  <wl@gnu.org>
 
 	* ChangeLog: Split off older entries into...
Index: groff/man/groff_out.man
diff -u groff/man/groff_out.man:1.21 groff/man/groff_out.man:1.22
--- groff/man/groff_out.man:1.21	Sat Jul  3 12:46:58 2004
+++ groff/man/groff_out.man	Sun Jul  3 12:18:55 2005
@@ -3,11 +3,12 @@
 .ig
 groff_out.5
 
-Last update: 2 Jul 2004
+Last update: 2 Jul 2005
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 1989, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
 rewritten from scrach 2001 by Bernd Warken <bwarken@mayn.de>
 
 Permission is granted to copy, distribute and/or modify this document
@@ -255,18 +256,29 @@
 .SH DESCRIPTION
 .\" --------------------------------------------------------------------
 .
-This manual page describes the intermediate output format of the GNU
+This manual page describes the
+.I intermediate output
+format of the GNU
 .BR roff (@MAN7EXT@)
-text processing system.
+text processing system
+.BR groff (@MAN1EXT@).
 .
 This output is produced by a run of the GNU
-.BR troff (@MAN1EXT@)
-program before it is fed into a device postprocessor program.
+.BR @g@troff (@MAN1EXT@)
+program.
+.
+It contains already all device-specific information, but it is not yet
+fed into a device postprocessor program.
+.
 .
 .P
-As the GNU roff processor
+As the GNU
+.I roff
+processor
 .BR groff (@MAN1EXT@)
-is a wrapper program around troff that automatically calls a
+is a wrapper program around
+.B @g@troff
+that automatically calls a
 postprocessor, this output does not show up normally.
 .
 This is why it is called
@@ -279,15 +291,19 @@
 .B groff
 program provides the option
 .B -Z
-to inhibit postprocessing, such that the produced intermediate output
+to inhibit postprocessing, such that the produced
+.I intermediate output
 is sent to standard output just like calling
-.B troff
+.B @g@troff
 manually.
 .
+.
 .P
 In this document, the term
-.I troff output
-describes what is output by the GNU troff program, while
+.I @g@troff output
+describes what is output by the GNU
+.B @g@troff
+program, while
 .I intermediate output
 refers to the language that is accepted by the parser that prepares
 this output for the postprocessors.
@@ -295,14 +311,15 @@
 This parser is smarter on whitespace and implements obsolete elements
 for compatibility, otherwise both formats are the same.
 .
-The pre-groff roff versions are denoted as
-.I classical
-.IR troff .
+Both formats can be viewed directly with
+.BR \%gxditview (@MAN1EXT@).
+.
 .
 .P
-The main purpose of the intermediate output concept is to facilitate
-the development of postprocessors by providing a common programming
-interface for all devices.
+The main purpose of the
+.I intermediate output
+concept is to facilitate the development of postprocessors by
+providing a common programming interface for all devices.
 .
 It has a language of its own that is completely different from the
 .BR groff (@MAN7EXT@)
@@ -311,18 +328,28 @@
 While the
 .I groff
 language is a high-level programming language for text processing, the
-intermediate output language is a kind of low-level assembler language
-by specifying all positions on the page for writing and drawing.
+.I intermediate output
+language is a kind of low-level assembler language by specifying all
+positions on the page for writing and drawing.
+.
 .
 .P
-The intermediate output produced by
-.I groff
+The
+.RI pre- groff
+.I roff
+versions are denoted as
+.I classical
+.IR troff .
+The
+.I intermediate output
+produced by
+.B groff
 is fairly readable, while
 .I classical troff
 output was hard to understand because of strange habits that are
 still supported, but not used any longer by
 .I GNU
-.IR troff .
+.IR @g@troff .
 .
 .
 .\" --------------------------------------------------------------------
@@ -330,17 +357,23 @@
 .\" --------------------------------------------------------------------
 .
 During the run of
-.BR troff , 
-the roff input is cracked down to the information on what has to be
-printed at what position on the intended device.
+.BR @g@troff , 
+the
+.I roff
+input is cracked down to the information on what has to be printed at
+what position on the intended device.
 .
-So the language of the intermediate output format can be quite small.
+So the language of the
+.I intermediate output
+format can be quite small.
 .
 Its only elements are commands with or without arguments.
 .
-In this document, the term "command" always refers to the intermediate
-output language, never to the roff language used for document
-formatting.
+In this document, the term "command" always refers to the
+.I intermediate output
+language, never to the
+.I roff
+language used for document formatting.
 .
 There are commands for positioning and text writing, for drawing, and
 for device controlling.
@@ -354,11 +387,11 @@
 had strange requirements on whitespace.
 .
 The
-.I groff
+.B groff
 output parser, however, is smart about whitespace by making it
 maximally optional.
 .
-The whitespace characters, i.e.\& the
+The whitespace characters, i.e., the
 .IR tab ,
 .IR space ,
 and
@@ -368,14 +401,15 @@
 They are never printable because spacing within the output is always
 done by positioning commands.
 .
+.
 .P
 Any sequence of
 .I space
 or
 .I tab
 characters is treated as a single
-.B syntactical
-.BR space .
+.I syntactical
+.IR space .
 .
 It separates commands and arguments, but is only required when there
 would occur a clashing between the command code and the arguments
@@ -385,7 +419,10 @@
 arguments, argument lists, or command clusters meet.
 .
 Commands and arguments with a known, fixed length need not be
-separated by syntactical space.
+separated by
+.I syntactical
+.IR space .
+.
 .
 .P
 A line break is a syntactical element, too.
@@ -394,18 +431,22 @@
 newline character.
 .
 Thus a
-.B syntactical line break
-is defined to consist of optional syntactical space that is optionally
-followed by a comment, and a newline character.
+.I syntactical line break
+is defined to consist of optional
+.I syntactical space
+that is optionally followed by a comment, and a newline character.
+.
 .
 .P
 The normal commands, those for positioning and text, consist of a
 single letter taking a fixed number of arguments.
 .
 For historical reasons, the parser allows to stack such commands on
-the same line, but fortunately, in groff intermediate output, every
-command with at least one argument is followed by a line break, thus
-providing excellent readability.
+the same line, but fortunately, in
+.I groff intermediate
+.IR output ,
+every command with at least one argument is followed by a line break,
+thus providing excellent readability.
 .
 .P
 The other commands \[em] those for drawing and device controlling \[em]
@@ -424,10 +465,10 @@
 .RB ` x\ X '
 has an argument that can stretch over several lines, all other
 commands must have all of their arguments on the same line as the
-command, i.e.\& the arguments may not be splitted by a line break.
+command, i.e., the arguments may not be splitted by a line break.
 .
 .P
-Empty lines, i.e.\& lines containing only space and/or a comment, can
+Empty lines, i.e., lines containing only space and/or a comment, can
 occur everywhere.
 .
 They are just ignored.
@@ -442,7 +483,9 @@
 .I scale indicator
 is not written with the output command arguments; see
 .BR groff (@MAN7EXT@)
-and the groff info file for more on this topic.
+and the
+.I groff info file
+for more on this topic.
 .
 Most commands assume the scale indicator\~\c
 .unit u ,
@@ -460,6 +503,7 @@
 file; see
 .BR groff_font (@MAN5EXT@).
 .
+.
 .P
 Note that single characters can have the eighth bit set, as can the
 names of fonts and special characters.
@@ -468,6 +512,7 @@
 .
 A character that is to be printed will always be in the current font.
 .
+.
 .P
 A string argument is always terminated by the next whitespace
 character (space, tab, or newline); an embedded
@@ -483,8 +528,12 @@
 .\" --------------------------------------------------------------------
 .SS "Document Parts"
 .\" --------------------------------------------------------------------
-A correct intermediate output document consists of two parts, the
-prologue and the body.
+A correct
+.I intermediate output
+document consists of two parts, the
+.I prologue
+and the
+.IR body .
 .
 .P
 The task of the
@@ -509,8 +558,10 @@
 with the arguments set as outlined in the section
 .BR "Device Control Commands" .
 .
-But the parser for the intermediate output format is able to swallow
-additional whitespace and comments as well.
+But the parser for the
+.I intermediate output
+format is able to swallow additional whitespace and comments as well.
+.
 .
 .P
 The
@@ -518,15 +569,20 @@
 is the main section for processing the document data.
 .
 Syntactically, it is a sequence of any commands different from the
-ones used in the prologue.
+ones used in the
+.IR prologue .
 .
 Processing is terminated as soon as the first
 .B x\ stop
-command is encountered; the last line of any groff intermediate output
+command is encountered; the last line of any
+.I groff intermediate output
 always contains such a command.
 .
+.
 .P
-Semantically, the body is page oriented.
+Semantically, the
+.I body
+is page oriented.
 .
 A new page is started by a
 .BR p \~command.
@@ -547,8 +603,9 @@
 .SH "COMMAND REFERENCE"
 .\" --------------------------------------------------------------------
 .
-This section describes all intermediate output commands, the classical
-commands as well as the
+This section describes all
+.I intermediate output
+commands, the classical commands as well as the
 .I groff
 extensions.
 .
@@ -566,8 +623,9 @@
 character up to the next newline character.
 .
 .P
-This command is the only possibility for commenting in the intermediate
-output.
+This command is the only possibility for commenting in the
+.I intermediate
+.IR output .
 .
 Each comment can be preceded by arbitrary
 .I syntactical
@@ -595,9 +653,10 @@
 other simple commands or followed by arbitrary other commands on the
 same line.
 .
-A separating syntactical space is only necessary when two integer
-arguments would clash or if the preceding argument ends with a string
-argument.
+A separating
+.I syntactical space
+is only necessary when two integer arguments would clash or if the
+preceding argument ends with a string argument.
 .
 .
 .if (\n[@USE_ENV_STACK] == 1) \{\
@@ -622,11 +681,14 @@
 Print a special groff character named
 .argument xxx .
 .
-The trailing syntactical space or line break is necessary to allow
-character names of arbitrary length.
+The trailing
+.I syntactical space
+or
+.I line break
+is necessary to allow character names of arbitrary length.
 .
-The character is printed at the current print position;
-the character's size is read from the font file.
+The character is printed at the current print position; the
+character's size is read from the font file.
 .
 The print position is not changed.
 .
@@ -661,7 +723,7 @@
 .unit u
 horizontally to the right.
 .
-.I [54]
+.I [CSTR\~#54]
 allows negative values for
 .I n
 also, but
@@ -681,12 +743,16 @@
 The number of color components and their meaning vary for the
 different color schemes.
 .
-These commands are generated by the groff escape sequence
+These commands are generated by the
+.I groff
+escape sequence
 .BR \*[@backslash]m .
 .
 No position changing.
 .
-These commands are a groff extension.
+These commands are a
+.I groff
+extension.
 .
 .
 .RS
@@ -735,23 +801,31 @@
 .B N\~-193
 represents an unbreakable space which has a width of 193u.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .command n b\ a
 Inform the device about a line break, but no positioning is done by
 this command.
 .
-In classical troff, the integer arguments
+In
+.I classical
+.IR troff ,
+the integer arguments
 .argument b
 and\~\c
 .argument a
 informed about the space before and after the current line to
-make the intermediate output more human readable without performing
-any action.
+make the
+.I intermediate output
+more human readable without performing any action.
 .
-In groff, they are just ignored, but they must be provided for
-compatibility reasons.
+In
+.IR groff ,
+they are just ignored, but they must be provided for compatibility
+reasons.
 .
 .
 .command p n
@@ -778,9 +852,10 @@
 (this is unit\~\c
 .unit z
 in GNU
-.BR troff ).
+.BR @g@troff ).
 .
-Classical troff used the unit
+.I Classical troff
+used the unit
 .I points
 (\c
 .unit p )
@@ -790,7 +865,7 @@
 .
 .command t xxx \[la]white_space\[ra]
 .command+ t "xxx dummy_arg" \[la]white_space\[ra]
-Print a word, i.e.\& a sequence of characters
+Print a word, i.e., a sequence of characters
 .argument xxx
 terminated by a space character or a line break; an optional second
 integer argument is ignored (this allows the formatter to generate
@@ -808,7 +883,9 @@
 .B C
 command for named characters).
 .
-This command is a groff extension; it is only used for devices whose
+This command is a
+.I groff
+extension; it is only used for devices whose
 .I DESC
 file contains the
 .B tcommand
@@ -828,7 +905,9 @@
 (an integer in
 basic units\~\c
 .unit u ).
-This command is a groff extension; it is only used for devices whose
+This command is a
+.I groff
+extension; it is only used for devices whose
 .I DESC
 file contains the
 .B tcommand
@@ -853,7 +932,7 @@
 .RI ( n
 is a non-negative integer).
 .
-.I [54]
+.I [CSTR\~#54]
 allows negative values for
 .I n
 also, but
@@ -871,22 +950,28 @@
 .SS "Graphics Commands"
 .\" --------------------------------------------------------------------
 .
-Each graphics or drawing command in the intermediate output starts
-with the letter\~\c
+Each graphics or drawing command in the
+.I intermediate output
+starts with the letter\~\c
 .B D
 followed by one or two characters that specify a subcommand; this
 is followed by a fixed or variable number of integer arguments that
 are separated by a single space character.
 .
 A
-.BR D \ command
-may not be followed by another command on the same line
-(apart from a comment), so each
-.BR D \ command
-is terminated by a syntactical line break.
+.B D\c
+\~command
+may not be followed by another command on the same line (apart from a
+comment), so each
+.B D\c
+\~command
+is terminated by a
+.I syntactical line
+.IR break .
+.
 .
 .P
-.I troff
+.B @g@troff
 output follows the classical spacing rules (no space between command
 and subcommand, all arguments are preceded by a single space
 character), but the parser allows optional space between the command
@@ -894,6 +979,7 @@
 .
 As usual, each space can be any sequence of tab and space characters.
 .
+.
 .P
 Some graphics commands can take a variable number of arguments.
 .
@@ -912,6 +998,7 @@
 .
 All these distances are offsets relative to the current location.
 .
+.
 .P
 Unless indicated otherwise, each graphics command directly corresponds
 to a similar
@@ -920,12 +1007,16 @@
 escape sequence; see
 .BR groff (@MAN7EXT@).
 .
+.
 .P
-Unknown D\~commands are assumed to be device-specific.
+Unknown
+.B D\c
+\~commands are assumed to be device-specific.
 .
 Its arguments are parsed as strings; the whole information is then
 sent to the postprocessor.
 .
+.
 .P
 In the following command reference, the syntax element
 .I \[la]line_break\[ra]
@@ -942,8 +1033,8 @@
 .indexed_offset h 2 v 2
 if given, etc.\& up to
 .indexed_offset h n v n .
-This command takes a variable number of argument pairs;
-the current position is moved to the terminal point of the drawn curve.
+This command takes a variable number of argument pairs; the current
+position is moved to the terminal point of the drawn curve.
 .
 .
 .Da-command
@@ -967,7 +1058,9 @@
 An optional second integer argument is ignored (this allows to the
 formatter to generate an even number of arguments).
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .D-command c d
@@ -990,7 +1083,9 @@
 with the leftmost point at the current position; then move to the
 rightmost point of the ellipse.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .D-command e "h v"
@@ -1016,7 +1111,9 @@
 The number of color components and their meaning vary for the
 different color schemes.
 .
-These commands are generated by the groff escape sequences
+These commands are generated by the
+.I groff
+escape sequences
 .B \*[@backslash]D'F\ .\|.\|.'
 and
 .B \*[@backslash]M
@@ -1024,7 +1121,9 @@
 .
 No position changing.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .RS
@@ -1091,10 +1190,13 @@
 sets all colors to blue.
 .RE
 .
+.
 .P
 No position changing.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .RE
 .
@@ -1129,7 +1231,9 @@
 the position doesn't change.
 \}
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .D-multiarg P
@@ -1145,7 +1249,9 @@
 .el \
 No position changing.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .D-command t n
@@ -1175,7 +1281,9 @@
 .el \
 No position changing.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .\" --------------------------------------------------------------------
@@ -1185,8 +1293,11 @@
 Each device control command starts with the letter
 .B x
 followed by a space character (optional or arbitrary space/\:tab in
-groff) and a subcommand letter or word; each argument (if any) must be
-preceded by a syntactical space.
+.IR groff )
+and a subcommand letter or word; each argument (if any) must be
+preceded by a
+.I syntactical
+.IR space .
 .
 All
 .B x
@@ -1197,13 +1308,13 @@
 .
 .P
 The subcommand is basically a single letter, but to increase
-readability, it can be written as a word, i.e.\& an arbitrary sequence
+readability, it can be written as a word, i.e., an arbitrary sequence
 of characters terminated by the next tab, space, or newline character.
 .
 All characters of the subcommand word but the first are simply ignored.
 .
 For example,
-.I troff
+.B @g@troff
 outputs the initialization command
 .B x\ i
 as
@@ -1233,12 +1344,15 @@
 .argument name
 as the intended name for the current file in error reports.
 .
-This is useful for remembering the original file name when groff uses
-an internal piping mechanism.
+This is useful for remembering the original file name when
+.B groff
+uses an internal piping mechanism.
 .
 The input file is not changed by this command.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .x-command f "n\ s"
@@ -1259,8 +1373,8 @@
 (a positive integer in scaled points\~\c
 .unit z ).
 .
-Classical troff used the unit
-points (\c
+.I Classical troff
+used the unit points (\c
 .unit p )
 instead; see section
 .BR COMPATIBILITY .
@@ -1270,7 +1384,8 @@
 .xsub init
 Initialize device.
 .
-This is the third command of the prologue.
+This is the third command of the
+.IR prologue .
 .
 .
 .x-command p
@@ -1295,7 +1410,8 @@
 .unit u
 per inch.
 .
-This is the second command of the prologue.
+This is the second command of the
+.IR prologue .
 .
 .
 .x-command S n
@@ -1309,7 +1425,9 @@
 .x-command s
 .xsub stop
 Terminates the processing of the current file; issued as the last
-command of any intermediate troff output.
+command of any
+.I intermediate @g@troff
+.IR output .
 .
 .
 .x-command t
@@ -1317,7 +1435,7 @@
 Generate trailer information, if any.
 .
 In
-.IR groff ,
+.BR groff ,
 this is actually just ignored.
 .
 .
@@ -1331,7 +1449,8 @@
 .B -T
 option.
 .
-This is the first command of the prologue.
+This is the first command of the
+.IR prologue .
 .
 .
 .x-command u n
@@ -1348,10 +1467,12 @@
 This is needed for the
 .B cu
 request in
-.I nroff
+.B @g@nroff
 mode and is ignored otherwise.
 .
-This command is a groff extension.
+This command is a
+.I groff
+extension.
 .
 .
 .x-command X anything
@@ -1380,7 +1501,9 @@
 escape sequence
 .BR \*[@backslash]X .
 .
-The line-continuing feature is a groff extension.
+The line-continuing feature is a
+.I groff
+extension.
 .
 .
 .\" --------------------------------------------------------------------
@@ -1405,10 +1528,14 @@
 then print character\~\c
 .argument c .
 .
+.
 .RS
 .P
-In groff, arbitrary syntactical space around and within this command
-is allowed to be added.
+In
+.IR groff ,
+arbitrary
+.I syntactical space
+around and within this command is allowed to be added.
 .
 Only when a preceding command on the same line ends with an argument
 of variable length a separating space is obligatory.
@@ -1421,12 +1548,15 @@
 .
 .RE
 .
+.
 .P
 For modern high-resolution devices, this command does not make sense
 because the width of the characters can become much larger than two
 decimal digits.
 .
-In groff, this is only used for the devices
+In
+.BR groff ,
+this is only used for the devices
 .BR X75 ,
 .BR X75-12 ,
 .BR X100 ,
@@ -1448,7 +1578,8 @@
 The
 .I roff
 postprocessors are programs that have the task to translate the
-intermediate output into actions that are sent to a device.
+.I intermediate output
+into actions that are sent to a device.
 .
 A device can be some piece of hardware such as a printer, or a software
 file format suitable for graphical or text processing.
@@ -1458,9 +1589,10 @@
 system provides powerful means that make the programming of such
 postprocessors an easy task.
 .P
-There is a library function that parses the intermediate output and
-sends the information obtained to the device via methods of a class
-with a common interface for each device.
+There is a library function that parses the
+.I intermediate output
+and sends the information obtained to the device via methods of a
+class with a common interface for each device.
 .
 So a
 .I groff
@@ -1474,22 +1606,27 @@
 .SH "EXAMPLES"
 .\" --------------------------------------------------------------------
 .
-This section presents the intermediate output generated from the same
-input for three different devices.
+This section presents the
+.I intermediate output
+generated from the same input for three different devices.
 .
 The input is the sentence
 .I hell world
-fed into groff on the command line.
+fed into
+.B groff
+on the command line.
+.
 .
 .Topic
 High-resolution device
 .I ps
 .
-.RS
 .
+.RS
 .P
 .ShellCommand echo "hell world" | groff -Z -T ps
 .
+.
 .P
 .nf
 .ft CB
@@ -1515,6 +1652,7 @@
 .fi
 .RE
 .
+.
 .P
 This output can be fed into the postprocessor
 .BR grops (@MAN1EXT@)
@@ -1525,8 +1663,8 @@
 Low-resolution device
 .I latin1
 .
-.RS
 .
+.RS
 .P
 This is similar to the high-resolution device except that the
 positioning is done at a minor scale.
@@ -1536,9 +1674,11 @@
 were added for clarification; they were not generated by the
 formatter.
 .
+.
 .P
 .ShellCommand echo "hell world" | groff -Z -T latin1
 .
+.
 .P
 .nf
 .I "# prologue"
@@ -1579,6 +1719,7 @@
 .fi
 .RE
 .
+.
 .P
 This output can be fed into the postprocessor
 .BR grotty (@MAN1EXT@)
@@ -1588,16 +1729,20 @@
 .Topic
 Classical style output
 .
-.RS
 .
+.RS
 .P
 As a computer monitor has a very low resolution compared to modern
-printers the intermediate output for the X\~devices can use the
-jump-and-write command with its 2-digit displacements.
+printers the
+.I intermediate output
+for the X\~devices can use the jump-and-write command with its 2-digit
+displacements.
+.
 .
 .P
 .ShellCommand echo "hell world" | groff -Z -T X100
 .
+.
 .P
 .nf
 .ft CB
@@ -1621,6 +1766,7 @@
 .fi
 .RE
 .
+.
 .P
 This output can be fed into the postprocessor
 .BR \%xditview (1x)
@@ -1628,6 +1774,7 @@
 .BR \%gxditview (@MAN1EXT@)
 for displaying in\~X.
 .
+.
 .P
 Due to the obsolete jump-and-write command, the text clusters in the
 classical output are almost unreadable.
@@ -1637,41 +1784,55 @@
 .SH "COMPATIBILITY"
 .\" --------------------------------------------------------------------
 .
-The intermediate output language of the 
+The
+.I intermediate output
+language of the 
 .I classical troff
 was first documented in
-.IR [97] .
+.IR [CSTR\~#97] .
 .
 The
-.I groff
-intermediate output format is compatible with this specification
-except for the following features.
+.I groff intermediate output
+format is compatible with this specification except for the following
+features.
+.
+.
 .Topic
 The classical quasi device independence is not yet implemented.
 .
+.
 .Topic
 The old hardware was very different from what we use today.
 .
-So the groff devices are also fundamentally different from the ones in
-classical troff.
+So the
+.I groff
+devices are also fundamentally different from the ones in
+.I classical
+.IR troff .
 .
 For example, the classical PostScript device was called
 .I post
 and had a resolution of 720 units per inch,
-while groff's
+while
+.IR groff 's
 .I ps
 device has a resolution of 72000 units per inch.
 .
 Maybe, by implementing some rescaling mechanism similar to the
 classical quasi device independence, these could be integrated into
-modern groff.
+modern
+.IR groff .
+.
 .
 .Topic
 The B-spline command
 .B D~
-is correctly handled by the intermediate output parser, but the
-drawing routines aren't implemented in some of the postprocessor
-programs.
+is correctly handled by the
+.I intermediate output
+parser, but the drawing routines aren't implemented in some of the
+postprocessor programs.
+.
+.
 .Topic
 The argument of the commands
 .B s
@@ -1679,20 +1840,28 @@
 .B x H
 has the implicit unit scaled point\~\c
 .unit z
-in groff, while classical troff had point (\c
+in
+.IR groff ,
+while
+.I classical troff
+had point (\c
 .unit p ).
 .
-This isn't an incompatibility, but a compatible extension,
-for both units coincide for all devices without a
+This isn't an incompatibility, but a compatible extension, for both
+units coincide for all devices without a
 .I sizescale
-parameter, including all classical and the groff text devices.
+parameter, including all classical and the
+.I groff
+text devices.
 .
-The few groff devices with a sizescale parameter either did
-not exist, had a different name, or seem to have had a different
-resolution.
+The few
+.I groff
+devices with a sizescale parameter either did not exist, had a
+different name, or seem to have had a different resolution.
 .
 So conflicts with classical devices are very unlikely.
 .
+.
 .ie (\n[@STUPID_DRAWING_POSITIONING] == 1) \{\
 .Topic
 The position changing after the commands
@@ -1707,11 +1876,14 @@
 .Topic
 Temporarily, there existed some confusion on the positioning after the
 .B D
-commands that are groff extensions.
+commands that are
+.I groff
+extensions.
 .
 This has been clarified by establishing the classical rule for all
 groff drawing commands:
 .
+.
 .RS
 .P
 .ft I
@@ -1720,13 +1892,18 @@
 .ft
 .RE
 .
+.
 .P
 From this, the positionings specified for the drawing commands above
 follow quite naturally.
 .\}             \" @STUPID_DRAWING_POSITIONING
 .
 .P
-The differences between groff and classical troff are documented in
+The differences between
+.I groff
+and
+.I classical troff
+are documented in
 .BR groff_diff (@MAN7EXT@).
 .
 .
@@ -1741,7 +1918,9 @@
 .
 .TP
 .IB \[la]groff_source_dir\[ra] /src/libs/libdriver/input.cpp
-Defines the parser and postprocessor for the intermediate output.
+Defines the parser and postprocessor for the
+.I intermediate
+.IR output .
 .
 It is located relative to the top directory of the
 .I groff
@@ -1749,8 +1928,8 @@
 .IR @GROFFSRCDIR@ .
 .
 This parser is the definitive specification of the
-.I groff
-intermediate output format.
+.I groff intermediate output
+format.
 .
 .
 .\" --------------------------------------------------------------------
@@ -1760,7 +1939,7 @@
 A reference like
 .BR groff (@MAN7EXT@)
 refers to a manual page; here
-.I groff
+.B groff
 in section\~\c
 .I @MAN7EXT@
 of the man-page documentation system.
@@ -1768,46 +1947,62 @@
 To read the example, look up section\~@MAN7EXT@ in your desktop help
 system or call from the shell prompt
 .
+.
 .RS
 .P
 .ShellCommand man @MAN7EXT@ groff
 .RE
 .
+.
 .P
 For more details, see
 .BR man (1).
 .
+.
 .TP
 .BR groff (@MAN1EXT@)
 option
 .B -Z
 and further readings on groff.
 .
+.
 .TP
 .BR groff (@MAN7EXT@)
 for details of the
 .I groff
 language such as numerical units and escape sequences.
 .
+.
 .TP
 .BR groff_font (@MAN5EXT@)
 for details on the device scaling parameters of the
 .B DESC
 file.
 .
+.
 .TP
-.BR troff (@MAN1EXT@)
+.BR @g@troff (@MAN1EXT@)
 generates the device-independent intermediate output.
 .
+.
 .TP
 .BR roff (@MAN7EXT@)
 for historical aspects and the general structure of roff systems.
 .
+.
 .TP
 .BR groff_diff (@MAN7EXT@)
 The differences between the intermediate output in groff and classical
 troff.
 .
+.
+.TP
+.BR gxditview (@MAN1EXT@)
+Viewer for the
+.I intermediate
+.IR output .
+.
+.
 .P
 .BR \%grodvi (@MAN1EXT@),
 .BR \%grohtml (@MAN1EXT@),
@@ -1820,6 +2015,7 @@
 the groff postprocessor programs.
 .RE
 .
+.
 .P
 For a treatment of all aspects of the groff system within a single
 document, see the
@@ -1834,6 +2030,7 @@
 .ShellCommand info groff
 .RE
 .
+.
 .P
 The
 .I classical troff output language
@@ -1841,6 +2038,7 @@
 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr.html \
      "Bell Labs CSTR site" .
 .
+.
 .TP
 .I [CSTR #97]
 .I A Typesetter-independent TROFF
@@ -1850,6 +2048,7 @@
 see
 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:97.ps.gz CSTR\~#97 .
 .
+.
 .TP
 .I [CSTR\~#54]
 The 1992 revision of the
@@ -1860,8 +2059,7 @@
 .I Brian Kernighan
 isn't as concise as
 .I [CSTR\~#97]
-regarding the output language;
-see
+regarding the output language; see
 .URL http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz CSTR\~#54 .
 .
 .
@@ -1870,6 +2068,8 @@
 .\" --------------------------------------------------------------------
 .
 Copyright (C) 1989, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+.
+.
 .P
 This document is distributed under the terms of the FDL (GNU Free
 Documentation License) version 1.1 or later.
@@ -1878,19 +2078,21 @@
 available on-line at the
 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
 .
+.
 .P
 This document is part of
 .IR groff ,
-the GNU roff distribution.
+the GNU
+.I roff
+distribution.
 .
 It is based on a former version \- published under the GPL \- that
 described only parts of the
 .I groff
 extensions of the output language.
 .
-It has been rewritten 2002 by
-.MTO bwarken@mayn.de "Bernd Warken"
-and is maintained by
+It has been rewritten 2002 by \m[blue]Bernd Warken\m[] and is
+maintained by
 .MTO wl@gnu.org "Werner Lemberg" .
 .
 .cp \n[groff_out_C]
Index: groff/src/devices/xditview/gxditview.man
diff -u groff/src/devices/xditview/gxditview.man:1.5 groff/src/devices/xditview/gxditview.man:1.6
--- groff/src/devices/xditview/gxditview.man:1.5	Sun Jun 26 20:42:46 2005
+++ groff/src/devices/xditview/gxditview.man	Sun Jul  3 12:18:55 2005
@@ -14,7 +14,7 @@
 .
 .SH DESCRIPTION
 The
-.I \%gxditview 
+.B \%gxditview 
 program displays the
 .I groff intermediate
 .IR output ,
@@ -26,7 +26,7 @@
 server machine for font loading.
 .
 There are several ways to use
-.IR \%gxditview .
+.BR \%gxditview .
 .
 .
 .PP
@@ -35,13 +35,13 @@
 can be generated by
 .BR groff\~\-Z .
 This can be viewed by explicity calling
-.I \%gxditview
+.B \%gxditview
 .IR \%filename .
 If
 .I filename
 is
 .BR \- ,
-.I \%gxditview
+.B \%gxditview
 will read the standard input;
 .I \%filename
 cannot be omitted.
@@ -50,7 +50,7 @@
 .I groff intermediate output
 is different for all devices.
 .
-.I \%gxditview
+.B \%gxditview
 can view it for all devices, but the quality is not always good.
 .
 .
@@ -58,7 +58,7 @@
 The best result is achieved with the
 .BR X *
 devices for
-.IR groff 's
+.BR groff 's
 option
 .BR \-T .
 .
@@ -73,27 +73,26 @@
 size (10pt or 12pt).
 .
 They are especially built for
-.IR \%gxditview .
+.BR \%gxditview .
 When using one of them
-.I groff
+.B groff
 generates the
 .I intermediate output
 for this device and calls
-.I \%gxditview
+.B \%gxditview
 automatically for viewing.
 .
 .
 .PP
-.IR groff 's
+.BR groff 's
 option
 .B \-X
-should be considered obsolete today;
-it produces
+should be considered obsolete today; it produces
 .I intermediate output
 for
 .I Postscript
 and uses
-.I \%gxditview
+.B \%gxditview
 as a viewer for it, but with a bad quality.
 .
 Simply don't use it.
@@ -101,7 +100,7 @@
 .
 .PP
 During the run of
-.IR \%gxditview ,
+.BR \%gxditview ,
 the left mouse button brings up a menu with the following entries:
 .
 .TP 8
@@ -142,7 +141,7 @@
 .TP
 .B Quit
 Exit from
-.IR \%gxditview .
+.BR \%gxditview .
 .
 .
 .PP
@@ -186,12 +185,12 @@
 .B paperwidth
 commands in the DESC file specify the length and width in machine units
 of the virtual page displayed by
-.IR \%gxditview .
+.BR \%gxditview .
 .
 .
 .SH OPTIONS
 The
-.I \%gxditview
+.B \%gxditview
 program accepts all of the standard X\~Toolkit command line options
 along with the additional options listed below:
 .
@@ -256,7 +255,7 @@
 .PP
 The following standard X\~Toolkit command line arguments are commonly used
 with 
-.IR \%gxditview :
+.BR \%gxditview :
 .
 .TP 8
 .BI \-bg\  color
@@ -376,13 +375,13 @@
 .
 .SH ORIGIN
 This program is derived from
-.IR \%xditview ;
+.BR \%xditview ;
 portions of
-.I \%xditview
+.B \%xditview
 originated in
-.I \%xtroff
+.B \%xtroff
 which was derived from
-.IR \%suntroff .
+.BR \%suntroff .
 .
 .
 .SH COPYRIGHT
Index: groff/src/preproc/pic/troff.cpp
diff -u groff/src/preproc/pic/troff.cpp:1.5 groff/src/preproc/pic/troff.cpp:1.6
--- groff/src/preproc/pic/troff.cpp:1.5	Fri Jun 24 19:55:04 2005
+++ groff/src/preproc/pic/troff.cpp	Sun Jul  3 12:18:55 2005
@@ -498,7 +498,7 @@
     if (last_filled || last_outlined) {
       reset_color();
     }
-    // .bcolor and .fcolor emit a node in compatibility mode only,
+    // .gcolor and .fcolor emit a node in compatibility mode only,
     // but that won't work anyway
     if (color_fill) {
       printf(".fcolor %s\n", color_fill);
Index: groff/src/roff/groff/groff.man
diff -u groff/src/roff/groff/groff.man:1.41 groff/src/roff/groff/groff.man:1.42
--- groff/src/roff/groff/groff.man:1.41	Tue Feb  1 08:13:30 2005
+++ groff/src/roff/groff/groff.man	Sun Jul  3 12:18:55 2005
@@ -1,7 +1,7 @@
 .ig
 groff.man
 
-Last update: 01 Feb 2005
+Last update: 01 Jul 2005
 
 Copyright (C) 1989, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 Rewritten in 2002 by Bernd Warken <bwarken@mayn.de>
@@ -520,12 +520,21 @@
 .OptDef T "" dev
 Set output device to
 .IR dev .
-Contrary to
-.BR @g@troff ,
+For this device,
+.B @g@troff
+generates the
+.I intermediate
+.IR output ;
+see
+.BR \%groff_out (@MAN5EXT@).
+.
+Then
 .B groff
 calls a postprocessor to convert
 .BR @g@troff 's
-intermediate output to its final format.
+.I intermediate output
+to its final format.
+.
 Real devices in
 .B groff
 are
@@ -669,13 +678,19 @@
 .
 .
 .OptDef Z
-Do not postprocess the output of
-.B @g@troff
-that is normally
-called automatically by
-.BR groff .
-This will print the intermediate output to standard output; see
+Print the
+.I groff intermediate output
+to standard output; see
 .BR \%groff_out (@MAN5EXT@).
+Normally
+.BR groff
+calls automatically a postprocessor.
+.
+With this option, the output of
+.B @g@troff
+for the device, the so-called
+.I intermediate output
+is issued without postprocessing.
 .
 .
 .\" --------------------------------------------------------------------
@@ -1582,7 +1597,7 @@
 .MTO jjc@jclark.com "James Clark" .
 .
 It was rewritten, enhanced, and put under the FDL license by
-.MTO bwarken@mayn.de "Bernd Warken" .
+\m[blue]Bernd Warken\m[].
 .
 It is maintained by
 .MTO wl@gnu.org "Werner Lemberg" .
@@ -1662,7 +1677,9 @@
 .BR ditroff (@MAN7EXT@).
 .
 .TP
-The intermediate output language:
+The
+.I intermediate output
+language:
 .BR \%groff_out (@MAN7EXT@).
 .
 .TP



From MAILER-DAEMON Fri Jul 08 06:16:00 2005
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Dqptn-0006Pc-9Q
	for mharc-groff-commit@gnu.org; Fri, 08 Jul 2005 06:15:59 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1DqdH8-0007SV-5i
	for groff-commit@gnu.org; Thu, 07 Jul 2005 16:47:14 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1DqdH5-0007Rh-TQ
	for groff-commit@gnu.org; Thu, 07 Jul 2005 16:47:13 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1DqdBv-0005Rj-KW
	for groff-commit@gnu.org; Thu, 07 Jul 2005 16:41:51 -0400
Received: from [199.232.41.3] (helo=savannah.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dqch7-0003pR-RH
	for groff-commit@gnu.org; Thu, 07 Jul 2005 16:10:03 -0400
Received: from savannah.gnu.org ([127.0.0.1])
	by savannah.gnu.org with smtp (Exim 3.35 #1 (Debian))
	id 1DqcaY-0008JP-00
	for <groff-commit@gnu.org>; Thu, 07 Jul 2005 16:03:14 -0400
To: groff-commit@gnu.org
From: Werner LEMBERG <wl@gnu.org>
Message-Id: <E1DqcaY-0008JP-00@savannah.gnu.org>
Date: Thu, 07 Jul 2005 16:03:14 -0400
X-Mailman-Approved-At: Fri, 08 Jul 2005 06:15:55 -0400
Subject: [Groff-commit] groff/contrib/groffer ChangeLog README_SH groff...
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: groff-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/groff-commit>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2005 20:47:14 -0000

CVSROOT:	/cvsroot/groff
Module name:	groff
Branch: 	
Changes by:	Werner LEMBERG <wl@savannah.gnu.org>	05/07/07 20:03:14

Modified files:
	contrib/groffer: ChangeLog README_SH groffer.man groffer.sh 

Log message:
	* release of groffer 0.9.19
	
	* groffer.sh: extensions
	- `mode x': Mode for the equivalent options `--x', `--mode x',
	`--X' `--mode X', and the default mode.  The default assumes a
	resolution of 75 dpi.  The default device for a resolution of 75
	dpi is `X75-12', the default device for a resolution of 100 dpi is
	`X100'.  The default geometry for the resolution of 100 dpi is set
	to the width 800 dpi.
	- `mode X': New mode for option -X only.
	- `-V': Extent the `groff' output of -V by `groffer' specific
	information (in main_display()).
	- register_file(): Replace title `-' by `stdin'.
	- $_DEBUG_KEEP_FILES: If set to `yes' the files in the temporary
	directory are not deleted before the end trap.
	
	* groffer.sh: get `zsh' to work as well
	- tmp_create(): Use `: >file' for generating an empty file.
	- rmdir: Replace `rmdir' by `rm -f -r'.
	- eval: Add `eval' to many commands with variable arguments.
	
	* groffer.sh: repair `debug'
	- Print all debug output to stderr.
	- $_FUNC_STACK: Built function call stack even when $_DEBUG is not
	set.  Now the arguments are not added.
	- $_DEBUG: If set to `yes' print 3 call stack events: the function
	that is added with its arguments is printed with `+++ '
	(func_push()); the call stack after the addition is printed with
	`>>> ' (func_push()); the call stack after the removing is printed
	with `<<< ' (func_pop()).
	- error(): Always print the function call stack on errors.
	
	* groffer.sh: Corrections
	- $_groffer_run: Rename to $_GROFFER_RUN.
	- $unset: Rename to $_UNSET.
	- Repair test of `unset'.
	- Repair test for `--shell'.  The script is now rerun under the
	shell specified in the option argument.  This can increase the
	speed.
	
	* README_SH: `zsh' now works.
	
	* groffer.man:
	- Reformulate the information for the `groffer' specific details
	of option `-V'.
	- Add information on the debug process.
	- Add information on the default devices in `x mode'.
	- Minor corrections.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/ChangeLog.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/README_SH.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.man.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.sh.diff?tr1=1.29&tr2=1.30&r1=text&r2=text

Patches:
Index: groff/contrib/groffer/ChangeLog
diff -u groff/contrib/groffer/ChangeLog:1.29 groff/contrib/groffer/ChangeLog:1.30
--- groff/contrib/groffer/ChangeLog:1.29	Sat Jul  2 17:37:54 2005
+++ groff/contrib/groffer/ChangeLog	Thu Jul  7 20:03:12 2005
@@ -1,4 +1,56 @@
 	________________________________________________________________
+	* release of groffer 0.9.19
+
+2005-07-07  Bernd Warken
+
+	* groffer.sh: extensions
+	- `mode x': Mode for the equivalent options `--x', `--mode x',
+	`--X' `--mode X', and the default mode.  The default assumes a
+	resolution of 75 dpi.  The default device for a resolution of 75
+	dpi is `X75-12', the default device for a resolution of 100 dpi is
+	`X100'.  The default geometry for the resolution of 100 dpi is set
+	to the width 800 dpi.
+	- `mode X': New mode for option -X only.
+	- `-V': Extent the `groff' output of -V by `groffer' specific
+	information (in main_display()).
+	- register_file(): Replace title `-' by `stdin'.
+	- $_DEBUG_KEEP_FILES: If set to `yes' the files in the temporary
+	directory are not deleted before the end trap.
+
+	* groffer.sh: get `zsh' to work as well
+	- tmp_create(): Use `: >file' for generating an empty file.
+	- rmdir: Replace `rmdir' by `rm -f -r'.
+	- eval: Add `eval' to many commands with variable arguments.
+
+	* groffer.sh: repair `debug'
+	- Print all debug output to stderr.
+	- $_FUNC_STACK: Built function call stack even when $_DEBUG is not
+	set.  Now the arguments are not added.
+	- $_DEBUG: If set to `yes' print 3 call stack events: the function
+	that is added with its arguments is printed with `+++ '
+	(func_push()); the call stack after the addition is printed with
+	`>>> ' (func_push()); the call stack after the removing is printed
+	with `<<< ' (func_pop()).
+	- error(): Always print the function call stack on errors.
+
+	* groffer.sh: Corrections
+	- $_groffer_run: Rename to $_GROFFER_RUN.
+	- $unset: Rename to $_UNSET.
+	- Repair test of `unset'.
+	- Repair test for `--shell'.  The script is now rerun under the
+	shell specified in the option argument.  This can increase the
+	speed.
+
+	* README_SH: `zsh' now works.
+
+	* groffer.man:
+	- Reformulate the information for the `groffer' specific details
+	of option `-V'.
+	- Add information on the debug process.
+	- Add information on the default devices in `x mode'.
+	- Minor corrections.
+	
+	________________________________________________________________
 	* release of groffer 0.9.18
 
 2005-07-01  Bernd Warken
@@ -26,13 +78,13 @@
 	- _get_opt_shell(): Replace `for' loop with `shift' by `while'.
 	- man_search_section(): Replace `for f in filename*' by a test on
 	the existence of `filename*'.
-	- `zsh' interprets `$...' as `"$..."'.  So `eval' must be called;
+	- `zsh' interprets `$...'  as `"$..."'.  So `eval' must be called;
 	This cannot be used in `for i in $f', so it must be rewritten as
 	`for i in $(eval set x $f; shift; echo "$@")'
 
 	* groffer.sh:
 	- `--X', `--x', `--mode=X', `--mode=x': Make these options
-	equivalent to chosing an X device by setting `-TX75-12'.  `-X' is
+	equivalent to choosing an X device by setting `-TX75-12'.  `-X' is
 	still equivalent to `groff -X'.
 	- main_init(): Choose the name of the temporary file by adding a
 	number using `expr' if it exists and cannot be removed.
Index: groff/contrib/groffer/README_SH
diff -u groff/contrib/groffer/README_SH:1.8 groff/contrib/groffer/README_SH:1.9
--- groff/contrib/groffer/README_SH:1.8	Sat Jul  2 17:37:54 2005
+++ groff/contrib/groffer/README_SH	Thu Jul  7 20:03:13 2005
@@ -15,10 +15,18 @@
 name.  These quasi-local variables are unset before each return of the
 function.
 
+The `groffer' script was tested under the shells `ash', `bash',
+`dash', 'ksh', `pdksh', 'posh', and `zsh' without problems in Linux
+Debian.  A shell can be tested either by the `groffer' option
+`--shell' or by the command
+
+  <shell> groffer.sh <argument>...
+
+
 Some shells are not fully POSIX compatible.  For them the following
 restrictions were done.  For more information look at the
 documentation `Portable shells' in the `info' page of `autoconf'
-(look-up in Emacs-Help-Manuals).
+(look-up in Emacs-Help-Manuals_Info).
 
 - The command parts `then', `else', and `do' must be written each on a
   line of their own.
@@ -57,10 +65,6 @@
 
 - Do not redefine builtins as functions (ash).
 
-The `groffer' script was tested under the shells `ash', `bash',
-`dash', 'ksh', `pdksh', and 'posh' without problems in Linux Debian.
-`zsh' works, but produces a minor problem (in the modes dvi, pdf, ps,
-and X, an empty page is added as first page.)
 
 The script uses the following commands:
 .
@@ -258,7 +262,7 @@
 
 ####### License
 
-Last update: 1 July 2005
+Last update: 4 July 2005
 
 Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
 Written by Bernd Warken
Index: groff/contrib/groffer/groffer.man
diff -u groff/contrib/groffer/groffer.man:1.25 groff/contrib/groffer/groffer.man:1.26
--- groff/contrib/groffer/groffer.man:1.25	Sat Jul  2 17:37:54 2005
+++ groff/contrib/groffer/groffer.man	Thu Jul  7 20:03:13 2005
@@ -15,7 +15,7 @@
 Source file position:  <groff_source_top>/contrib/groffer/groffer.man
 Installed position:    $prefix/share/man/man1/groffer.1
 
-Last update : 29 June 2005
+Last update : 4 July 2005
 
 Source file position: <groff-source>/contrib/groffer/groffer.man
 ..
@@ -839,7 +839,7 @@
 .
 .
 .TP
-.I options from man
+.I options from GNU man
 .RS
 .P
 .Opt_[alt] -- all
@@ -1230,7 +1230,7 @@
 .
 .
 .TP
-.Header_CB X
+.Header_CB x
 Display the formatted input in a native
 .I roff
 viewer.
@@ -1242,20 +1242,39 @@
 But the standard X\~tool
 .BR \%xditview (1)
 can also be chosen with the option
-Opt_long x\-viewer .
-This mode chooses the
+.Opt_long x\-viewer .
+The default resolution is
+.BR 75\~dpi ,
+but
+.B 100\~dpi
+are also possible.
+.
+The default
 .I groff
 device
+for the resolution of
+.B 75\~dpi
+is
 .BR X75\-12 ,
-generates the corresponding
-.IR "groff intermediate output" ,
-and displays the result.
+for
+.B 100\~dpi
+it is
+.BR X100 .
+.
+The corresponding
+.I "groff intermediate output"
+for the actual device is generated and the result is displayed.
+.
+For a resolution of
+.BR 100\~dpi ,
+the default width of the geometry of the display program is chosen to
+.BR 850\~dpi .
 .
 .
 .TP
-.Header_CB x
+.Header_CB X
 Equivalent to
-.Opt_long_arg mode X .
+.Opt_long_arg mode x .
 .
 .
 .P
@@ -1354,12 +1373,12 @@
 .
 .Opt_def -- X -- x
 Equivalent to
-.Opt_long_arg mode X .
+.Opt_long_arg mode x .
 .
 .
 .Opt_def -- X\-viewer -- x\-viewer prog
 Set the viewer program for
-.IR \%X\~mode .
+.IR \%x\~mode .
 .
 Suitable viewer programs are
 .BR \%gxditview (@MAN1EXT@)
@@ -1405,9 +1424,12 @@
 .\" --------------------------------------------------------------------
 .
 .Opt_def -- debug
-Print debugging information for development only.
+Enable three debugging informations.
 .
-Actually, a function call stack is printed if an error occurs.
+A function call stack is printed at each opening and closing of a
+function call; a landmark information is printed to determine how far
+the program is running, and the early deletion of the temporary
+formatting files is prohibited.
 .
 .
 .Opt_def -- shell "shell_program"
@@ -1421,6 +1443,10 @@
 or as a command line option); if so, the script is rerun under the
 shell program specified with the option argument.
 .
+If you want to add this option in a configuration file you must do
+this under a line starting with a minus sign `\-', such as the line
+.Opt_long shell=\fIname\fP .
+.
 .
 .Opt_def - Q -- source
 Output the roff source code of the input files without further
@@ -1434,10 +1460,9 @@
 Other useful debugging options are the
 .B \%groff
 options
-.Opt_short V
+.Opt_short V ,
+.Opt_short Z ,
 and
-.Opt_short Z
-and option
 .Opt_long_arg mode groff .
 .
 .
@@ -1538,7 +1563,7 @@
 All
 .B \%X*
 arguments are mapped to
-.IR \%mode\~X .
+.IR \%mode\~x .
 Each other
 .I \%devname
 argument switches to
@@ -1547,15 +1572,14 @@
 .
 .
 .Opt_def - V
-Switch into
-.I \%groff\~mode
-and show only the
-.I \%groff
-calling pipe without formatting the input.
+Instead of displaying the formatted input,
+.I \%groffer
+specific information is printed: the output file name , the display
+mode, the display program, and the pipeline that would be run by the
+.B \%groff
+program, but without executing it.
 .
-This is an advanced option from
-.BR \%groff (@MAN1EXT@) ,
-only useful for debugging.
+This is an advanced option for debugging only.
 .
 .
 .Opt_def - X
@@ -1568,7 +1592,7 @@
 As the quality is relatively bad this option is deprecated; use
 .Opt_long X
 instead because the
-.I X mode
+.I \%x\~mode
 uses an
 .IR X *
 device for a better display.
@@ -1712,7 +1736,9 @@
 Actually, the default resolution for
 .B \%groffer
 is set to
-.BR 75 .
+.BR 75\~dpi .
+The resolution also sets the default device in
+.IR "mode x" .
 .
 .
 .Opt_def -- rv
@@ -1737,7 +1763,7 @@
 .BR man .
 .
 All long options of GNU
-.I man
+.B man
 are recognized, but not all of these options are important to
 .BR \%groffer ,
 so most of them are just ignored.
@@ -1887,12 +1913,6 @@
 .Opt_long location .
 .
 .
-.P
-Additionally, the following short option of
-.B \%man
-is supported as well.
-.
-.
 .\" --------------------------------------------------------------------
 .SS "Filespec Arguments"
 .\" --------------------------------------------------------------------
@@ -2112,8 +2132,8 @@
 .
 .
 .P
-Several different modes are offered, graphical
-.IR \%X\~modes ,
+Several different modes are offered, graphical modes for
+.IR \%X\~Window ,
 .IR \%text\~modes ,
 and some direct
 .I \%groff\~modes
@@ -2177,9 +2197,7 @@
 or
 .BR \%xditview (1)
 (in
-.I x
-or
-.IR \%X\~mode ),
+.IR \%x\~mode ),
 .
 .Topic
 in a Postscript viewer
@@ -2897,12 +2915,15 @@
 .
 Arbitrary spaces are allowed at the beginning, they are just ignored.
 .
-The lines with the beginning minus are appended to the existing value
-of $GROFFER_OPT.
+The lines with the beginning minus can be all
+.B groffer
+options; they are appended to the existing value
+of
+.Env_var $GROFFER_OPT .
 .
 This easily allows to set general
 .B \%groffer
-options that are used with any call of
+options that should be used with any call of
 .BR \%groffer .
 .
 .
@@ -2927,6 +2948,13 @@
 The reason is that its argument must be retrieved at a very early
 stage of
 .BR \%groffer .
+So to specify a shell to rerun the
+.B groffer
+script enter a line
+.Opt_long shell=\fIname\fP
+in a configuration file.
+.
+Some shells run faster.
 .
 .
 .P
@@ -2967,10 +2995,10 @@
 # groffer configuration file
 #
 # groffer options that are used in each call of groffer
-\-\-shell=/bin/bash
-\-\-resolution=100
+\-\-shell=ash
 \-\-foreground=DarkBlue
-\-\-x\-viewer='gxditview \-geometry 850x800'
+\-\-resolution=100
+\-\-x\-viewer='gxditview \-geometry 900x1200'
 #
 # some shell commands
 if test "$DISPLAY" = ""; then
@@ -2983,6 +3011,10 @@
 .
 .
 .P
+The lines starting with
+.B #
+are command lines.
+.
 This configuration sets four
 .B \%groffer
 options (the lines starting with `\-') and runs two shell commands (the
@@ -2993,34 +3025,43 @@
 .
 .Topic
 Use
-.B /bin/bash
+.B ash
 as the shell to run the
 .B \%groffer
-script.
+script; if it works it should be faster than the usual
+.BR sh .
 .
 .
 .Topic
-Use a resolution of
-.B 100\~dpi
-in all viewers that support this.
+Use a text color of
+.B \%DarkBlue
+in all viewers that support this, such as
+.BR \%gxditview .
 .
 .
 .Topic
-Use a text color of
-.B \%DarkBlue
-in all viewers that support this.
+Use a resolution of
+.B 100\~dpi
+in all viewers that support this, such as
+.BR \%gxditview .
+.
+By this, the default device in
+.I x mode
+is set to
+.BR X100 .
 .
 .
 .Topic
 Force
 .BR \%gxditview (@MAN1EXT@)
 as the
-.I \%X-mode
+.I \%x-mode
 viewer using the geometry option for setting the width to
-.B 850\~dpi
+.B 900\~dpi
 and the height to
-.B 800\~\c
-.BR dpi .
+.BR 1200\~dpi .
+This geometry is suitable for a resolution of
+.BR 100\~dpi .
 .
 .
 .Topic
@@ -3450,7 +3491,7 @@
 .TP+
 .BR \%gs (1)
 Viewers for
-.IR \%groffer 's
+.BR \%groffer 's
 .IR \%ps\~mode .
 .
 .
@@ -3465,7 +3506,7 @@
 .TP+
 .BR \%kpdf (1)
 Viewers for
-.IR \%groffer 's
+.BR \%groffer 's
 .IR \%pdf\~mode .
 .
 .
Index: groff/contrib/groffer/groffer.sh
diff -u groff/contrib/groffer/groffer.sh:1.29 groff/contrib/groffer/groffer.sh:1.30
--- groff/contrib/groffer/groffer.sh:1.29	Sat Jul  2 17:37:54 2005
+++ groff/contrib/groffer/groffer.sh	Thu Jul  7 20:03:13 2005
@@ -8,7 +8,7 @@
 # Inc.
 # Written by Bernd Warken
 
-# This file is part of groff version @VERSION@.
+# This file is part of groff version @VERSION@ (eventually 1.19.2).
 
 # groff is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -26,22 +26,21 @@
 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
 
 _PROGRAM_NAME='groffer';
-_PROGRAM_VERSION='0.9.18';
-_LAST_UPDATE='1 July 2005';
+_PROGRAM_VERSION='0.9.19';
+_LAST_UPDATE='7 July 2005';
 
-# This script is part of groff 1.19.2.
 
 ########################################################################
 # Determine the shell under which to run this script from the command
 # line arguments or $GROFF_OPT; if none is specified, just go on with
 # the starting shell.
 
-if test _"${_groffer_run}"_ = __;
+if test _"${_GROFFER_RUN}"_ = __;
 then
   # only reached during the first run of the script
 
-  export _groffer_run;		# counter for the runs of groffer
-  _groffer_run='first';
+  export _GROFFER_RUN;		# counter for the runs of groffer
+  _GROFFER_RUN='first';
 
   export _PROGRAM_NAME;
   export _PROGRAM_VERSION;
@@ -75,11 +74,17 @@
 
 
   # test of `unset'
+  export _UNSET;
+  export _foo;
   _foo=bar;
-  if unset _foo >${_NULL_DEV} 2>&1; then
-    unset='unset';
+  _res="$(unset _foo 2>&1)";
+  if unset _foo >${_NULL_DEV} 2>&1 && \
+     test _"${_res}"_ = __ && test _"${_foo}"_ = __
+  then
+    _UNSET='unset';
+    eval "${_UNSET}" _res;
   else
-    unset=':';
+    _UNSET=':';
   fi;
 
 
@@ -89,7 +94,7 @@
   # Determine whether `--shell' was specified in $GROFF_OPT or in $*;
   # if so, echo its argument.
   #
-  # Variable prefix: _gos
+  # Output: the shell name if it was specified
   #
   _get_opt_shell()
   {
@@ -98,20 +103,20 @@
         (
           eval set x "${GROFFER_OPT}" '"$@"';
           shift;
-          _gos_sh='';
+          _sh='';
           while test $# != 0
           do
             case "$1" in
               --shell)
                 if test "$#" -ge 2;
                 then
-                  _gos_sh="$2";
+                  _sh="$2";
                   shift;
                 fi;
                 ;;
               --shell=?*)
                 # delete up to first `=' character
-                _gos_sh="$(echo x"$1" | sed -e '
+                _sh="$(echo x"$1" | sed -e '
 s/^x//
 s/^[^=]*=//
 ')";
@@ -120,12 +125,11 @@
             shift;
           done;
           cat <<EOF
-${_gos_sh}
+${_sh}
 EOF
         )
         ;;
     esac;
-    eval ${unset} _gos_sh;
   }
 
 
@@ -141,7 +145,7 @@
       return 1;
     fi;
     # do not quote $1 to allow arguments
-    test _"$(eval $1 -c 's=ok; echo "$s"' 2>${_NULL_DEV})"_ = _ok_;
+    test _"$(eval $1 -c "'"'s=ok; echo $s'"'" 2>${_NULL_DEV})"_ = _ok_;
   }
 
 
@@ -165,32 +169,32 @@
         done;
       fi;
     done;
-    eval ${unset} f;
-    eval ${unset} s;
-    eval ${unset} _all;
+    eval ${_UNSET} f;
+    eval ${_UNSET} s;
+    eval ${_UNSET} _all;
   fi;
 
   # restart the script with the last found $_shell, if it is a shell
   if _test_on_shell "${_shell}";
   then
-    _groffer_run='second';
+    _GROFFER_RUN='second';
     # do not quote $_shell to allow arguments
-    exec ${_shell} "${_GROFFER_SH}" "$@";
+    eval exec ${_shell} "'${_GROFFER_SH}'" '"$@"';
     exit;
   fi;
 
-  _groffer_run='second';
-  eval ${unset} _shell;
+  _GROFFER_RUN='second';
+  eval ${_UNSET} _shell;
 
 fi; # end of first run
 
-if test _"${_groffer_run}"_ != _second_;
+if test _"${_GROFFER_RUN}"_ != _second_;
 then
-  echo "$_groffer_run should be 'second' here." >&2
+  echo "$_GROFFER_RUN should be 'second' here." >&2
   exit 1
 fi;
 
-eval ${unset} _groffer_run
+eval ${_UNSET} _GROFFER_RUN
 
 
 ########################################################################
@@ -204,6 +208,19 @@
 _DEBUG_LM='no';			# disable landmark messages
 #_DEBUG_LM='yes';		# enable landmark messages
 
+export _DEBUG_KEEP_FILES;
+_DEBUG_KEEP_FILES='no'		# disable file keeping in temporary dir
+_DEBUG_KEEP_FILES='yes'		# enable file keeping in temporary dir
+
+# test of $* on --debug
+case " $* " in
+*' --debug '*)
+  _DEBUG='yes';
+  _DEBUG_LM='yes';
+  _DEBUG_KEEP_FILES='yes';
+  ;;
+esac;
+
 
 ########################################################################
 #                       Environment Variables
@@ -486,7 +503,7 @@
 export _OPT_SECTIONS;		# sections for man page search
 export _OPT_SYSTEMS;		# man pages of different OS's
 export _OPT_TITLE;		# title for gxditview window
-export _OPT_TEXT_DEVICE;		# set device for tty mode.
+export _OPT_TEXT_DEVICE;	# set device for tty mode.
 export _OPT_V;			# groff option -V.
 export _OPT_VIEWER_DVI;		# viewer program for dvi mode
 export _OPT_VIEWER_PDF;		# viewer program for pdf mode
@@ -657,6 +674,21 @@
 
 
 ##############
+# echo2 (<text>*)
+#
+# Output to stderr.
+#
+# Arguments : arbitrary text.
+#
+echo2()
+{
+  cat >&2 <<EOF
+$*
+EOF
+}
+
+
+##############
 # landmark (<text>)
 #
 # Print <text> to standard error as a debugging aid.
@@ -667,7 +699,7 @@
 {
   if test _"${_DEBUG_LM}"_ = _yes_;
   then
-    echo ">>> $*" >&2;
+    echo2 "LM: $*" >&2;
   fi;
 }
 
@@ -683,26 +715,11 @@
 {
   if test -d "${_TMP_DIR}";
   then
-    rm -f -r "${_TMP_DIR}";
+    eval rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
   fi;
 }
 
 
-##############
-# echo2 (<text>*)
-#
-# Output to stderr.
-#
-# Arguments : arbitrary text.
-#
-echo2()
-{
-  cat >&2 <<EOF
-$*
-EOF
-}
-
-
 #############
 # diag (text>*)
 #
@@ -733,15 +750,12 @@
       ;;
     *) echo2 'groffer error: wrong number of arguments in error().'; ;;
   esac;
-  if test _"${_DEBUG}"_ = _yes_;
-  then
-    func_stack_dump;
-  fi;
+  func_stack_dump;
   clean_up;
   kill "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
   kill -9 "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
   n="${err_code}";
-  eval ${unset} err_code;
+  eval ${_UNSET} err_code;
   exit "$n";
 }
 
@@ -831,15 +845,17 @@
     error "func_check(): \
 ${fc_fname}"'() needs '"${fc_comp} ${fc_nargs}"' argument'"${fc_s}"'.';
   fi;
+  func_push "${fc_fname}";
   if test _"${_DEBUG}"_ = _yes_;
   then
-    func_push "${fc_fname} $*";
+    echo2 '+++ '"${fc_fname} $@";
+    echo2 '>>> '"${_FUNC_STACK}";
   fi;
-  eval ${unset} fc_comp;
-  eval ${unset} fc_fname;
-  eval ${unset} fc_nargs;
-  eval ${unset} fc_op;
-  eval ${unset} fc_s;
+  eval ${_UNSET} fc_comp;
+  eval ${_UNSET} fc_fname;
+  eval ${_UNSET} fc_nargs;
+  eval ${_UNSET} fc_op;
+  eval ${_UNSET} fc_s;
 }
 
 
@@ -856,27 +872,31 @@
 #
 func_pop()
 {
-  if test _"${_DEBUG}"_ = _yes_;
+  if test "$#" -ne 0;
   then
-    if test "$#" -ne 0;
+    error 'func_pop() does not have arguments.';
+  fi;
+  case "${_FUNC_STACK}" in
+  '')
+    if test _"${_DEBUG}"_ = _yes_;
     then
-      error 'func_pop() does not have arguments.';
+      error 'func_pop(): stack is empty.';
     fi;
-    case "${_FUNC_STACK}" in
-      '')
-        error 'func_pop(): stack is empty.';
-        ;;
-      *!*)
-        # split at first bang `!'.
-        _FUNC_STACK="$(echo x"${_FUNC_STACK}" | sed -e '
+    ;;
+  *!*)
+    # split at first bang `!'.
+   _FUNC_STACK="$(echo x"${_FUNC_STACK}" | sed -e '
 s/^x//
 s/^[^!]*!//
 ')";
-        ;;
-      *)
-        _FUNC_STACK='';
-        ;;
-    esac;
+    ;;
+  *)
+    _FUNC_STACK='';
+    ;;
+  esac;
+  if test _"${_DEBUG}"_ = _yes_;
+  then
+    echo2 '<<< '"${_FUNC_STACK}";
   fi;
 }
 
@@ -895,32 +915,29 @@
 #
 func_push()
 {
-  if test _"${_DEBUG}"_ = _yes_;
+  if test "$#" -ne 1;
   then
-    if test "$#" -ne 1;
-    then
-      error 'func_push() needs 1 argument.';
-    fi;
-    case "$1" in
-      *'!'*)
-        # remove all bangs `!'.
-        fp_element="$(echo x"$1" | sed -e '
+    error 'func_push() needs 1 argument.';
+  fi;
+  case "$1" in
+  *'!'*)
+    # remove all bangs `!'.
+    fp_element="$(echo x"$1" | sed -e '
 s/^x//
 s/!//g
 ')";
-        ;;
-      *)
-        fp_element="$1";
-        ;;
-    esac;
-    if test _"${_FUNC_STACK}"_ = __;
-    then
-      _FUNC_STACK="${fp_element}";
-    else
-      _FUNC_STACK="${fp_element}!${_FUNC_STACK}";
-    fi;
+    ;;
+  *)
+    fp_element="$1";
+    ;;
+  esac;
+  if test _"${_FUNC_STACK}"_ = __;
+  then
+    _FUNC_STACK="${fp_element}";
+  else
+    _FUNC_STACK="${fp_element}!${_FUNC_STACK}";
   fi;
-  eval ${unset} fp_element;
+  eval ${_UNSET} fp_element;
 }
 
 
@@ -931,28 +948,7 @@
 #
 func_stack_dump()
 {
-  diag 'call stack:';
-  case "${_FUNC_STACK}" in
-    *!*)
-      _rest="${_FUNC_STACK}";
-      while test _"${_rest}"_ != __;
-      do
-        # get part before the first bang `!'.
-        diag "$(echo x"${_rest}" | sed -e '
-s/^x//
-s/!.*$//
-')";
-        # delete part before and including the first bang `!'.
-        _rest="$(echo x"${_rest}" | sed -e '
-s/^x//
-s/^[^!]*!//
-')";
-      done;
-      ;;
-    *)
-      diag "${_FUNC_STACK}";
-      ;;
-  esac;
+  diag 'call stack: '"${_FUNC_STACK}";
 }
 
 
@@ -1037,6 +1033,7 @@
   then
     man -k "$1";
   fi;
+  eval "${return_ok}";
 }
 
 
@@ -1067,7 +1064,7 @@
   esac;
   case "${bn_name}" in
     /|'')
-      eval ${unset} bn_name;
+      eval ${_UNSET} bn_name;
       eval "${return_bad}";
       ;;
     */*)
@@ -1083,7 +1080,7 @@
 EOF
       ;;
   esac;
-  eval ${unset} bn_name;
+  eval ${_UNSET} bn_name;
   eval "${return_ok}";
 }
 
@@ -1210,7 +1207,7 @@
 EOF
   ;;
   esac;
-  eval ${unset} dc_res;
+  eval ${_UNSET} dc_res;
   eval "${return_ok}";
 }
 
@@ -1245,12 +1242,12 @@
   # store sequence into positional parameters
   case "${df_filespec}" in
     '')
-       eval ${unset} df_filespec;
+       eval ${_UNSET} df_filespec;
        eval "${return_good}";
        ;;
     '-')
       register_file '-';
-      eval ${unset} df_filespec;
+      eval ${_UNSET} df_filespec;
       eval "${return_good}";
       ;;
     */*)			# with directory part; so no man search
@@ -1279,11 +1276,11 @@
           if test -r "${df_filespec}";
           then
             register_file "${df_filespec}";
-            eval ${unset} df_filespec;
+            eval ${_UNSET} df_filespec;
             eval "${return_good}";
           else
 	    echo2 "could not read \`${df_filespec}'";
-            eval ${unset} df_filespec;
+            eval ${_UNSET} df_filespec;
             eval "${return_bad}";
           fi;
         else
@@ -1297,7 +1294,7 @@
         fi;
         if man_do_filespec "${df_filespec}";
         then
-          eval ${unset} df_filespec;
+          eval ${_UNSET} df_filespec;
           eval "${return_good}";
         else
           continue;
@@ -1305,7 +1302,7 @@
         ;;
     esac;
   done;
-  eval ${unset} df_filespec;
+  eval ${_UNSET} df_filespec;
   eval "${return_bad}";
 } # do_filearg()
 
@@ -1317,7 +1314,7 @@
 #
 do_nothing()
 {
-  return "${_OK}";
+  eval return "${_OK}";
 }
 
 
@@ -1399,11 +1396,11 @@
       cat <<EOF
 ${gfe_var}
 EOF
-      eval ${unset} gfe_var;
+      eval ${_UNSET} gfe_var;
       eval "${return_ok}";
     fi;
   done;
-  eval ${unset} gfe_var;
+  eval ${_UNSET} gfe_var;
   eval "${return_bad}";
 }
 
@@ -1803,10 +1800,10 @@
     fi;
   done;
   eval "${la_name}"='"${la_list}"';
-  eval ${unset} la_element;
-  eval ${unset} la_list;
-  eval ${unset} la_name;
-  eval ${unset} la_s;
+  eval ${_UNSET} la_element;
+  eval ${_UNSET} la_list;
+  eval ${_UNSET} la_name;
+  eval ${_UNSET} la_s;
   eval "${return_ok}";
 }
 
@@ -1881,13 +1878,13 @@
     cat <<EOF
 --
 EOF
-    eval ${unset} lfc_fparams;
-    eval ${unset} lfc_fn;
-    eval ${unset} lfc_short_a;
-    eval ${unset} lfc_short_n;
-    eval ${unset} lfc_long_a;
-    eval ${unset} lfc_long_n;
-    eval ${unset} lfc_result;
+    eval ${_UNSET} lfc_fparams;
+    eval ${_UNSET} lfc_fn;
+    eval ${_UNSET} lfc_short_a;
+    eval ${_UNSET} lfc_short_n;
+    eval ${_UNSET} lfc_long_a;
+    eval ${_UNSET} lfc_long_n;
+    eval ${_UNSET} lfc_result;
     eval "${return_ok}";
   fi;
   lfc_fparams='';
@@ -2000,19 +1997,19 @@
   cat <<EOF
 ${lfc_result}
 EOF
-  eval ${unset} lfc_fparams;
-  eval ${unset} lfc_fn;
-  eval ${unset} lfc_short_a;
-  eval ${unset} lfc_short_n;
-  eval ${unset} lfc_long_a;
-  eval ${unset} lfc_long_n;
-  eval ${unset} lfc_result;
-  eval ${unset} lfc_arg;
-  eval ${unset} lfc_opt;
-  eval ${unset} lfc_opt_arg;
-  eval ${unset} lfc_opt_char;
-  eval ${unset} lfc_lopt;
-  eval ${unset} lfc_rest;
+  eval ${_UNSET} lfc_fparams;
+  eval ${_UNSET} lfc_fn;
+  eval ${_UNSET} lfc_short_a;
+  eval ${_UNSET} lfc_short_n;
+  eval ${_UNSET} lfc_long_a;
+  eval ${_UNSET} lfc_long_n;
+  eval ${_UNSET} lfc_result;
+  eval ${_UNSET} lfc_arg;
+  eval ${_UNSET} lfc_opt;
+  eval ${_UNSET} lfc_opt_arg;
+  eval ${_UNSET} lfc_opt_char;
+  eval ${_UNSET} lfc_lopt;
+  eval ${_UNSET} lfc_rest;
   eval "${return_ok}";
 } # list_from_cmdline()
 
@@ -2057,7 +2054,7 @@
       error 'list_from_split(): separator must be a single character.';
       ;;
   esac;
-  eval ${unset} lfs_s;
+  eval ${_UNSET} lfs_s;
   eval "${return_ok}";
 }
 
@@ -2093,21 +2090,21 @@
 ')";
   case "${lg_list}" in
   '')
-    eval ${unset} lg_list;
+    eval ${_UNSET} lg_list;
     eval "${return_ok}";
     ;;
   \'*\')
     cat <<EOF
 ${lg_list}
 EOF
-    eval ${unset} lg_list;
+    eval ${_UNSET} lg_list;
     eval "${return_ok}";
     ;;
   *)
     error "list_get(): bad list: $1"
     ;;
   esac;
-  eval ${unset} lg_list;
+  eval ${_UNSET} lg_list;
   eval "${return_ok}";
 }
 
@@ -2217,10 +2214,10 @@
   mdf_section='';
   case "${mdf_spec}" in
     */*)			# not a man spec when it contains '/'
-      eval ${unset} mdf_got_one;
-      eval ${unset} mdf_name;
-      eval ${unset} mdf_section;
-      eval ${unset} mdf_spec;
+      eval ${_UNSET} mdf_got_one;
+      eval ${_UNSET} mdf_name;
+      eval ${_UNSET} mdf_section;
+      eval ${_UNSET} mdf_spec;
       eval "${return_bad}";
       ;;
     man:?*\(?*\))		# man:name(section)
@@ -2256,10 +2253,10 @@
   esac;
   if obj mdf_name is_empty;
   then
-    eval ${unset} mdf_got_one;
-    eval ${unset} mdf_name;
-    eval ${unset} mdf_section;
-    eval ${unset} mdf_spec;
+    eval ${_UNSET} mdf_got_one;
+    eval ${_UNSET} mdf_name;
+    eval ${_UNSET} mdf_section;
+    eval ${_UNSET} mdf_spec;
     eval "${return_bad}";
   fi;
   mdf_got_one='no';
@@ -2276,11 +2273,11 @@
         then
           mdf_got_one='yes';
         else
-          eval ${unset} mdf_got_one;
-          eval ${unset} mdf_name;
-          eval ${unset} mdf_s;
-          eval ${unset} mdf_section;
-          eval ${unset} mdf_spec;
+          eval ${_UNSET} mdf_got_one;
+          eval ${_UNSET} mdf_name;
+          eval ${_UNSET} mdf_s;
+          eval ${_UNSET} mdf_section;
+          eval ${_UNSET} mdf_spec;
           eval "${return_good}";
         fi;
       fi;
@@ -2288,34 +2285,34 @@
   else
     if man_search_section "${mdf_name}" "${mdf_section}";
     then
-      eval ${unset} mdf_got_one;
-      eval ${unset} mdf_name;
-      eval ${unset} mdf_s;
-      eval ${unset} mdf_section;
-      eval ${unset} mdf_spec;
+      eval ${_UNSET} mdf_got_one;
+      eval ${_UNSET} mdf_name;
+      eval ${_UNSET} mdf_s;
+      eval ${_UNSET} mdf_section;
+      eval ${_UNSET} mdf_spec;
       eval "${return_good}";
     else
-      eval ${unset} mdf_got_one;
-      eval ${unset} mdf_name;
-      eval ${unset} mdf_section;
-      eval ${unset} mdf_spec;
+      eval ${_UNSET} mdf_got_one;
+      eval ${_UNSET} mdf_name;
+      eval ${_UNSET} mdf_section;
+      eval ${_UNSET} mdf_spec;
       eval "${return_bad}";
     fi;
   fi;
   if obj _MAN_ALL is_yes && is_yes "${mdf_got_one}";
   then
-    eval ${unset} mdf_got_one;
-    eval ${unset} mdf_name;
-    eval ${unset} mdf_s;
-    eval ${unset} mdf_section;
-    eval ${unset} mdf_spec;
+    eval ${_UNSET} mdf_got_one;
+    eval ${_UNSET} mdf_name;
+    eval ${_UNSET} mdf_s;
+    eval ${_UNSET} mdf_section;
+    eval ${_UNSET} mdf_spec;
     eval "${return_good}";
   fi;
-  eval ${unset} mdf_got_one;
-  eval ${unset} mdf_name;
-  eval ${unset} mdf_s;
-  eval ${unset} mdf_section;
-  eval ${unset} mdf_spec;
+  eval ${_UNSET} mdf_got_one;
+  eval ${_UNSET} mdf_name;
+  eval ${_UNSET} mdf_s;
+  eval ${_UNSET} mdf_section;
+  eval ${_UNSET} mdf_spec;
   eval "${return_bad}";
 } # man_do_filespec()
 
@@ -2415,14 +2412,14 @@
                 man_register_file "${mss_f}" "${mss_name}";
               else
                 man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${unset} mss_dir;
-                eval ${unset} mss_ext;
-                eval ${unset} mss_f;
-                eval ${unset} mss_files;
-                eval ${unset} mss_got_one;
-                eval ${unset} mss_name;
-                eval ${unset} mss_prefix;
-                eval ${unset} mss_section;
+                eval ${_UNSET} mss_dir;
+                eval ${_UNSET} mss_ext;
+                eval ${_UNSET} mss_f;
+                eval ${_UNSET} mss_files;
+                eval ${_UNSET} mss_got_one;
+                eval ${_UNSET} mss_name;
+                eval ${_UNSET} mss_prefix;
+                eval ${_UNSET} mss_section;
                 eval "${return_good}";
               fi;
               mss_got_one='yes';
@@ -2460,14 +2457,14 @@
                 man_register_file "${mss_f}" "${mss_name}";
               else
                 man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${unset} mss_dir;
-                eval ${unset} mss_ext;
-                eval ${unset} mss_f;
-                eval ${unset} mss_files;
-                eval ${unset} mss_got_one;
-                eval ${unset} mss_name;
-                eval ${unset} mss_prefix;
-                eval ${unset} mss_section;
+                eval ${_UNSET} mss_dir;
+                eval ${_UNSET} mss_ext;
+                eval ${_UNSET} mss_f;
+                eval ${_UNSET} mss_files;
+                eval ${_UNSET} mss_got_one;
+                eval ${_UNSET} mss_name;
+                eval ${_UNSET} mss_prefix;
+                eval ${_UNSET} mss_section;
                 eval "${return_good}";
               fi;
               mss_got_one='yes';
@@ -2503,14 +2500,14 @@
                 man_register_file "${mss_f}" "${mss_name}";
               else
                 man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${unset} mss_dir;
-                eval ${unset} mss_ext;
-                eval ${unset} mss_f;
-                eval ${unset} mss_files;
-                eval ${unset} mss_got_one;
-                eval ${unset} mss_name;
-                eval ${unset} mss_prefix;
-                eval ${unset} mss_section;
+                eval ${_UNSET} mss_dir;
+                eval ${_UNSET} mss_ext;
+                eval ${_UNSET} mss_f;
+                eval ${_UNSET} mss_files;
+                eval ${_UNSET} mss_got_one;
+                eval ${_UNSET} mss_name;
+                eval ${_UNSET} mss_prefix;
+                eval ${_UNSET} mss_section;
                 eval "${return_good}";
               fi;
               mss_got_one='yes';
@@ -2522,24 +2519,24 @@
   fi;
   if obj _MAN_ALL is_yes && is_yes "${mss_got_one}";
   then
-    eval ${unset} mss_dir;
-    eval ${unset} mss_ext;
-    eval ${unset} mss_f;
-    eval ${unset} mss_files;
-    eval ${unset} mss_got_one;
-    eval ${unset} mss_name;
-    eval ${unset} mss_prefix;
-    eval ${unset} mss_section;
+    eval ${_UNSET} mss_dir;
+    eval ${_UNSET} mss_ext;
+    eval ${_UNSET} mss_f;
+    eval ${_UNSET} mss_files;
+    eval ${_UNSET} mss_got_one;
+    eval ${_UNSET} mss_name;
+    eval ${_UNSET} mss_prefix;
+    eval ${_UNSET} mss_section;
     eval "${return_good}";
   fi;
-  eval ${unset} mss_dir;
-  eval ${unset} mss_ext;
-  eval ${unset} mss_f;
-  eval ${unset} mss_files;
-  eval ${unset} mss_got_one;
-  eval ${unset} mss_name;
-  eval ${unset} mss_prefix;
-  eval ${unset} mss_section;
+  eval ${_UNSET} mss_dir;
+  eval ${_UNSET} mss_ext;
+  eval ${_UNSET} mss_f;
+  eval ${_UNSET} mss_files;
+  eval ${_UNSET} mss_got_one;
+  eval ${_UNSET} mss_name;
+  eval ${_UNSET} mss_prefix;
+  eval ${_UNSET} mss_section;
   eval "${return_bad}";
 } # man_search_section()
 
@@ -2639,13 +2636,13 @@
   if obj _MAN_PATH is_empty;
   then
     _MAN_ENABLE="no";
-    eval ${unset} ms_lang;
+    eval ${_UNSET} ms_lang;
     eval "${return_ok}";
   fi;
 
   _MAN_EXT="$(get_first_essential \
               "${_OPT_EXTENSION}" "${_MANOPT_EXTENSION}")";
-  eval ${unset} ms_lang;
+  eval ${_UNSET} ms_lang;
   eval "${return_ok}";
 } # man_setup()
 
@@ -2692,7 +2689,7 @@
     mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
   done;
   _MAN_PATH="$(path_chop "${mals_mp}")";
-  eval ${unset} mals_mp;
+  eval ${_UNSET} mals_mp;
   eval "${return_ok}";
 }
 
@@ -2727,9 +2724,9 @@
     _mals_res="${_mals_res}:${_mals_parent}";
   fi;
   path_chop "${_mals_res}";
-  eval ${unset} _mals_dir;
-  eval ${unset} _mals_parent;
-  eval ${unset} _mals_res;
+  eval ${_UNSET} _mals_dir;
+  eval ${_UNSET} _mals_parent;
+  eval ${_UNSET} _mals_res;
   eval "${return_ok}";
 }
 
@@ -2793,10 +2790,10 @@
   done;
 
   _MAN_PATH="${msfp_manpath}";
-  eval ${unset} msfp_base;
-  eval ${unset} msfp_d;
-  eval ${unset} msfp_mandir;
-  eval ${unset} msfp_manpath;
+  eval ${_UNSET} msfp_base;
+  eval ${_UNSET} msfp_d;
+  eval ${_UNSET} msfp_mandir;
+  eval ${_UNSET} msfp_manpath;
   eval "${return_ok}";
 } # manpath_set_from_path()
 
@@ -2834,8 +2831,8 @@
   shift;
   eval "${o_func}"' "${o_arg1}" "$@"';
   n="$?";
-  eval ${unset} o_arg1;
-  eval ${unset} o_func;
+  eval ${_UNSET} o_arg1;
+  eval ${_UNSET} o_func;
   eval "${return_var} $n";
 } # obj()
 
@@ -2863,7 +2860,7 @@
   cat <<EOF
 ${od_res}
 EOF
-  eval ${unset} od_res;
+  eval ${_UNSET} od_res;
   eval "${return_ok}";
 }
 
@@ -2979,14 +2976,14 @@
       esac;
     fi;
   done;
-  eval ${unset} pc_arg;
-  eval ${unset} pc_i;
-  eval ${unset} pc_res;
+  eval ${_UNSET} pc_arg;
+  eval ${_UNSET} pc_i;
+  eval ${_UNSET} pc_res;
   if path_chop "${pc_res}";
   then
     eval "${return_ok}";
   else
-    eval "${return_badk}";
+    eval "${return_bad}";
   fi;
 }
 
@@ -3016,7 +3013,7 @@
 
 ########################################################################
 # path_not_contains (<path> <dir>)
-#-
+#
 # Test whether `dir' is not contained in colon separated `path'.
 #
 # Arguments : 2 arguments.
@@ -3072,7 +3069,7 @@
   if is_equal "$1" '-';
   then
     to_tmp "${_TMP_STDIN}";
-    register_title '-';
+    register_title 'stdin';
   else
     to_tmp "$1";
     register_title "$(base_name "$1")";
@@ -3115,7 +3112,7 @@
     eval "${return_ok}";
   fi;
   _REGISTERED_TITLE="${_REGISTERED_TITLE} ${rt_title}";
-  eval ${unset} rt_title;
+  eval ${_UNSET} rt_title;
   eval "${return_ok}";
 }
 
@@ -3145,7 +3142,7 @@
     cat >"${ss_f}";
     cat_z "${ss_f}" >"${_TMP_STDIN}";
     rm -f "${ss_f}";
-    eval ${unset} ss_f;
+    eval ${_UNSET} ss_f;
     eval "${return_ok}";
   }
 else
@@ -3217,14 +3214,16 @@
 #
 tmp_cat()
 {
+  func_check tmp_cat '=' 0 "$@";
   cat "${_TMP_CAT}";
+  eval "${return_var}" "$?";
 }
 
 
 ########################################################################
 # tmp_create (<suffix>?)
 #
-# create temporary file
+# Create temporary file.
 #
 # It's safe to use the shell process ID together with a suffix to
 # have multiple temporary files.
@@ -3238,14 +3237,14 @@
 tmp_create()
 {
   func_check tmp_create '<=' 1 "$@";
-  # the output file does not have `,' as first character
+  # the output file does not have `,' as first character, so these are
+  # different names from the output file.
   tc_tmp="${_TMP_DIR}/,$1";
-  cat >"${tc_tmp}" <<EOF
-EOF
+  : >"${tc_tmp}"
   cat <<EOF
 ${tc_tmp}
 EOF
-  eval ${unset} tc_tmp;
+  eval ${_UNSET} tc_tmp;
   eval "${return_ok}";
 }
 
@@ -3416,6 +3415,7 @@
   echo2 "${_PROGRAM_NAME} ${_PROGRAM_VERSION} of ${_LAST_UPDATE}";
   # also display groff's version, but not the called subprograms
   groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /' >&2;
+  eval "${return_ok}";
 }
 
 
@@ -3464,8 +3464,8 @@
               | sed -e '1,/'"${wi_dot}"'SH/p
 d' \
               | sed -e '/'"${wi_dot}"'SH/d';
-    eval ${unset} wi_dot;
-    eval ${unset} wi_res;
+    eval ${_UNSET} wi_dot;
+    eval ${_UNSET} wi_res;
     eval "${return_ok}";
   fi;
   # grep the line containing `.Dd' macro, if any
@@ -3481,13 +3481,13 @@
               | sed -e '1,/'"${wi_dot}"'Nd/p
 d' \
               | sed -e '/'"${wi_dot}"'Nd/d';
-    eval ${unset} wi_dot;
-    eval ${unset} wi_res;
+    eval ${_UNSET} wi_dot;
+    eval ${_UNSET} wi_res;
     eval "${return_ok}";
   fi;
   echo 'is not a man page.';
-  eval ${unset} wi_dot;
-  eval ${unset} wi_res;
+  eval ${_UNSET} wi_dot;
+  eval ${_UNSET} wi_res;
   eval "${return_bad}";
 }
 
@@ -3509,13 +3509,13 @@
   w_arg="$1";
   if obj w_arg is_empty;
   then
-    eval ${unset} w_arg;
+    eval ${_UNSET} w_arg;
     eval "${return_bad}";
   fi;
   case "${w_arg}" in
     /*)
-      eval ${unset} w_arg;
-      eval ${unset} w_file;
+      eval ${_UNSET} w_arg;
+      eval ${_UNSET} w_file;
       if test -f "${w_arg}" && test -x "${w_arg}";
       then
         eval "${return_ok}";
@@ -3537,13 +3537,13 @@
       cat <<EOF
 ${w_file}
 EOF
-      eval ${unset} w_arg;
-      eval ${unset} w_file;
+      eval ${_UNSET} w_arg;
+      eval ${_UNSET} w_file;
       eval "${return_ok}";
     fi;
   done;
-  eval ${unset} w_arg;
-  eval ${unset} w_file;
+  eval ${_UNSET} w_arg;
+  eval ${_UNSET} w_file;
   eval "${return_bad}";
 }
 
@@ -3606,7 +3606,7 @@
     _TMP_DIR="${_TMP_DIR}${_PROGRAM_NAME}${_PROCESS_ID}";
     if obj _TMP_DIR is_existing;
     then
-      rm -f -r "${_TMP_DIR}" 2>${_NULL_DEV};
+      eval rm -f -r  "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
       if obj _TMP_DIR is_existing;
       then
         mi_tdir_="${_TMP_DIR}"_;
@@ -3614,7 +3614,7 @@
         mi_tdir_n="${mi_tdir_}${mi_n}";
         while obj mi_tdir_n is_existing;
         do
-          rm -f -r "${mi_tdir_n}" 2>${_NULL_DEV};
+          eval rm -f -r "'${mi_tdir_n}'" >${_NULL_DEV} 2>&1;
           if obj mi_tdir_n is_existing;
           then
             # directory could not be removed
@@ -3626,12 +3626,12 @@
         _TMP_DIR="${mi_tdir_n}";
       fi;
     fi;
-    mkdir "${_TMP_DIR}";
+    eval mkdir "${_TMP_DIR}";
     if is_not_equal "$?" 0;
     then
       if obj _TMP_DIR is_existing;
       then
-        rm -f -r "${_TMP_DIR}" 2>${_NULL_DEV};
+        eval rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
       fi;
       _TMP_DIR='';
       continue;
@@ -3643,7 +3643,7 @@
     fi;
     if obj _TMP_DIR is_existing;
     then
-      rm -f -r "${_TMP_DIR}" 2>${_NULL_DEV};
+      rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
     fi;
     _TMP_DIR='';
     continue;
@@ -3666,21 +3666,22 @@
     then
       echo '_groffer_opt=""' >>${_TMP_CAT};
       # collect the lines starting with a minus
-      cat "$mi_file" | sed -e \
-        's/^[	 ]*\(-.*\)$/_groffer_opt="${_groffer_opt} \1"'/ \
-        >>${_TMP_CAT};
+      cat "$mi_file" | sed -e '
+/^[	 ]*#/d
+s/^[	 ]*\(-.*\)$/_groffer_opt="${_groffer_opt} \1"/
+' >>${_TMP_CAT};
       # prepend the collected information to $GROFFER_OPT
       echo 'GROFFER_OPT="${_groffer_opt} ${GROFFER_OPT}"' >>${_TMP_CAT};
     fi;
   done;
-  . "${_TMP_CAT}";
+  eval . "${_TMP_CAT}";
   _TMP_CAT="$(tmp_create groffer_cat)";
 
-  eval ${unset} mi_dir;
-  eval ${unset} mi_file;
-  eval ${unset} mi_n;
-  eval ${unset} mi_tdir_;
-  eval ${unset} mi_tdir_n;
+  eval ${_UNSET} mi_dir;
+  eval ${_UNSET} mi_file;
+  eval ${_UNSET} mi_n;
+  eval ${_UNSET} mi_tdir_;
+  eval ${_UNSET} mi_tdir_n;
   eval "${return_ok}";
 } # main_init()
 
@@ -3709,8 +3710,8 @@
   fi;
   if obj MANOPT is_empty;
   then
-    eval ${unset} mpm_list;
-    eval ${unset} mpm_opt;
+    eval ${_UNSET} mpm_list;
+    eval ${_UNSET} mpm_opt;
     eval "${return_ok}";
   fi;
   # add arguments in $MANOPT by mapping them to groffer options
@@ -3819,8 +3820,8 @@
   then
     GROFFER_OPT="${mpm_list} ${GROFFER_OPT}";
   fi;
-  eval ${unset} mpm_list;
-  eval ${unset} mpm_opt;
+  eval ${_UNSET} mpm_list;
+  eval ${_UNSET} mpm_opt;
   eval "${return_ok}";
 } # main_parse_MANOPT()
 
@@ -3885,7 +3886,7 @@
         _OPT_Z='yes';
         ;;
       -X)
-        _OPT_MODE=x;
+        _OPT_MODE=X;
         ;;
       -?)
         # delete leading `-'
@@ -3957,7 +3958,7 @@
         _OPT_DEFAULT_MODES="$1";
         shift;
         ;;
-      --debug)			# buggy, only for development
+      --debug)			# only for development
         _OPT_DEBUG='yes';
         ;;
       --display)		# set X display, arg
@@ -4051,7 +4052,6 @@
             ;;
           X|x)			# output on X roff viewer
             _OPT_MODE='x';
-            _OPT_DEVICE='X75-12';
             ;;
           Q|source)		# display source code
             _OPT_MODE="source";
@@ -4138,9 +4138,8 @@
       --whatis)
         _OPT_WHATIS='yes';
         ;;
-      ---X|--x)
+      --X|--x)
         _OPT_MODE=x;
-        _OPT_DEVICE='X75-12';
         ;;
       --xrm)			# pass X resource string, arg;
         list_append _OPT_XRM "$1";
@@ -4162,6 +4161,8 @@
     if obj _OPT_DEBUG is_yes;
     then
       _DEBUG='yes';
+      _DEBUG_LM='yes';
+      _DEBUG_KEEP_FILES='yes';
     fi;
   fi;
 
@@ -4179,11 +4180,11 @@
     save_stdin;
   fi;
   # $_FILEARGS must be retrieved with `eval set x "$_FILEARGS"; shift;'
-  eval ${unset} mpa_arg;
-  eval ${unset} mpa_code;
-  eval ${unset} mpa_dpi;
-  eval ${unset} mpa_opt;
-  eval ${unset} mpa_optchar;
+  eval ${_UNSET} mpa_arg;
+  eval ${_UNSET} mpa_code;
+  eval ${_UNSET} mpa_dpi;
+  eval ${_UNSET} mpa_opt;
+  eval ${_UNSET} mpa_optchar;
   eval "${return_ok}";
 } # main_parse_args()
 
@@ -4227,7 +4228,7 @@
       ;;
   esac;
   eval "${return_error}";
-}
+} # _check_device_with_mode() of main_parse_args()
 
 
 landmark '16: main_set_mode()';
@@ -4284,7 +4285,6 @@
 
   if obj _OPT_V is_yes;
   then
-    _DISPLAY_MODE='groff';
     list_append _ADDOPTS_GROFF '-V';
   fi;
   if obj _OPT_Z is_yes;
@@ -4298,20 +4298,20 @@
   fi;
   if obj _DISPLAY_MODE is_equal 'groff';
   then
-    eval ${unset} msm_code;
-    eval ${unset} msm_modes;
-    eval ${unset} msm_viewer;
-    eval ${unset} msm_viewers;
+    eval ${_UNSET} msm_code;
+    eval ${_UNSET} msm_modes;
+    eval ${_UNSET} msm_viewer;
+    eval ${_UNSET} msm_viewers;
     eval "${return_ok}";
   fi;
 
   if obj _OPT_MODE is_equal 'source';
   then
     _DISPLAY_MODE='source';
-    eval ${unset} msm_code;
-    eval ${unset} msm_modes;
-    eval ${unset} msm_viewer;
-    eval ${unset} msm_viewers;
+    eval ${_UNSET} msm_code;
+    eval ${_UNSET} msm_modes;
+    eval ${_UNSET} msm_viewer;
+    eval ${_UNSET} msm_viewers;
     eval "${return_ok}";
   fi;
 
@@ -4325,10 +4325,10 @@
 no X display found for device ${_OPT_DEVICE}";
           fi;
           _DISPLAY_MODE='x';
-          eval ${unset} msm_code;
-          eval ${unset} msm_modes;
-          eval ${unset} msm_viewer;
-          eval ${unset} msm_viewers;
+          eval ${_UNSET} msm_code;
+          eval ${_UNSET} msm_modes;
+          eval ${_UNSET} msm_viewer;
+          eval ${_UNSET} msm_viewers;
           eval "${return_ok}";
           ;;
         ascii|cp1047|latin1|utf8)
@@ -4336,20 +4336,20 @@
           then
             _DISPLAY_MODE='tty';
           fi;
-          eval ${unset} msm_code;
-          eval ${unset} msm_modes;
-          eval ${unset} msm_viewer;
-          eval ${unset} msm_viewers;
+          eval ${_UNSET} msm_code;
+          eval ${_UNSET} msm_modes;
+          eval ${_UNSET} msm_viewer;
+          eval ${_UNSET} msm_viewers;
           eval "${return_ok}";
           ;;
       esac;
       if obj DISPLAY is_empty;
       then
         _DISPLAY_MODE='tty';
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
       fi;
 
@@ -4362,18 +4362,18 @@
       ;;
     text)
       _DISPLAY_MODE='text';
-      eval ${unset} msm_code;
-      eval ${unset} msm_modes;
-      eval ${unset} msm_viewer;
-      eval ${unset} msm_viewers;
+      eval ${_UNSET} msm_code;
+      eval ${_UNSET} msm_modes;
+      eval ${_UNSET} msm_viewer;
+      eval ${_UNSET} msm_viewers;
       eval "${return_ok}";
       ;;
     tty)
       _DISPLAY_MODE='tty';
-      eval ${unset} msm_code;
-      eval ${unset} msm_modes;
-      eval ${unset} msm_viewer;
-      eval ${unset} msm_viewers;
+      eval ${_UNSET} msm_code;
+      eval ${_UNSET} msm_modes;
+      eval ${_UNSET} msm_viewer;
+      eval ${_UNSET} msm_viewers;
       eval "${return_ok}";
       ;;
     *)				# display mode was given
@@ -4396,18 +4396,18 @@
     case "$m" in
       text)
         _DISPLAY_MODE='text';
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       tty)
         _DISPLAY_MODE='tty';
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       x)
@@ -4424,10 +4424,18 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE='x';
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
+        eval "${return_ok}";
+        ;;
+      X)
+        _DISPLAY_MODE='X';
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       dvi)
@@ -4444,10 +4452,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="dvi";
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       pdf)
@@ -4464,10 +4472,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="pdf";
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       ps)
@@ -4484,10 +4492,10 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE="ps";
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
       html)
@@ -4504,20 +4512,20 @@
         fi;
         _DISPLAY_PROG="${msm_viewer}";
         _DISPLAY_MODE=html;
-        eval ${unset} msm_code;
-        eval ${unset} msm_modes;
-        eval ${unset} msm_viewer;
-        eval ${unset} msm_viewers;
+        eval ${_UNSET} msm_code;
+        eval ${_UNSET} msm_modes;
+        eval ${_UNSET} msm_viewer;
+        eval ${_UNSET} msm_viewers;
         eval "${return_ok}";
         ;;
     esac;
   done;
-  eval ${unset} msm_code;
-  eval ${unset} msm_modes;
-  eval ${unset} msm_viewer;
-  eval ${unset} msm_viewers;
+  eval ${_UNSET} msm_code;
+  eval ${_UNSET} msm_modes;
+  eval ${_UNSET} msm_viewer;
+  eval ${_UNSET} msm_viewers;
   error "main_set_mode(): no suitable display mode found.";
-}
+} # main_set_mode()
 
 
 # _get_first_prog (<proglist>)
@@ -4557,13 +4565,13 @@
       cat <<EOF
 ${_gfp_i}
 EOF
-      eval ${unset} _gfp_i;
+      eval ${_UNSET} _gfp_i;
       return "${_GOOD}";
     fi;
   done;
-  eval ${unset} _gfp_i;
+  eval ${_UNSET} _gfp_i;
   return "${_BAD}";
-} # main_set_mode()
+} # _get_first_prog() of main_set_mode()
 
 
 landmark '17: main_do_fileargs()';
@@ -4583,7 +4591,7 @@
   mdfa_exitcode="${_BAD}";
   eval set x "${_FILEARGS}";
   shift;
-  eval ${unset} _FILEARGS;
+  eval ${_UNSET} _FILEARGS;
   # temporary storage of all input to $_TMP_CAT
   while test "$#" -ge 2;
   do
@@ -4651,17 +4659,20 @@
       mdfa_exitcode="${_GOOD}";
     fi;
   done;
-  rm -f "${_TMP_STDIN}";
+  if obj _DEBUG_KEEP_FILES is_not_yes;
+  then
+    rm -f "${_TMP_STDIN}";
+  fi;
   if is_equal "${mdfa_exitcode}" "${_BAD}";
   then
-    eval ${unset} mdfa_exitcode;
-    eval ${unset} mdfa_filespec;
-    eval ${unset} mdfa_name;
+    eval ${_UNSET} mdfa_exitcode;
+    eval ${_UNSET} mdfa_filespec;
+    eval ${_UNSET} mdfa_name;
     eval "${return_bad}";
   fi;
-  eval ${unset} mdfa_exitcode;
-  eval ${unset} mdfa_filespec;
-  eval ${unset} mdfa_name;
+  eval ${_UNSET} mdfa_exitcode;
+  eval ${_UNSET} mdfa_filespec;
+  eval ${_UNSET} mdfa_name;
   eval "${return_ok}";
 } # main_do_fileargs()
 
@@ -4721,10 +4732,10 @@
   if obj _DISPLAY_PROG is_empty;
   then				# for example, for groff mode
     _DISPLAY_ARGS='';
-    eval ${unset} msr_n;
-    eval ${unset} msr_prog;
-    eval ${unset} msr_rl;
-    eval ${unset} msr_title;
+    eval ${_UNSET} msr_n;
+    eval ${_UNSET} msr_prog;
+    eval ${_UNSET} msr_rl;
+    eval ${_UNSET} msr_title;
     eval "${return_ok}";
   fi;
 
@@ -4858,10 +4869,10 @@
     esac;
   fi;
   _DISPLAY_ARGS="${msr_rl}";
-  eval ${unset} msr_n;
-  eval ${unset} msr_prog;
-  eval ${unset} msr_rl;
-  eval ${unset} msr_title;
+  eval ${_UNSET} msr_n;
+  eval ${_UNSET} msr_prog;
+  eval ${_UNSET} msr_rl;
+  eval ${_UNSET} msr_title;
   eval "${return_ok}";
 } # main_set_resources
 
@@ -4894,7 +4905,8 @@
     md_modefile="${_OUTPUT_FILE_NAME}";
   else
     clean_up;
-    eval ${unset} md_modefile;
+    echo2 'groffer: empty input.';
+    eval ${_UNSET} md_modefile;
     eval "${return_ok}";
   fi;
   case "${_DISPLAY_MODE}" in
@@ -4906,24 +4918,32 @@
       fi;
       md_groggy="$(tmp_cat | eval grog "${md_options}")";
       trap_clean;
-      # start a new shell program to get another process ID.
-      /bin/sh -c '
-        set -e;
-        test -f "${md_modefile}" && rm -f "${md_modefile}";
-        mv "${_TMP_CAT}" "${md_modefile}";
-        cat "${md_modefile}" | \
-        (
-          clean_up()
-          {
-            if test -d "${_TMP_DIR}";
-            then
-              rm -f "${_TMP_DIR}"/* || :;
-              rmdir "${_TMP_DIR}";
-            fi;
-          }
-          trap clean_up 0 2>${_NULL_DEV} || :;
-          eval "${md_groggy}" "${_ADDOPTS_GROFF}";
-        ) &'
+      if obj _OPT_V is_yes;
+      then
+        echo "File:            ${md_modefile}";
+        echo "Mode:            ${_DISPLAY_MODE}";
+        echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
+        eval "${md_groggy}" "${_ADDOPTS_GROFF}";
+        clean_up;
+      else
+        # start a new shell program to get another process ID.
+        /bin/sh -c '
+          set -e;
+          test -f "${md_modefile}" && rm -f "${md_modefile}";
+          mv "${_TMP_CAT}" "${md_modefile}";
+          cat "${md_modefile}" | \
+          (
+            clean_up()
+            {
+              if test -d "${_TMP_DIR}";
+              then
+                rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
+              fi;
+            }
+            trap clean_up 0 2>${_NULL_DEV} || :;
+            eval "${md_groggy}" "${_ADDOPTS_GROFF}";
+          ) &'
+      fi;
       ;;
     text|tty)
       case "${_OPT_DEVICE}" in
@@ -4943,7 +4963,15 @@
       md_groggy="$(tmp_cat | grog -T${md_device})";
       if obj _DISPLAY_MODE is_equal 'text';
       then
-        tmp_cat | eval "${md_groggy}" "${md_addopts}";
+        if obj _OPT_V is_yes;
+        then
+          echo "File:            ${md_modefile}";
+          echo "Mode:            ${_DISPLAY_MODE}";
+          echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
+          eval "${md_groggy}" "${md_addopts}";
+        else
+          tmp_cat | eval "${md_groggy}" "${md_addopts}";
+        fi;
       else
         md_pager='';
         for p in "${_OPT_PAGER}" "${PAGER}" "${_MANOPT_PAGER}" \
@@ -4960,8 +4988,16 @@
         then
           error 'main_display(): no pager program found for tty mode';
         fi;
-        tmp_cat | eval "${md_groggy}" "${md_addopts}" | \
-                  eval "${md_pager}";
+        if obj _OPT_V is_yes;
+        then
+          echo "File:            ${md_modefile}";
+          echo "Mode:            ${_DISPLAY_MODE}";
+          echo "Display program: ${md_pager}";
+          eval "${md_groggy}" "${md_addopts}";
+        else
+          tmp_cat | eval "${md_groggy}" "${md_addopts}" | \
+                    eval "${md_pager}";
+        fi;
       fi;
       clean_up;
       ;;
@@ -5008,31 +5044,41 @@
       esac;
       md_groggy="$(tmp_cat | grog -Tps)";
       trap_clean;
-      # start a new shell program to get another process ID.
-      /bin/sh -c '
-        set -e;
-        _psfile="${md_modefile}.ps";
-        md_modefile="${md_modefile}.pdf";
-        test -f "${_psfile}" && rm -f "${_psfile}";
-        test -f "${md_modefile}" && rm -f "${md_modefile}";
-        cat "${_TMP_CAT}" | \
-          eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${_psfile}";
-        gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-           -sOutputFile="${md_modefile}" -c save pop -f "${_psfile}";
-        test -f "${_psfile}" && rm -f "${_psfile}";
-        test -f "${_TMP_CAT}" && rm -f "${_TMP_CAT}";
-        (
-          clean_up() {
-            rm -f "${md_modefile}";
-            if test -d "${_TMP_DIR}";
-            then
-              rm -f "${_TMP_DIR}"/* || :;
-              rmdir "${_TMP_DIR}";
-            fi;
-          }
-          trap clean_up 0 2>${_NULL_DEV} || :;
-          eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
-        ) &'
+      if obj _OPT_V is_yes;
+      then
+        echo "File:            ${md_modefile}.pdf";
+        echo "Mode:            ${_DISPLAY_MODE}";
+        echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
+        eval "${md_groggy}" "${_ADDOPTS_GROFF}";
+        clean_up;
+      else
+        # start a new shell program to get another process ID.
+        /bin/sh -c '
+          set -e;
+          _psfile="${md_modefile}.ps";
+          md_modefile="${md_modefile}.pdf";
+          test -f "${_psfile}" && rm -f "${_psfile}";
+          test -f "${md_modefile}" && rm -f "${md_modefile}";
+          cat "${_TMP_CAT}" | \
+            eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${_psfile}";
+          gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
+             -sOutputFile="${md_modefile}" -c save pop -f "${_psfile}";
+          if test _"${_DEBUG_KEEP_FILES}"_ != _yes_;
+          then
+            test -f "${_psfile}" && rm -f "${_psfile}";
+            test -f "${_TMP_CAT}" && rm -f "${_TMP_CAT}";
+          fi;
+          (
+            clean_up() {
+              if test -d "${_TMP_DIR}";
+              then
+                rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
+              fi;
+            }
+            trap clean_up 0 2>${_NULL_DEV} || :;
+            eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
+          ) &'
+      fi;
       ;;
     ps)
       case "${_OPT_DEVICE}" in
@@ -5050,17 +5096,45 @@
       ;;
     x)
       case "${_OPT_DEVICE}" in
-        '')
-          md_groggy="$(tmp_cat | grog -Z)";
-          ;;
-        X*|ps)
-          md_groggy="$(tmp_cat | grog -T"${_OPT_DEVICE}" -Z)";
+      X*)
+        md_device="${_OPT_DEVICE}"
+        ;;
+      *)
+        case "${_OPT_RESOLUTION}" in
+        100)
+          md_device='X100';
+          if obj _OPT_GEOMETRY is_empty
+          then
+            case "${_DISPLAY_PROG}" in
+            gxditview|xditview)
+              # add width of 800dpi for resolution of 100dpi to the args
+              list_append _DISPLAY_ARGS '-geometry' '800';
+              ;;
+            esac;
+          fi;
           ;;
         *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-          md_groggy="$(tmp_cat | grog -Z)";
+          md_device='X75-12';
           ;;
+        esac
+      esac;
+      md_groggy="$(tmp_cat | grog -T${md_device} -Z)";
+      _do_display;
+      ;;
+    X)
+      case "${_OPT_DEVICE}" in
+      '')
+        md_groggy="$(tmp_cat | grog -X)";
+        ;;
+      X*|dvi|html|lbp|lj4|ps)
+        # these devices work with 
+        md_groggy="$(tmp_cat | grog -T"${_OPT_DEVICE}" -X)";
+        ;;
+      *)
+        warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+        md_groggy="$(tmp_cat | grog -Z)";
+        ;;
       esac;
       _do_display;
       ;;
@@ -5068,13 +5142,13 @@
       error "main_display(): unknown mode \`${_DISPLAY_MODE}'";
       ;;
   esac;
-  eval ${unset} md_addopts;
-  eval ${unset} md_device;
-  eval ${unset} md_groggy;
-  eval ${unset} md_modefile;
-  eval ${unset} md_options;
-  eval ${unset} md_p;
-  eval ${unset} md_pager;
+  eval ${_UNSET} md_addopts;
+  eval ${_UNSET} md_device;
+  eval ${_UNSET} md_groggy;
+  eval ${_UNSET} md_modefile;
+  eval ${_UNSET} md_options;
+  eval ${_UNSET} md_p;
+  eval ${_UNSET} md_pager;
   eval "${return_ok}";
 } # main_display()
 
@@ -5084,26 +5158,38 @@
 {
   func_check _do_display = 0 "$@";
   trap_clean;
-  # start a new shell program for another process ID and better
-  # cleaning-up of the temporary files.
-  /bin/sh -c '
-    set -e;
-    test -f "${md_modefile}" && rm -f "${md_modefile}";
-    cat "${_TMP_CAT}" | \
-      eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${md_modefile}";
-    rm -f "${_TMP_CAT}";
-    (
-      clean_up() {
-        if test -d "${_TMP_DIR}";
-        then
-          rm -f "${_TMP_DIR}"/* || :;
-          rmdir "${_TMP_DIR}";
-        fi;
-      }
-      trap clean_up 0 2>${_NULL_DEV} || :;
-      eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
-    ) &'
-}
+  if obj _OPT_V is_yes;
+  then
+    echo "File:            ${md_modefile}";
+    echo "Mode:            ${_DISPLAY_MODE}";
+    echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
+    eval "${md_groggy}" "${_ADDOPTS_GROFF}";
+    clean_up;
+  else
+    # start a new shell program for another process ID and better
+    # cleaning-up of the temporary files.
+    /bin/sh -c '
+      set -e;
+      test -f "${md_modefile}" && rm -f "${md_modefile}";
+      cat "${_TMP_CAT}" | \
+        eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${md_modefile}";
+      if test _"${_DEBUG_KEEP_FILES}"_ != _yes_;
+      then
+        rm -f "${_TMP_CAT}";
+      fi;
+      (
+        clean_up() {
+          if test -d "${_TMP_DIR}";
+          then
+            rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
+          fi;
+        }
+        trap clean_up 0 2>${_NULL_DEV} || :;
+        eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
+      ) &'
+  fi;
+  eval "${return_ok}";
+} # _do_display() of main_display()
 
 
 ########################################################################



From MAILER-DAEMON Sun Jul 31 11:46:57 2005
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1DzG1h-0006am-1m
	for mharc-groff-commit@gnu.org; Sun, 31 Jul 2005 11:46:57 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Dz8kf-0005Cp-Fj
	for groff-commit@gnu.org; Sun, 31 Jul 2005 04:00:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Dz8kW-00057a-FC
	for groff-commit@gnu.org; Sun, 31 Jul 2005 04:00:51 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Dz8kU-00055U-PM
	for groff-commit@gnu.org; Sun, 31 Jul 2005 04:00:43 -0400
Received: from [199.232.41.3] (helo=savannah.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dz8p9-0007jq-3F
	for groff-commit@gnu.org; Sun, 31 Jul 2005 04:05:32 -0400
Received: from savannah.gnu.org ([127.0.0.1])
	by savannah.gnu.org with smtp (Exim 3.35 #1 (Debian))
	id 1Dz8dI-0005Dx-00
	for <groff-commit@gnu.org>; Sun, 31 Jul 2005 03:53:16 -0400
To: groff-commit@gnu.org
From: Werner LEMBERG <wl@gnu.org>
Message-Id: <E1Dz8dI-0005Dx-00@savannah.gnu.org>
Date: Sun, 31 Jul 2005 03:53:16 -0400
X-Mailman-Approved-At: Sun, 31 Jul 2005 11:46:55 -0400
Subject: [Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub RE...
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: groff-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/groff-commit>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 31 Jul 2005 08:00:54 -0000

CVSROOT:	/cvsroot/groff
Module name:	groff
Branch: 	
Changes by:	Werner LEMBERG <wl@savannah.gnu.org>	05/07/31 07:53:16

Modified files:
	contrib/groffer: ChangeLog Makefile.sub README_SH groffer.sh 
Added files:
	contrib/groffer: groffer2.sh 

Log message:
	________________________________________________________________
	* release of groffer 0.9.20
	
	### Split groffer.sh into two files groffer.sh and groffer2.sh.
	
	* groffer.sh:
	- Remove the second part of this script.  It is now in
	groffer2.sh.
	- $_GROFFER2_SH: New variable to point to the installed position
	of `groffer2.sh'.  This position is presented using @libdir@.
	
	* groffer2.sh: New script containing the second part of
	groffer.sh. This script will be installed in the groffer library
	directory @libdir@/groff/groffer, this might be
	/usr/local/lib/groff/groffer/groffer2.sh for example.
	
	* Makefile.sub:
	- `groffer': Add replacement of @libdir@.
	- `install_data': Add the installation of the groffer library
	directory and groffer2.sh.
	- `uninstall_sub': Delete the installed `groffer2.sh' and the
	groffer library directory.
	
	* README_SH:
	- Remove the function list.
	- Add argument options to the list of used commands.
	- Documentation of the splitting of the script.
	- Document the possible abbreviation of options.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer2.sh?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/ChangeLog.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/Makefile.sub.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/README_SH.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.sh.diff?tr1=1.30&tr2=1.31&r1=text&r2=text

Patches:
Index: groff/contrib/groffer/ChangeLog
diff -u groff/contrib/groffer/ChangeLog:1.30 groff/contrib/groffer/ChangeLog:1.31
--- groff/contrib/groffer/ChangeLog:1.30	Thu Jul  7 20:03:12 2005
+++ groff/contrib/groffer/ChangeLog	Sun Jul 31 07:53:15 2005
@@ -1,4 +1,35 @@
 	________________________________________________________________
+	* release of groffer 0.9.20
+
+2005-07-30  Bernd Warken
+
+	### Split groffer.sh into two files groffer.sh and groffer2.sh.
+
+	* groffer.sh:
+	- Remove the second part of this script.  It is now in
+	groffer2.sh.
+	- $_GROFFER2_SH: New variable to point to the installed position
+	of `groffer2.sh'.  This position is presented using @libdir@.
+
+	* groffer2.sh: New script containing the second part of
+	groffer.sh. This script will be installed in the groffer library
+	directory @libdir@/groff/groffer, this might be
+	/usr/local/lib/groff/groffer/groffer2.sh for example.
+
+	* Makefile.sub:
+	- `groffer': Add replacement of @libdir@.
+	- `install_data': Add the installation of the groffer library
+	directory and groffer2.sh.
+	- `uninstall_sub': Delete the installed `groffer2.sh' and the
+	groffer library directory.
+
+	* README_SH:
+	- Remove the function list.
+	- Add argument options to the list of used commands.
+	- Documentation of the splitting of the script.
+	- Document the possible abbreviation of options.
+
+	________________________________________________________________
 	* release of groffer 0.9.19
 
 2005-07-07  Bernd Warken
Index: groff/contrib/groffer/Makefile.sub
diff -u groff/contrib/groffer/Makefile.sub:1.10 groff/contrib/groffer/Makefile.sub:1.11
--- groff/contrib/groffer/Makefile.sub:1.10	Sat Jul  2 17:37:54 2005
+++ groff/contrib/groffer/Makefile.sub	Sun Jul 31 07:53:15 2005
@@ -5,9 +5,11 @@
 # Last update: 30 June 2005
 
 # Copyright (C) 2001,2002,2005 Free Software Foundation, Inc.
-# Written by Werner Lemberg <wl@gnu.org>
+# Written by Werner Lemberg <wl@gnu.org> and Bernd Warken.
 
-# This file is part of groff.
+# Last update: 30 July 2005
+
+# This file is part of groffer which is part of groff.
 
 # groff is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -34,19 +36,25 @@
 
 all: groffer
 
-groffer: groffer.sh $(SH_DEPS_SED_SCRIPT)
+groffer: groffer.sh groffer2.sh $(SH_DEPS_SED_SCRIPT)
 	$(RM) $@; \
 	sed -f $(SH_DEPS_SED_SCRIPT) \
             -e "s|@g@|$(g)|g" \
 	    -e "s|@BINDIR@|$(bindir)|g" \
+	    -e "s|@libdir@|$(libdir)|g" \
 	    -e "s|@VERSION@|$(version)$(revision)|g" \
 	    -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@; \
 	chmod +x $@
 
 install_data: groffer
 	-test -d $(bindir) || $(mkinstalldirs) $(bindir)
+	-test -d $(libdir)/groff/groffer || \
+          $(mkinstalldirs) $(libdir)/groff/groffer
 	-$(RM) $(bindir)/groffer
 	$(INSTALL_SCRIPT) groffer $(bindir)/groffer
+	$(INSTALL_SCRIPT) groffer2.sh $(libdir)/groff/groffer
 
 uninstall_sub:
 	-$(RM) $(bindir)/groffer
+	-$(RM) $(libdir)/groff/groffer/groffer2.sh
+	-rmdir $(libdir)/groff/groffer
Index: groff/contrib/groffer/README_SH
diff -u groff/contrib/groffer/README_SH:1.9 groff/contrib/groffer/README_SH:1.10
--- groff/contrib/groffer/README_SH:1.9	Thu Jul  7 20:03:13 2005
+++ groff/contrib/groffer/README_SH	Sun Jul 31 07:53:15 2005
@@ -1,13 +1,28 @@
-Additional description for groffer.sh, the shell version of groffer
+Additional description for the shell version of `groffer'
+
+
+Scripts
+
+The shell version of `groffer' contains two files, `groffer.sh' and
+`groffer2.sh'.  `groffer.sh' is a short introductory script; it is
+transformed by `make' into `groffer'; this will be installed in
+@bindir@, which is usually /usr/local/bin.
+
+`groffer2.sh' is a long main script with all functions that is called
+by `groffer.sh' and `groffer'.  It is installed unchanged into
+@libdir@/groff/groffer, which is usually /usr/local/lib/groff/groffer.
+This script can be called with a different shell, using the option
+`--shell'.  So it makes sense to split the script into two parts.
 
 
 Shell Compatibility
 
-This shell script is compatible to both the GNU and the POSIX shell
-and utilities.  Care was taken to restrict the programming technics
-used here in order to achieve POSIX compatibility as far back as POSIX
-P1003.2 Draft 11.2 of September 1991.  This draft is available at
-http://www.funet.fi/pub/doc/posix/p1003.2/d11.2 in the internet.
+The `groffer' shell scripts are compatible to both the GNU and the
+POSIX shell and utilities.  Care was taken to restrict the programming
+technics used here in order to achieve POSIX compatibility as far back
+as POSIX P1003.2 Draft 11.2 of September 1991.  This draft is
+available at http://www.funet.fi/pub/doc/posix/p1003.2/d11.2 in the
+internet.
 
 The POSIX draft does not include `local' variables for functions.  So
 this concept was replaced by global variables with a prefix that
@@ -15,12 +30,13 @@
 name.  These quasi-local variables are unset before each return of the
 function.
 
-The `groffer' script was tested under the shells `ash', `bash',
+The `groffer' scripts were tested under the shells `ash', `bash',
 `dash', 'ksh', `pdksh', 'posh', and `zsh' without problems in Linux
-Debian.  A shell can be tested either by the `groffer' option
-`--shell' or by the command
+Debian.  A shell can be tested by the `groffer' option `--shell', but
+that will run only with groffer2.sh.  To start it directly from the
+beginning under this shell the following command can be used.
 
-  <shell> groffer.sh <argument>...
+  <shell-name> groffer.sh --shell=<shell-name> <argument>...
 
 
 Some shells are not fully POSIX compatible.  For them the following
@@ -35,7 +51,9 @@
 
 - Replace `set -- ...' by `set x ...; shift'.  After the first
   non-option argument, all arguments including those starting with `-'
-  are accepted as non-option.
+  are accepted as non-option.  For variables or `$()' constructs with
+  line-breaks, use `eval set' without quotes.  That transforms a
+  line-break within a variable to a space.
 
 - The name of the variable in `for' is chosen as a single character
   (old ash).  The content of such variables is not safe because it can
@@ -51,27 +69,30 @@
   replaced by `cat <<EOF'.
 
 - `ls' has problems.  Old UNIX systems echoed the error message to
-standard output.  So handle the output with `sed'.  If the output
-contains `not found' map it to an empty string.
+  standard output.  So handle the output with `sed'.  If the output
+  contains `not found' map it to an empty string.
 
 - As `test -e' is not available in Solaris 2.5 replace it by
   `test -f || test -d'.
 
-- As `unset' is not supported by all shells replace ist by `eval
-  $unset' where this variable is `unset' if it exists and `:'
+- As `unset' is not supported by all shells replace it by `eval
+  ${_UNSET}' where this variable is `unset' if it exists and `:'
   otherwise.
 
 - Replace `true' by `:', `false' isn't used.
 
 - Do not redefine builtins as functions (ash).
 
+- Avoid `[^...]' in `case' patterns (ash).
+
+- `trap' does not allow error code 127.
 
-The script uses the following commands:
+The scripts call the following commands with all options used:
 .
 :
 apropos
 break
-bzip2
+bzip2 -c -d -t
 cat
 catz
 continue
@@ -79,30 +100,36 @@
 eval
 expr
 grep
-groff
-grog
-gs
-gzip
+groff -v
+grog -T -X -Z
+gs -c -d -f -q -s
+gzip -c -d -f
+less -r -R
 ls
-man
+man -k --apropos
 mkdir
 mv
 return
-rm
+rm -f -r
 rmdir
-sed
-set
-sh
+sed -e -n
+set -e
+sh -c
 shift
-test
+test -d -f -r -s -w -x
 trap
 umask
 unset
 
+
+Options
+
 The `groffer' script provides its own option parser.  It is compatible
-to the usual GNU style command line (option clusters, long option
-names with 2 `-' signs, mixing of options and non-option file names),
-except that it is not possible to abbreviate long option names.
+to the usual GNU style command line This includes long option names
+with two signs such as `--option', clusters of short options, the
+mixing of options and non-option file names, the option `--' to close
+the option handling, and it is possible to abbreviate the long option
+names.
 
 The flexible mixing of options and file names in GNU style is always
 possible, even if the environment variable `$POSIXLY_CORRECT' is set
@@ -119,97 +146,25 @@
 and error().
 
 
-Survey of Functions defined in groffer.sh
+Function Definitions in `groffer2.sh'
 
-Each funtion in groffer.sh has a description that starts with the
+Each funtion in groffer2.sh has a description that starts with the
 function name and symbols for its arguments in paranthesis `()'.  Each
 `<>' construction gives an argument name that just gives a hint on
 what the argument is meant to be; these argument names are otherwise
 irrelevant.  The `>' sign can be followed by another character that
 shows how many of these arguments are possible.
 
+<arg>      exactly 1 of this argument
 <arg>?     0 or 1 of these arguments
 <arg>*     arbitrarily many such arguments, incl. none
 <arg>+     one or more such arguments
-<arg>      exactly 1 of this argument
+<arg>...   one or more such arguments
 [...]      optional arguments
 
 A function that starts with an underscore `_' is an internal function
-for some function.  The internal functions are defined just after
-their corresponding function; they are not mentioned in the following.
-
-abort (<text>*)
-base_name (<path>)
-catz (<file>)
-clean_up ()
-diag (<text>*)
-dirname_append (<path> [<dir...>])
-dirname_chop (<path>)
-do_filearg (<filearg>)
-do_nothing ()
-echo2 (<text>*)
-error (<text>*)
-get_first_essential (<arg>*)
-is_dir (<name>)
-is_empty (<string>)
-is_equal (<string1> <string2>)
-is_existing (<name>)
-is_file (<name>)
-is_non_empty_file (<name>)
-is_not_dir (<name>)
-is_not_empty (<string>)
-is_not_equal (<string1> <string2>)
-is_not_file (<name>)
-is_not_prog (<name>)
-is_not_writable (<name>)
-is_not_yes (<string>)
-is_prog (<name>)
-is_writable (<name>)
-is_yes (<string>)
-leave ()
-landmark (<text>)
-list_append (<list> <element>...)
-list_from_cmdline (<pre_name_of_opt_lists> [<cmdline_arg>...])
-list_from_split (<string> <separator>)
-list_get (<list>)
-list_has (<list> <element>)
-list_has_not (<list> <element>)
-main_*(), see after the functions
-man_do_filespec (<filespec>)
-man_setup ()
-man_register_file (<file> [<name> [<section>]])
-man_search_section (<name> <section>)
-man_set()
-manpath_add_lang(<path> <language>)
-manpath_add_system()
-manpath_from_path ()
-normalize_args (<shortopts> <longopts> <arg>*)
-obj (<object> <call_name> <arg>...)
-obj_data (<object>)
-obj_from_output (<object> <call_name> <arg>...)
-obj_set (<object> <data>)
-path_chop (<path>)
-path_clean (<path>)
-path_contains (<path> <dir>)
-path_not_contains (<path> <dir>)
-path_split (<path>)
-register_file (<filename>)
-register_title (<filespec>)
-res (<var_name> <function_name> <arg>...)
-reset ()
-save_stdin ()
-string_contains (<string> <part>)
-string_not_contains (<string> <part>)
-tmp_cat ()
-tmp_create (<suffix>?)
-to_tmp (<filename>)
-trap_clean ()
-trap_set (<functionname>)
-usage ()
-version ()
-warning (<string>)
-whatis (<filename>)
-where (<program>)
+for some other function.  The internal functions are defined just
+after their corresponding function.
 
 
 External Environment Variables
@@ -262,7 +217,7 @@
 
 ####### License
 
-Last update: 4 July 2005
+Last update: 30 July 2005
 
 Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
 Written by Bernd Warken
Index: groff/contrib/groffer/groffer.sh
diff -u groff/contrib/groffer/groffer.sh:1.30 groff/contrib/groffer/groffer.sh:1.31
--- groff/contrib/groffer/groffer.sh:1.30	Thu Jul  7 20:03:13 2005
+++ groff/contrib/groffer/groffer.sh	Sun Jul 31 07:53:15 2005
@@ -4,8 +4,8 @@
 
 # Source file position: <groff-source>/contrib/groffer/groffer.sh
 
-# Copyright (C) 2001,2002,2003,2004,2005 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001,2002,2003,2004,2005
+# Free Software Foundation, Inc.
 # Written by Bernd Warken
 
 # This file is part of groff version @VERSION@ (eventually 1.19.2).
@@ -26,8 +26,8 @@
 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
 
 _PROGRAM_NAME='groffer';
-_PROGRAM_VERSION='0.9.19';
-_LAST_UPDATE='7 July 2005';
+_PROGRAM_VERSION='0.9.20';
+_LAST_UPDATE='30 July 2005';
 
 
 ########################################################################
@@ -174,17 +174,21 @@
     eval ${_UNSET} _all;
   fi;
 
+  export _GROFFER2_SH;            # file name of the script that follows up
+  _GROFFER2_SH='@libdir@/groff/groffer/groffer2.sh';
+
   # restart the script with the last found $_shell, if it is a shell
   if _test_on_shell "${_shell}";
   then
     _GROFFER_RUN='second';
     # do not quote $_shell to allow arguments
-    eval exec ${_shell} "'${_GROFFER_SH}'" '"$@"';
+    eval exec ${_shell} "'${_GROFFER2_SH}'" '"$@"';
     exit;
   fi;
 
   _GROFFER_RUN='second';
   eval ${_UNSET} _shell;
+  eval exec "'${_GROFFER2_SH}'" '"$@"';
 
 fi; # end of first run
 
@@ -195,5026 +199,3 @@
 fi;
 
 eval ${_UNSET} _GROFFER_RUN
-
-
-########################################################################
-# diagnostic messages
-#
-export _DEBUG;
-_DEBUG='no';			# disable debugging information
-#_DEBUG='yes';			# enable debugging information
-
-export _DEBUG_LM;
-_DEBUG_LM='no';			# disable landmark messages
-#_DEBUG_LM='yes';		# enable landmark messages
-
-export _DEBUG_KEEP_FILES;
-_DEBUG_KEEP_FILES='no'		# disable file keeping in temporary dir
-_DEBUG_KEEP_FILES='yes'		# enable file keeping in temporary dir
-
-# test of $* on --debug
-case " $* " in
-*' --debug '*)
-  _DEBUG='yes';
-  _DEBUG_LM='yes';
-  _DEBUG_KEEP_FILES='yes';
-  ;;
-esac;
-
-
-########################################################################
-#                       Environment Variables
-########################################################################
-
-# Environment variables that exist only for this file start with an
-# underscore letter.  Global variables to this file are written in
-# upper case letters, e.g. $_GLOBAL_VARIABLE; temporary variables
-# start with an underline and use only lower case letters and
-# underlines, e.g.  $_local_variable .
-
-#   [A-Z]*     system variables,      e.g. $MANPATH
-#   _[A-Z_]*   global file variables, e.g. $_MAN_PATH
-#   _[a-z_]*   temporary variables,   e.g. $_manpath
-
-# Due to incompatibilities of the `ash' shell, the name of loop
-# variables in `for' must be single character
-#   [a-z]      local loop variables,   e.g. $i
-
-
-########################################################################
-# read-only variables (global to this file)
-########################################################################
-
-# characters
-
-export _SPACE;
-export _SQUOTE;
-export _TAB;
-
-_SPACE=' ';
-_SQUOTE="'";
-_TAB='	';
-
-# function return values; `0' means ok; other values are error codes
-export _ALL_EXIT;
-export _BAD;
-export _ERROR;
-export _GOOD;
-export _NO;
-export _OK;
-export _YES;
-
-_GOOD='0';			# return ok
-_BAD='1';			# return negatively, error code `1'
-_ERROR='7';			# for syntax errors; no `-1' in `ash'
-
-_ALL_EXIT="${_GOOD} ${_BAD} ${_ERROR}"; # all exit codes (for `trap_set')
-
-_NO="${_BAD}";
-_YES="${_GOOD}";
-_OK="${_GOOD}";
-
-# quasi-functions, call with `eval', e.g `eval "${return_ok}"'
-export return_ok;
-export return_good;
-export return_bad;
-export return_yes;
-export return_no;
-export return_error;
-export return_var;
-return_ok="func_pop; return ${_OK}";
-return_good="func_pop; return ${_GOOD}";
-return_bad="func_pop; return ${_BAD}";
-return_yes="func_pop; return ${_YES}";
-return_no="func_pop; return ${_NO}";
-return_error="func_pop; return ${_ERROR}";
-return_var="func_pop; return";	# add number, e.g. `eval "${return_var} $n'
-
-
-export _DEFAULT_MODES;
-_DEFAULT_MODES='x,ps,tty';
-export _DEFAULT_RESOLUTION;
-_DEFAULT_RESOLUTION='75';
-
-export _DEFAULT_TTY_DEVICE;
-_DEFAULT_TTY_DEVICE='latin1';
-
-# _VIEWER_* viewer programs for different modes (only X is necessary)
-# _VIEWER_* a comma-separated list of viewer programs (with options)
-export _VIEWER_DVI;		# viewer program for dvi mode
-export _VIEWER_PS;		# viewer program for ps mode
-export _VIEWER_HTML_X;		# viewer program for html mode in X
-export _VIEWER_HTML_TTY;	# viewer program for html mode in tty
-_VIEWER_DVI='kdvi,xdvi,dvilx';
-_VIEWER_PDF='kghostview,ggv,xpdf,acroread,kpdf';
-_VIEWER_PS='kghostview,ggv,gv,ghostview,gs_x11,gs';
-_VIEWER_HTML='konqueror,mozilla,netscape,opera,amaya,arena,lynx';
-_VIEWER_X='gxditview,xditview';
-
-# Search automatically in standard sections `1' to `8', and in the
-# traditional sections `9', `n', and `o'.  On many systems, there
-# exist even more sections, mostly containing a set of man pages
-# special to a specific program package.  These aren't searched for
-# automatically, but must be specified on the command line.
-export _MAN_AUTO_SEC;
-_MAN_AUTO_SEC="'1' '2' '3' '4' '5' '6' '7' '8' '9' 'n' 'o'"
-
-export _PROCESS_ID;		# for shutting down the program
-_PROCESS_ID="$$";
-
-
-############ the command line options of the involved programs
-#
-# The naming scheme for the options environment names is
-# $_OPTS_<prog>_<length>[_<argspec>]
-#
-# <prog>:    program name GROFFER, GROFF, or CMDLINE (for all
-#            command line options)
-# <length>:  LONG (long options) or SHORT (single character options)
-# <argspec>: ARG for options with argument, NA for no argument;
-#            without _<argspec> both the ones with and without arg.
-#
-# Each option that takes an argument must be specified with a
-# trailing : (colon).
-
-# exports
-export _OPTS_GROFFER_SHORT_NA;
-export _OPTS_GROFFER_SHORT_ARG;
-export _OPTS_GROFFER_LONG_NA;
-export _OPTS_GROFFER_LONG_ARG;
-export _OPTS_GROFF_SHORT_NA;
-export _OPTS_GROFF_SHORT_ARG;
-export _OPTS_GROFF_LONG_NA;
-export _OPTS_GROFF_LONG_ARG;
-export _OPTS_X_SHORT_ARG;
-export _OPTS_X_SHORT_NA;
-export _OPTS_X_LONG_ARG;
-export _OPTS_X_LONG_NA;
-export _OPTS_MAN_SHORT_ARG;
-export _OPTS_MAN_SHORT_NA;
-export _OPTS_MAN_LONG_ARG;
-export _OPTS_MAN_LONG_NA;
-export _OPTS_MANOPT_SHORT_ARG;
-export _OPTS_MANOPT_SHORT_NA;
-export _OPTS_MANOPT_LONG_ARG;
-export _OPTS_MANOPT_LONG_NA;
-export _OPTS_CMDLINE_SHORT_NA;
-export _OPTS_CMDLINE_SHORT_ARG;
-export _OPTS_CMDLINE_LONG_NA;
-export _OPTS_CMDLINE_LONG_ARG;
-
-###### groffer native options
-
-_OPTS_GROFFER_SHORT_NA="'h' 'Q' 'v' 'V' 'X' 'Z'";
-_OPTS_GROFFER_SHORT_ARG="'T'";
-
-_OPTS_GROFFER_LONG_NA="'auto' 'debug' 'default' 'dvi' \
-'groff' 'help' 'intermediate-output' 'html' 'man' \
-'no-location' 'no-man' 'pdf' 'ps' 'rv' 'source' 'text' 'text-device' \
-'title' 'tty' 'tty-device' 'version' 'whatis' 'where' 'www' 'x' 'X'";
-
-_OPTS_GROFFER_LONG_ARG="\
-'apropos' 'apropos-data' 'apropos-devel' 'apropos-progs' \
-'default-modes' 'device' 'dvi-viewer' 'extension' 'fg' 'fn' 'font' \
-'foreground' 'html-viewer' 'mode' 'pdf-viewer' 'ps-viewer' 'shell' \
-'tty-viewer' 'www-viewer' 'x-viewer' 'X-viewer'";
-
-##### groffer options inhereted from groff
-
-_OPTS_GROFF_SHORT_NA="'a' 'b' 'c' 'C' 'e' 'E' 'g' 'G' 'i' 'l' 'N' 'p' \
-'R' 's' 'S' 't' 'U' 'z'";
-_OPTS_GROFF_SHORT_ARG="'d' 'f' 'F' 'I' 'L' 'm' 'M' 'n' 'o' 'P' 'r' \
-'w' 'W'";
-_OPTS_GROFF_LONG_NA="";
-_OPTS_GROFF_LONG_ARG="";
-
-##### groffer options inhereted from the X Window toolkit
-
-_OPTS_X_SHORT_NA="";
-_OPTS_X_SHORT_ARG="";
-
-_OPTS_X_LONG_NA="'iconic' 'rv'";
-
-_OPTS_X_LONG_ARG="'background' 'bd' 'bg' 'bordercolor' 'borderwidth' \
-'bw' 'display' 'fg' 'fn' 'font' 'foreground' 'ft', 'geometry'
-'resolution' 'title' 'xrm'";
-
-###### groffer options inherited from man
-
-_OPTS_MAN_SHORT_NA="";
-_OPTS_MAN_SHORT_ARG="";
-
-_OPTS_MAN_LONG_NA="'all' 'ascii' 'catman' 'debug' 'ditroff' 'help' \
-'local-file' 'location' 'pager' 'troff' 'update' 'version' \
-'whatis' 'where'";
-
-_OPTS_MAN_LONG_ARG="'extension' 'locale' 'manpath' \
-'pager' 'preprocessor' 'prompt' 'sections' 'systems' 'troff-device'";
-
-###### additional options for parsing $MANOPT only
-
-_OPTS_MANOPT_SHORT_NA="'7' 'a' 'c' 'd' 'D' 'f' 'h' 'k' 'l' 't' 'u' \
-'V' 'w' 'Z'";
-_OPTS_MANOPT_SHORT_ARG="'e' 'L' 'm' 'M' 'p' 'P' 'r' 'S' 'T'";
-
-_OPTS_MANOPT_LONG_NA="${_OPTS_MAN_LONG_NA} \
-'apropos' 'debug' 'default' 'html' 'ignore-case' 'location-cat' \
-'match-case' 'troff' 'update' 'version' 'where-cat'";
-
-_OPTS_MANOPT_LONG_ARG="${_OPTS_MAN_LONG_NA} \
-'config_file' 'encoding' 'locale'";
-
-###### collections of command line options
-
-_OPTS_CMDLINE_SHORT_NA="${_OPTS_GROFFER_SHORT_NA}\
-${_OPTS_GROFF_SHORT_NA} ${_OPTS_X_SHORT_NA} ${_OPTS_MAN_SHORT_NA}";
-_OPTS_CMDLINE_SHORT_ARG="${_OPTS_GROFFER_SHORT_ARG} \
-${_OPTS_GROFF_SHORT_ARG} ${_OPTS_X_SHORT_ARG} ${_OPTS_MAN_SHORT_ARG}";
-
-_OPTS_CMDLINE_LONG_NA="${_OPTS_GROFFER_LONG_NA} \
-${_OPTS_GROFF_LONG_NA} ${_OPTS_X_LONG_NA} ${_OPTS_MAN_LONG_NA}";
-_OPTS_CMDLINE_LONG_ARG="${_OPTS_GROFFER_LONG_ARG} \
-${_OPTS_GROFF_LONG_ARG} ${_OPTS_MAN_LONG_ARG} ${_OPTS_X_LONG_ARG}";
-
-
-########################################################################
-# read-write variables (global to this file)
-########################################################################
-
-export _ADDOPTS_GROFF;		# Transp. options for groff (`eval').
-export _ADDOPTS_POST;		# Transp. options postproc (`eval').
-export _ADDOPTS_X;		# Transp. options X postproc (`eval').
-export _DEFAULT_MODES;		# Set default modes.
-export _DISPLAY_MODE;		# Display mode.
-export _DISPLAY_PROG;		# Viewer program to be used for display.
-export _DISPLAY_ARGS;		# X resources for the viewer program.
-export _FILEARGS;		# Stores filespec parameters.
-export _FUNC_STACK;		# Store debugging information.
-export _REGISTERED_TITLE;	# Processed file names.
-# _HAS_* from availability tests
-export _HAS_COMPRESSION;	# `yes' if gzip compression is available
-export _HAS_BZIP;		# `yes' if bzip2 compression is available
-# _MAN_* finally used configuration of man searching
-export _MAN_ALL;		# search all man pages per filespec
-export _MAN_ENABLE;		# enable search for man pages
-export _MAN_EXT;		# extension for man pages
-export _MAN_FORCE;		# force file parameter to be man pages
-export _MAN_IS_SETUP;		# setup man variables only once
-export _MAN_LANG;		# language for man pages
-export _MAN_LANG2;		# language for man pages
-export _MAN_LANG_DONE;		# language dirs added to man path
-export _MAN_PATH;		# search path for man pages
-export _MAN_SEC;		# sections for man pages; sep. `:'
-export _MAN_SEC_DONE;		# sections added to man path
-export _MAN_SYS;		# system names for man pages; sep. `,'
-export _MAN_SYS;		# system names added to man path
-# _MANOPT_* as parsed from $MANOPT
-export _MANOPT_ALL;		# $MANOPT --all
-export _MANOPT_EXTENSION;	# $MANOPT --extension
-export _MANOPT_LANG;		# $MANOPT --locale
-export _MANOPT_PATH;		# $MANOPT --manpath
-export _MANOPT_PAGER;		# $MANOPT --pager
-export _MANOPT_SEC;		# $MANOPT --sections
-export _MANOPT_SYS;		# $MANOPT --systems
-# _OPT_* as parsed from groffer command line
-export _OPT_ALL;		# display all suitable man pages.
-export _OPT_APROPOS;		# call `apropos' program.
-export _OPT_APROPOS_DATA;	# `apropos' for man sections 4, 5, 7
-export _OPT_APROPOS_DEVEL;	# `apropos' for man sections 2, 3, 9
-export _OPT_APROPOS_PROGS;	# `apropos' for man sections 1, 6, 8
-export _OPT_BD;			# set border color in some modes.
-export _OPT_BG;			# set background color in some modes.
-export _OPT_BW;			# set border width in some modes.
-export _OPT_DEBUG;		# print debugging information on stderr.
-export _OPT_DEFAULT_MODES;	# `,'-list of modes when no mode given.
-export _OPT_DEVICE;		# device option.
-export _OPT_DISPLAY;		# set X display.
-export _OPT_FG;			# set foreground color in some modes.
-export _OPT_FN;			# set font in some modes.
-export _OPT_GEOMETRY;		# set size and position of viewer in X.
-export _OPT_ICONIC;		# -iconic option for X viewers.
-export _OPT_LANG;		# set language for man pages
-export _OPT_LOCATION;		# print processed file names to stderr
-export _OPT_MODE;		# values: X, tty, Q, Z, ""
-export _OPT_MANPATH;		# manual setting of path for man-pages
-export _OPT_PAGER;		# specify paging program for tty mode
-export _OPT_RESOLUTION;		# set X resolution in dpi
-export _OPT_RV;			# reverse fore- and background colors.
-export _OPT_SECTIONS;		# sections for man page search
-export _OPT_SYSTEMS;		# man pages of different OS's
-export _OPT_TITLE;		# title for gxditview window
-export _OPT_TEXT_DEVICE;	# set device for tty mode.
-export _OPT_V;			# groff option -V.
-export _OPT_VIEWER_DVI;		# viewer program for dvi mode
-export _OPT_VIEWER_PDF;		# viewer program for pdf mode
-export _OPT_VIEWER_PS;		# viewer program for ps mode
-export _OPT_VIEWER_HTML;	# viewer program for html mode
-export _OPT_VIEWER_X;		# viewer program for x mode
-export _OPT_WHATIS;		# print the one-liner man info
-export _OPT_XRM;		# specify X resource.
-export _OPT_Z;			# groff option -Z.
-# _TMP_* temporary files
-export _TMP_DIR;		# groffer directory for temporary files
-export _TMP_CAT;		# stores concatenation of everything
-export _TMP_STDIN;		# stores stdin, if any
-
-# these variables are preset in section `Preset' after the rudim. test
-
-
-########################################################################
-#             Test of rudimentary shell functionality
-########################################################################
-
-
-########################################################################
-# Test of `test'.
-#
-test "a" = "a" || exit 1;
-
-
-########################################################################
-# Test of `echo' and the `$()' construct.
-#
-echo '' >${_NULL_DEV} || exit "${_ERROR}";
-if test _"$(t1="$(echo te)" &&
-            t2="$(echo '')" &&
-            t3="$(echo 'st')" &&
-            echo "${t1}${t2}${t3}")"_ \
-     != _test_;
-then
-  exit "${_ERROR}";
-fi;
-
-
-########################################################################
-# Test of function definitions.
-#
-_t_e_s_t_f_u_n_c_()
-{
-  return "${_OK}";
-}
-
-if _t_e_s_t_f_u_n_c_ 2>${_NULL_DEV};
-then
-  :
-else
-  echo 'shell does not support function definitions.' >&2;
-  exit "${_ERROR}";
-fi;
-
-
-########################################################################
-# Preset and reset of read-write global variables
-########################################################################
-
-
-# For variables that can be reset by option `--default', see reset().
-
-_FILEARGS='';
-
-# _HAS_* from availability tests
-_HAS_COMPRESSION='';
-_HAS_BZIP='';
-
-# _TMP_* temporary files
-_TMP_DIR='';
-_TMP_CAT='';
-_TMP_STDIN='';
-
-
-########################################################################
-# reset ()
-#
-# Reset the variables that can be affected by options to their default.
-#
-reset()
-{
-  if test "$#" -ne 0;
-  then
-    error "reset() does not have arguments.";
-  fi;
-
-  _ADDOPTS_GROFF='';
-  _ADDOPTS_POST='';
-  _ADDOPTS_X='';
-  _DISPLAY_ARGS='';
-  _DISPLAY_MODE='';
-  _DISPLAY_PROG='';
-  _REGISTERED_TITLE='';
-
-  # _MAN_* finally used configuration of man searching
-  _MAN_ALL='no';
-  _MAN_ENABLE='yes';		# do search for man-pages
-  _MAN_EXT='';
-  _MAN_FORCE='no';		# first local file, then search man page
-  _MAN_IS_SETUP='no';
-  _MAN_LANG='';
-  _MAN_LANG2='';
-  _MAN_PATH='';
-  _MAN_SEC='';
-  _MAN_SEC_DONE='no';
-  _MAN_SYS='';
-  _MAN_SYS_DONE='no';
-
-  # _MANOPT_* as parsed from $MANOPT
-  _MANOPT_ALL='no';
-  _MANOPT_EXTENSION='';
-  _MANOPT_LANG='';
-  _MANOPT_PATH='';
-  _MANOPT_PAGER='';
-  _MANOPT_SEC='';
-  _MANOPT_SYS='';
-
-  # _OPT_* as parsed from groffer command line
-  _OPT_ALL='no';
-  _OPT_APROPOS='';
-  _OPT_APROPOS_DATA='';
-  _OPT_APROPOS_DEVEL='';
-  _OPT_APROPOS_PROGS='';
-  _OPT_BD='';
-  _OPT_BG='';
-  _OPT_BW='';
-  _OPT_DEBUG='no';
-  _OPT_DEFAULT_MODES='';
-  _OPT_DEVICE='';
-  _OPT_DISPLAY='';
-  _OPT_FG='';
-  _OPT_FN='';
-  _OPT_GEOMETRY='';
-  _OPT_ICONIC='no';
-  _OPT_LANG='';
-  _OPT_LOCATION='no';
-  _OPT_MODE='';
-  _OPT_MANPATH='';
-  _OPT_PAGER='';
-  _OPT_RESOLUTION='';
-  _OPT_RV='no';
-  _OPT_SECTIONS='';
-  _OPT_SYSTEMS='';
-  _OPT_TITLE='';
-  _OPT_TEXT_DEVICE='';
-  _OPT_V='no';
-  _OPT_VIEWER_DVI='';
-  _OPT_VIEWER_PDF='';
-  _OPT_VIEWER_PS='';
-  _OPT_VIEWER_HTML='';
-  _OPT_VIEWER_X='';
-  _OPT_WHATIS='no';
-  _OPT_XRM='';
-  _OPT_Z='no';
-
-}
-
-reset;
-
-
-########################################################################
-#          Functions for error handling and debugging
-########################################################################
-
-
-##############
-# echo2 (<text>*)
-#
-# Output to stderr.
-#
-# Arguments : arbitrary text.
-#
-echo2()
-{
-  cat >&2 <<EOF
-$*
-EOF
-}
-
-
-##############
-# landmark (<text>)
-#
-# Print <text> to standard error as a debugging aid.
-#
-# Globals: $_DEBUG_LM
-#
-landmark()
-{
-  if test _"${_DEBUG_LM}"_ = _yes_;
-  then
-    echo2 "LM: $*" >&2;
-  fi;
-}
-
-landmark "1: debugging functions";
-
-
-##############
-# clean_up ()
-#
-# Clean up at exit.
-#
-clean_up()
-{
-  if test -d "${_TMP_DIR}";
-  then
-    eval rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
-  fi;
-}
-
-
-#############
-# diag (text>*)
-#
-# Output a diagnostic message to stderr
-#
-diag()
-{
-  echo2 '>>>>>'"$*";
-}
-
-
-#############
-# error (<text>*)
-#
-# Print an error message to standard error; exit with an error condition
-#
-# Variable prefix: err
-#
-error()
-{
-  err_code="${_ERROR}";
-  case "$#" in
-    0) :; ;;
-    1) echo2 'groffer error: '"$1"; ;;
-    2)
-      echo2 'groffer error: '"$1";
-      err_code="$2";
-      ;;
-    *) echo2 'groffer error: wrong number of arguments in error().'; ;;
-  esac;
-  func_stack_dump;
-  clean_up;
-  kill "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
-  kill -9 "${_PROCESS_ID}" >${_NULL_DEV} 2>&1;
-  n="${err_code}";
-  eval ${_UNSET} err_code;
-  exit "$n";
-}
-
-
-#############
-# abort (<text>*)
-#
-# Terminate program with error condition
-#
-abort()
-{
-  error "abort(): Program aborted.";
-  exit 1;
-}
-
-
-#############
-# func_check (<func_name> <rel_op> <nr_args> "$@")
-#
-# Check number of arguments and register to _FUNC_STACK.
-#
-# Arguments: >=3
-#   <func_name>: name of the calling function.
-#   <rel_op>:    a relational operator: = != < > <= >=
-#   <nr_args>:   number of arguments to be checked against <operator>
-#   "$@":        the arguments of the calling function.
-#
-# Variable prefix: fc
-#
-func_check()
-{
-  if test "$#" -lt 3;
-  then
-    error 'func_check() needs at least 3 arguments.';
-  fi;
-  fc_fname="$1";
-  case "$3" in
-    1)
-      fc_nargs="$3";
-      fc_s='';
-      ;;
-    0|[2-9])
-      fc_nargs="$3";
-      fc_s='s';
-      ;;
-    *)
-      error "func_check(): third argument must be a digit.";
-      ;;
-  esac;
-  case "$2" in
-    '='|'-eq')
-      fc_op='-eq';
-      fc_comp='exactly';
-      ;;
-    '>='|'-ge')
-      fc_op='-ge';
-      fc_comp='at least';
-      ;;
-    '<='|'-le')
-      fc_op='-le';
-      fc_comp='at most';
-      ;;
-    '<'|'-lt')
-      fc_op='-lt';
-      fc_comp='less than';
-      ;;
-    '>'|'-gt')
-      fc_op='-gt';
-      fc_comp='more than';
-      ;;
-    '!='|'-ne')
-      fc_op='-ne';
-      fc_comp='not';
-      ;;
-    *)
-      error \
-        'func_check(): second argument is not a relational operator.';
-      ;;
-  esac;
-  shift;
-  shift;
-  shift;
-  if test "$#" "${fc_op}" "${fc_nargs}";
-  then
-    do_nothing;
-  else
-    error "func_check(): \
-${fc_fname}"'() needs '"${fc_comp} ${fc_nargs}"' argument'"${fc_s}"'.';
-  fi;
-  func_push "${fc_fname}";
-  if test _"${_DEBUG}"_ = _yes_;
-  then
-    echo2 '+++ '"${fc_fname} $@";
-    echo2 '>>> '"${_FUNC_STACK}";
-  fi;
-  eval ${_UNSET} fc_comp;
-  eval ${_UNSET} fc_fname;
-  eval ${_UNSET} fc_nargs;
-  eval ${_UNSET} fc_op;
-  eval ${_UNSET} fc_s;
-}
-
-
-#############
-# func_pop ()
-#
-# Retrieve the top element from the stack.
-#
-# The stack elements are separated by `!'; the popped element is
-# identical to the original element, except that all `!' characters
-# were removed.
-#
-# Arguments: 1
-#
-func_pop()
-{
-  if test "$#" -ne 0;
-  then
-    error 'func_pop() does not have arguments.';
-  fi;
-  case "${_FUNC_STACK}" in
-  '')
-    if test _"${_DEBUG}"_ = _yes_;
-    then
-      error 'func_pop(): stack is empty.';
-    fi;
-    ;;
-  *!*)
-    # split at first bang `!'.
-   _FUNC_STACK="$(echo x"${_FUNC_STACK}" | sed -e '
-s/^x//
-s/^[^!]*!//
-')";
-    ;;
-  *)
-    _FUNC_STACK='';
-    ;;
-  esac;
-  if test _"${_DEBUG}"_ = _yes_;
-  then
-    echo2 '<<< '"${_FUNC_STACK}";
-  fi;
-}
-
-
-#############
-# func_push (<element>)
-#
-# Store another element to stack.
-#
-# The stack elements are separated by `!'; if <element> contains a `!'
-# it is removed first.
-#
-# Arguments: 1
-#
-# Variable prefix: fp
-#
-func_push()
-{
-  if test "$#" -ne 1;
-  then
-    error 'func_push() needs 1 argument.';
-  fi;
-  case "$1" in
-  *'!'*)
-    # remove all bangs `!'.
-    fp_element="$(echo x"$1" | sed -e '
-s/^x//
-s/!//g
-')";
-    ;;
-  *)
-    fp_element="$1";
-    ;;
-  esac;
-  if test _"${_FUNC_STACK}"_ = __;
-  then
-    _FUNC_STACK="${fp_element}";
-  else
-    _FUNC_STACK="${fp_element}!${_FUNC_STACK}";
-  fi;
-  eval ${_UNSET} fp_element;
-}
-
-
-#############
-# func_stack_dump ()
-#
-# Print the content of the stack.  Ignore the arguments.
-#
-func_stack_dump()
-{
-  diag 'call stack: '"${_FUNC_STACK}";
-}
-
-
-########################################################################
-#                        System Test
-########################################################################
-
-landmark "2: system test";
-
-# Test the availability of the system utilities used in this script.
-
-
-########################################################################
-# Test of function `sed'.
-#
-
-if test _"$(echo xTesTx \
-           | sed -e 's/^.\([Tt]e*x*sTT*\).*$/\1/' \
-           | sed -e 's|T|t|g')"_ != _test_;
-then
-  error 'Test of "sed" command failed.';
-fi;
-
-
-########################################################################
-# Test of function `cat'.
-#
-if test _"$(echo test | cat)"_ != _test_;
-then
-  error 'Test of "cat" command failed.';
-fi;
-
-
-########################################################################
-# Test for compression.
-#
-if test _"$(echo 'test' | gzip -c -d -f - 2>${_NULL_DEV})"_ = _test_;
-then
-  _HAS_COMPRESSION='yes';
-  if echo 'test' | bzip2 -c 2>${_NULL_DEV} | bzip2 -t 2>${_NULL_DEV} \
-     && test _"$(echo 'test' | bzip2 -c 2>${_NULL_DEV} \
-                             | bzip2 -d -c 2>${_NULL_DEV})"_ \
-             = _test_;
-  then
-    _HAS_BZIP='yes';
-  else
-    _HAS_BZIP='no';
-  fi;
-else
-  _HAS_COMPRESSION='no';
-  _HAS_BZIP='no';
-fi;
-
-
-########################################################################
-#       Definition of normal Functions in alphabetical order
-########################################################################
-landmark "3: functions";
-
-########################################################################
-# abort (<text>*)
-#
-# Unconditionally terminate the program with error code;
-# useful for debugging.
-#
-# defined above
-
-
-########################################################################
-# apropos_run (<name>)
-#
-#
-apropos_run() {
-  func_check apropos_run = 1 "$@";
-  if apropos apropos >${_NULL_DEV} 2>${_NULL_DEV};
-  then
-    apropos "$1";
-  elif man --apropos man >${_NULL_DEV} 2>${_NULL_DEV};
-  then
-    man --apropos "$1";
-  elif man -k man >${_NULL_DEV} 2>${_NULL_DEV};
-  then
-    man -k "$1";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# base_name (<path>)
-#
-# Get the file name part of <path>, i.e. delete everything up to last
-# `/' from the beginning of <path>.  Remove final slashes, too, to get a
-# non-empty output.
-#
-# Arguments : 1
-# Output    : the file name part (without slashes)
-#
-# Variable prefix: bn
-#
-base_name()
-{
-  func_check base_name = 1 "$@";
-  bn_name="$1";
-  case "${bn_name}" in
-    */)
-      # delete all final slashes
-      bn_name="$(echo x"${bn_name}" | sed -e '
-s/^x//
-s|//*$||
-')";
-      ;;
-  esac;
-  case "${bn_name}" in
-    /|'')
-      eval ${_UNSET} bn_name;
-      eval "${return_bad}";
-      ;;
-    */*)
-      # delete everything before and including the last slash `/'.
-      echo x"${bn_name}" | sed -e '
-s/^x//
-s|^.*//*\([^/]*\)$|\1|
-';
-      ;;
-    *)
-      cat <<EOF
-${bn_name}
-EOF
-      ;;
-  esac;
-  eval ${_UNSET} bn_name;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# cat_z (<file>)
-#
-# Decompress if possible or just print <file> to standard output.
-#
-# gzip, bzip2, and .Z decompression is supported.
-#
-# Arguments: 1, a file name.
-# Output: the content of <file>, possibly decompressed.
-#
-if test _"${_HAS_COMPRESSION}"_ = _yes_;
-then
-  cat_z()
-  {
-    func_check cat_z = 1 "$@";
-    case "$1" in
-      '')
-        error 'cat_z(): empty file name';
-        ;;
-      '-')
-        error 'cat_z(): for standard input use save_stdin()';
-        ;;
-    esac;
-    if obj _HAS_BZIP is_yes;
-    then
-      if bzip2 -t "$1" 2>${_NULL_DEV};
-      then
-        bzip2 -c -d "$1" 2>${_NULL_DEV};
-        eval "${return_ok}";
-      fi;
-    fi;
-    gzip -c -d -f "$1" 2>${_NULL_DEV};
-    eval "${return_ok}";
-  }
-else
-  cat_z()
-  {
-    func_check cat_z = 1 "$@";
-    cat "$1";
-    eval "${return_ok}";
-  }
-fi;
-
-
-########################################################################
-# clean_up ()
-#
-# Do the final cleaning up before exiting; used by the trap calls.
-#
-# defined above
-
-
-########################################################################
-# diag (<text>*)
-#
-# Print marked message to standard error; useful for debugging.
-#
-# defined above
-
-
-########################################################################
-landmark '4: dirname()*';
-########################################################################
-
-#######################################################################
-# dirname_append (<dir> <name>)
-#
-# Append `name' to `dir' with clean handling of `/'.
-#
-# Arguments : 2
-# Output    : the generated new directory name <dir>/<name>
-#
-dirname_append()
-{
-  func_check dirname_append = 2 "$@";
-  if is_empty "$1";
-  then
-    error "dir_append(): first argument is empty.";
-  fi;
-  if is_empty "$2";
-  then
-    cat <<EOF
-$1
-EOF
-  else
-    dirname_chop "$1"/"$2";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# dirname_chop (<name>)
-#
-# Remove unnecessary slashes from directory name.
-#
-# Argument: 1, a directory name.
-# Output:   path without double, or trailing slashes.
-#
-# Variable prefix: dc
-#
-dirname_chop()
-{
-  func_check dirname_chop = 1 "$@";
-  # replace all multiple slashes by a single slash `/'.
-  dc_res="$(echo x"$1" | sed -e '
-s/^x//
-s|///*|/|g
-')";
-  case "${dc_res}" in
-    ?*/)
-      # remove trailing slash '/';
-      echo x"${dc_res}" | sed -e '
-s/^x//
-s|/$||
-';
-      ;;
-    *) cat <<EOF
-${dc_res}
-EOF
-  ;;
-  esac;
-  eval ${_UNSET} dc_res;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# do_filearg (<filearg>)
-#
-# Append the file, man-page, or standard input corresponding to the
-# argument to the temporary file.  If this is compressed in the gzip
-# or Z format it is decompressed.  A title element is generated.
-#
-# Argument either:
-#   - name of an existing files.
-#   - `-' to represent standard input (several times allowed).
-#   - `man:name.(section)' the man-page for `name' in `section'.
-#   - `man:name.section' the man-page for `name' in `section'.
-#   - `man:name' the man-page for `name' in the lowest `section'.
-#   - `name.section' the man-page for `name' in `section'.
-#   - `name' the man-page for `name' in the lowest `section'.
-# Globals :
-#   $_TMP_STDIN, $_MAN_ENABLE, $_MAN_IS_SETUP, $_OPT_MAN
-#
-# Output  : none
-# Return  : $_GOOD if found, ${_BAD} otherwise.
-#
-# Variable prefix: df
-#
-do_filearg()
-{
-  func_check do_filearg = 1 "$@";
-  df_filespec="$1";
-  # store sequence into positional parameters
-  case "${df_filespec}" in
-    '')
-       eval ${_UNSET} df_filespec;
-       eval "${return_good}";
-       ;;
-    '-')
-      register_file '-';
-      eval ${_UNSET} df_filespec;
-      eval "${return_good}";
-      ;;
-    */*)			# with directory part; so no man search
-      set 'File';
-      ;;
-    *)
-      if obj _MAN_ENABLE is_yes;
-      then
-        if obj _MAN_FORCE is_yes;
-        then
-          set 'Manpage' 'File';
-        else
-          set 'File' 'Manpage';
-        fi;
-      else
-        set 'File';
-      fi;
-      ;;
-  esac;
-  for i
-  do
-    case "$i" in
-      File)
-        if test -f "${df_filespec}";
-        then
-          if test -r "${df_filespec}";
-          then
-            register_file "${df_filespec}";
-            eval ${_UNSET} df_filespec;
-            eval "${return_good}";
-          else
-	    echo2 "could not read \`${df_filespec}'";
-            eval ${_UNSET} df_filespec;
-            eval "${return_bad}";
-          fi;
-        else
-          continue;
-        fi;
-        ;;
-      Manpage)			# parse filespec as man page
-        if obj _MAN_IS_SETUP is_not_yes;
-        then
-          man_setup;
-        fi;
-        if man_do_filespec "${df_filespec}";
-        then
-          eval ${_UNSET} df_filespec;
-          eval "${return_good}";
-        else
-          continue;
-	fi;
-        ;;
-    esac;
-  done;
-  eval ${_UNSET} df_filespec;
-  eval "${return_bad}";
-} # do_filearg()
-
-
-########################################################################
-# do_nothing ()
-#
-# Dummy function.
-#
-do_nothing()
-{
-  eval return "${_OK}";
-}
-
-
-########################################################################
-# echo2 (<text>*)
-#
-# Print to standard error with final line break.
-#
-# defined above
-
-
-########################################################################
-# error (<text>*)
-#
-# Print error message and exit with error code.
-#
-# defined above
-
-
-########################################################################
-# func_check (<func_name> <rel_op> <nr_args> "$@")
-#
-# Check number of arguments and register to _FUNC_STACK.
-#
-# Arguments: >=3
-#   <func_name>: name of the calling function.
-#   <rel_op>:    a relational operator: = != < > <= >=
-#   <nr_args>:   number of arguments to be checked against <operator>
-#   "$@":        the arguments of the calling function.
-#
-# defined above
-
-#########################################################################
-# func_pop ()
-#
-# Delete the top element from the function call stack.
-#
-# defined above
-
-
-########################################################################
-# func_push (<element>)
-#
-# Store another element to function call stack.
-#
-# defined above
-
-
-########################################################################
-# func_stack_dump ()
-#
-# Print the content of the stack.
-#
-# defined above
-
-
-########################################################################
-# get_first_essential (<arg>*)
-#
-# Retrieve first non-empty argument.
-#
-# Return  : `1' if all arguments are empty, `0' if found.
-# Output  : the retrieved non-empty argument.
-#
-# Variable prefix: gfe
-#
-get_first_essential()
-{
-  func_check get_first_essential '>=' 0 "$@";
-  if is_equal "$#" 0;
-  then
-    eval "${return_ok}";
-  fi;
-  for i
-  do
-    gfe_var="$i";
-    if obj gfe_var is_not_empty;
-    then
-      cat <<EOF
-${gfe_var}
-EOF
-      eval ${_UNSET} gfe_var;
-      eval "${return_ok}";
-    fi;
-  done;
-  eval ${_UNSET} gfe_var;
-  eval "${return_bad}";
-}
-
-
-########################################################################
-landmark '5: is_*()';
-########################################################################
-
-########################################################################
-# is_dir (<name>)
-#
-# Test whether `name' is a directory.
-#
-# Arguments : 1
-# Return    : `0' if arg1 is a directory, `1' otherwise.
-#
-is_dir()
-{
-  func_check is_dir = 1 "$@";
-  if test -d "$1" && test -r "$1";
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_empty (<string>)
-#
-# Test whether `string' is empty.
-#
-# Arguments : <=1
-# Return    : `0' if arg1 is empty or does not exist, `1' otherwise.
-#
-is_empty()
-{
-  func_check is_empty = 1 "$@";
-  if test _"$1"_ = __;
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_equal (<string1> <string2>)
-#
-# Test whether `string1' is equal to <string2>.
-#
-# Arguments : 2
-# Return    : `0' both arguments are equal strings, `1' otherwise.
-#
-is_equal()
-{
-  func_check is_equal = 2 "$@";
-  if test _"$1"_ = _"$2"_;
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_existing (<name>)
-#
-# Test whether `name' is an existing file or directory.  Solaris 2.5 does
-# not have `test -e'.
-#
-# Arguments : 1
-# Return    : `0' if arg1 exists, `1' otherwise.
-#
-is_existing()
-{
-  func_check is_existing = 1 "$@";
-  if test -f "$1" || test -d "$1";
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_file (<name>)
-#
-# Test whether `name' is a readable file.
-#
-# Arguments : 1
-# Return    : `0' if arg1 is a readable file, `1' otherwise.
-#
-is_file()
-{
-  func_check is_file = 1 "$@";
-  if test -f "$1" && test -r "$1";
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_non_empty_file (<file_name>)
-#
-# Test whether `file_name' is a non-empty existing file.
-#
-# Arguments : <=1
-# Return    :
-#   `0' if arg1 is a non-empty existing file
-#   `1' otherwise
-#
-is_non_empty_file()
-{
-  func_check is_non_empty_file = 1 "$@";
-  if is_file "$1" && test -s "$1";
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_not_dir (<name>)
-#
-# Test whether `name' is not a readable directory.
-#
-# Arguments : 1
-# Return    : `0' if arg1 is a directory, `1' otherwise.
-#
-is_not_dir()
-{
-  func_check is_not_dir = 1 "$@";
-  if is_dir "$1";
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_empty (<string>)
-#
-# Test whether `string' is not empty.
-#
-# Arguments : <=1
-# Return    : `0' if arg1 exists and is not empty, `1' otherwise.
-#
-is_not_empty()
-{
-  func_check is_not_empty = 1 "$@";
-  if is_empty "$1";
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_equal (<string1> <string2>)
-#
-# Test whether `string1' differs from `string2'.
-#
-# Arguments : 2
-#
-is_not_equal()
-{
-  func_check is_not_equal = 2 "$@";
-  if is_equal "$1" "$2";
-  then
-    eval "${return_no}";
-  fi
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_file (<filename>)
-#
-# Test whether `name' is a not readable file.
-#
-# Arguments : >=1 (empty allowed), more args are ignored
-#
-is_not_file()
-{
-  func_check is_not_file '>=' 1 "$@";
-  if is_file "$1";
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_prog (<name>)
-#
-# Verify that arg is a not program in $PATH.
-#
-# Arguments : >=1 (empty allowed)
-#   more args are ignored, this allows to specify progs with arguments
-#
-is_not_prog()
-{
-  func_check is_not_prog '>=' 1 "$@";
-  if where_is "$1" >${_NULL_DEV};
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_writable (<name>)
-#
-# Test whether `name' is a not a writable file or directory.
-#
-# Arguments : >=1 (empty allowed), more args are ignored
-#
-is_not_writable()
-{
-  func_check is_not_writable '>=' 1 "$@";
-  if is_writable "$1";
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_not_yes (<string>)
-#
-# Test whether `string' is not "yes".
-#
-# Arguments : 1
-#
-is_not_yes()
-{
-  func_check is_not_yes = 1 "$@";
-  if is_yes "$1";
-  then
-    eval "${return_no}";
-  fi;
-  eval "${return_yes}";
-}
-
-
-########################################################################
-# is_prog (<name> [<arg>*])
-#
-# Determine whether <name> is a program in $PATH
-#
-# Arguments : >=0 (empty allowed)
-#   <arg>* are ignored, this allows to specify progs with arguments.
-#
-is_prog()
-{
-  func_check is_prog '>=' 0 "$@";
-  case "$#" in
-  0)
-    eval "${return_no}";
-    ;;
-  *)
-    if where_is "$1" >${_NULL_DEV};
-    then
-      eval "${return_yes}";
-    fi;
-    ;;
-  esac
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_writable (<name>)
-#
-# Test whether `name' is a writable file or directory.
-#
-# Arguments : >=1 (empty allowed), more args are ignored
-#
-is_writable()
-{
-  func_check is_writable '>=' 1 "$@";
-  if test -r "$1";
-  then
-    if test -w "$1";
-    then
-      eval "${return_yes}";
-    fi;
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# is_yes (<string>)
-#
-# Test whether `string' has value "yes".
-#
-# Arguments : <=1
-# Return    : `0' if arg1 is `yes', `1' otherwise.
-#
-is_yes()
-{
-  func_check is_yes = 1 "$@";
-  if is_equal "$1" 'yes';
-  then
-    eval "${return_yes}";
-  fi;
-  eval "${return_no}";
-}
-
-
-########################################################################
-# landmark ()
-#
-# Print debugging information on standard error if $_DEBUG_LM is `yes'.
-#
-# Globals: $_DEBUG_LM
-#
-# Defined in section `Debugging functions'.
-
-
-########################################################################
-# leave ()
-#
-# Clean exit without an error.
-#
-leave()
-{
-  clean_up;
-  exit "${_OK}";
-}
-
-
-########################################################################
-landmark '6: list_*()';
-########################################################################
-#
-# `list' is an object class that represents an array or list.  Its
-# data consists of space-separated single-quoted elements.  So a list
-# has the form "'first' 'second' '...' 'last'".  See list_append() for
-# more details on the list structure.  The array elements of `list'
-# can be get by `set x $list; shift`.
-
-
-########################################################################
-# list_append (<list> <element>...)
-#
-# Arguments: >=2
-#   <list>: a variable name for a list of single-quoted elements
-#   <element>:  some sequence of characters.
-# Output: none, but $<list> is set to
-#   if <list> is empty:  "'<element>' '...'"
-#   otherwise:           "$list '<element>' ..."
-#
-# Variable prefix: la
-#
-list_append()
-{
-  func_check list_append '>=' 2 "$@";
-  la_name="$1";
-  eval la_list='"${'$1'}"';
-  shift;
-  for s
-  do
-    la_s="$s";
-    case "${la_s}" in
-    *\'*)
-      # escape each single quote by replacing each
-      # "'" (squote) by "'\''" (squote bslash squote squote);
-      # note that the backslash must be doubled in the following `sed'
-      la_element="$(echo x"${la_s}" | sed -e '
-s/^x//
-s/'"${_SQUOTE}"'/&\\&&/g
-')";
-      ;;
-    '')
-      la_element="";
-      ;;
-    *)
-      la_element="${la_s}";
-      ;;
-    esac;
-    if obj la_list is_empty;
-    then
-      la_list="'${la_element}'";
-    else
-      la_list="${la_list} '${la_element}'";
-    fi;
-  done;
-  eval "${la_name}"='"${la_list}"';
-  eval ${_UNSET} la_element;
-  eval ${_UNSET} la_list;
-  eval ${_UNSET} la_name;
-  eval ${_UNSET} la_s;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# list_from_cmdline (<pre_name_of_opt_lists> [<cmdline_arg>...])
-#
-# Transform command line arguments into a normalized form.
-#
-# Options, option arguments, and file parameters are identified and
-# output each as a single-quoted argument of its own.  Options and
-# file parameters are separated by a '--' argument.
-#
-# Arguments: >=1
-#   <pre_name>: common part of a set of 4 environment variable names:
-#     $<pre_name>_SHORT_NA:  list of short options without an arg.
-#     $<pre_name>_SHORT_ARG: list of short options that have an arg.
-#     $<pre_name>_LONG_NA:   list of long options without an arg.
-#     $<pre_name>_LONG_ARG:  list of long options that have an arg.
-#   <cmdline_arg>...: the arguments from a command line, such as "$@",
-#                     the content of a variable, or direct arguments.
-#
-# Output: ['-[-]opt' ['optarg']]... '--' ['filename']...
-#
-# Example:
-#   list_from_cmdline PRE 'a b' 'c' '' 'long' -a f1 -bcarg --long=larg f2
-# If $PRE_SHORT_NA, $PRE_SHORT_ARG, $PRE_LONG_NA, and $PRE_LONG_ARG are
-# none-empty option lists, this will result in printing:
-#     '-a' '-b' '-c' 'arg' '--long' 'larg' '--' 'f1' 'f2'
-#
-#   Use this function in the following way:
-#     eval set x "$(args_norm PRE_NAME "$@")";
-#     shift;
-#     while test "$1" != '--'; do
-#       case "$1" in
-#       ...
-#       esac;
-#       shift;
-#     done;
-#     shift;         #skip '--'
-#     # all positional parameters ("$@") left are file name parameters.
-#
-# Variable prefix: lfc
-#
-list_from_cmdline()
-{
-  func_check list_from_cmdline '>=' 1 "$@";
-  lfc_short_n="$(obj_data "$1"_SHORT_NA)";  # short options, no argument
-  lfc_short_a="$(obj_data "$1"_SHORT_ARG)"; # short options, with argument
-  lfc_long_n="$(obj_data "$1"_LONG_NA)";    # long options, no argument
-  lfc_long_a="$(obj_data "$1"_LONG_ARG)";   # long options, with argument
-  if obj lfc_short_n is_empty;
-  then
-    error 'list_from_cmdline(): no $'"$1"'_SHORT_NA options.';
-  fi;
-  if obj lfc_short_a is_empty;
-  then
-    error 'list_from_cmdline(): no $'"$1"'_SHORT_ARG options.';
-  fi;
-  if obj lfc_long_n is_empty;
-  then
-    error 'list_from_cmdline(): no $'"$1"'_LONG_NA options.';
-  fi;
-  if obj lfc_long_a is_empty;
-  then
-    error 'list_from_cmdline(): no $'"$1"'_LONG_ARG options.';
-  fi;
-  shift;
-  lfc_fn='list_from_cmdline():';	 # for error messages
-  if is_equal "$#" 0;
-  then
-    cat <<EOF
---
-EOF
-    eval ${_UNSET} lfc_fparams;
-    eval ${_UNSET} lfc_fn;
-    eval ${_UNSET} lfc_short_a;
-    eval ${_UNSET} lfc_short_n;
-    eval ${_UNSET} lfc_long_a;
-    eval ${_UNSET} lfc_long_n;
-    eval ${_UNSET} lfc_result;
-    eval "${return_ok}";
-  fi;
-  lfc_fparams='';
-  lfc_result='';
-  while test "$#" -ge 1;
-  do
-    lfc_arg="$1";
-    shift;
-    case "${lfc_arg}" in
-      --) break; ;;
-      --?*)
-        # delete leading '--';
-        lfc_opt="$(echo x"${lfc_arg}" | sed -e 's/^x--//')";
-        if list_has lfc_long_n "${lfc_opt}";
-        then
-          # long option, no argument
-          list_append lfc_result "--${lfc_opt}";
-          continue;
-        fi;
-        # test on `--opt=arg'
-        if string_contains "${lfc_opt}" '=';
-        then
-          # extract option by deleting from the first '=' to the end
-          lfc_lopt="$(echo x"${lfc_opt}" | sed -e '
-s/^x//
-s/=.*$//
-')";
-          if list_has lfc_long_a "${lfc_lopt}";
-          then
-            # get the option argument by deleting up to first `='
-            lfc_optarg="$(echo x"${lfc_opt}" | sed -e '
-s/^x//
-s/^[^=]*=//
-')";
-            list_append lfc_result "--${lfc_lopt}" "${lfc_optarg}";
-            continue;
-          fi;
-        fi;
-        if list_has lfc_long_a "${lfc_opt}";
-        then
-          # long option with argument
-          if test "$#" -le 0;
-          then
-            error "list_from_cmdline(): \
-${lfc_fn} no argument for option --${lfc_opt}."
-          fi;
-          list_append lfc_result "--${lfc_opt}" "$1";
-          shift;
-          continue;
-        fi;
-        error "list_from_cmdline(): ${lfc_fn} --${lfc_opt} is not an option."
-        ;;
-      -?*)			# short option (cluster)
-        # delete leading `-';
-        lfc_rest="$(echo x"${lfc_arg}" | sed -e 's/^x-//')";
-        while obj lfc_rest is_not_empty;
-        do
-          # get next short option from cluster (first char of $lfc_rest)
-          lfc_optchar="$(echo x"${lfc_rest}" | sed -e 's/^x\(.\).*$/\1/')";
-          # remove first character from ${lfc_rest};
-          lfc_rest="$(echo x"${lfc_rest}" | sed -e 's/^x.//')";
-          if list_has lfc_short_n "${lfc_optchar}";
-          then
-            list_append lfc_result "-${lfc_optchar}";
-            continue;
-          elif list_has lfc_short_a "${lfc_optchar}";
-          then
-            if obj lfc_rest is_empty;
-            then
-              if test "$#" -ge 1;
-              then
-                list_append lfc_result "-${lfc_optchar}" "$1";
-                shift;
-                continue;
-              else
-                error "list_from_cmdline(): \
-${lfc_fn}"' no argument for option -'"${lfc_optchar}."
-              fi;
-            else		# rest is the argument
-              list_append lfc_result "-${lfc_optchar}" "${lfc_rest}";
-              lfc_rest='';
-              continue;
-            fi;
-          else
-            error "list_from_cmdline(): \
-${lfc_fn} unknown option -${lfc_optchar}."
-          fi;
-        done;
-        ;;
-      *)
-	# Here, $lfc_arg is not an option, so a file parameter.
-        list_append lfc_fparams "${lfc_arg}";
-
-        # Ignore the strange option handling of $POSIXLY_CORRECT to
-        # end option parsing after the first file name argument.  To
-        # reuse it, do a `break' here if $POSIXLY_CORRECT is
-        # non-empty.
-        ;;
-    esac;
-  done;
-  list_append lfc_result '--';
-  if obj lfc_fparams is_not_empty;
-  then
-    lfc_result="${lfc_result} ${lfc_fparams}";
-  fi;
-  if test "$#" -gt 0;
-  then
-    list_append lfc_result "$@";
-  fi;
-  cat <<EOF
-${lfc_result}
-EOF
-  eval ${_UNSET} lfc_fparams;
-  eval ${_UNSET} lfc_fn;
-  eval ${_UNSET} lfc_short_a;
-  eval ${_UNSET} lfc_short_n;
-  eval ${_UNSET} lfc_long_a;
-  eval ${_UNSET} lfc_long_n;
-  eval ${_UNSET} lfc_result;
-  eval ${_UNSET} lfc_arg;
-  eval ${_UNSET} lfc_opt;
-  eval ${_UNSET} lfc_opt_arg;
-  eval ${_UNSET} lfc_opt_char;
-  eval ${_UNSET} lfc_lopt;
-  eval ${_UNSET} lfc_rest;
-  eval "${return_ok}";
-} # list_from_cmdline()
-
-
-########################################################################
-# list_from_split (<string> <separator>)
-#
-# In <string>, escape all white space characters and replace each
-# <separator> by space.
-#
-# Arguments: 2: a <string> that is to be split into parts divided by
-#               <separator>
-# Output:    the resulting list string
-#
-# Variable prefix: lfs
-#
-list_from_split()
-{
-  func_check list_from_split = 2 "$@";
-
-  # precede each space or tab by a backslash `\' (doubled for `sed')
-  lfs_s="$(echo x"$1" | sed -e '
-s/^x//
-s/\(['"${_SPACE}${_TAB}"']\)/\\\1/g
-')";
-
-  # replace split character of string by the list separator ` ' (space).
-  case "$2" in
-    /)				# cannot use normal `sed' separator
-      echo x"${lfs_s}" | sed -e '
-s/^x//
-s|'"$2"'| |g
-';
-      ;;
-    ?)				# use normal `sed' separator
-      echo x"${lfs_s}" | sed -e '
-s/^x//
-s/'"$2"'/ /g
-';
-      ;;
-    ??*)
-      error 'list_from_split(): separator must be a single character.';
-      ;;
-  esac;
-  eval ${_UNSET} lfs_s;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# list_get (<list>)
-#
-# Check whether <list> is a space-separated list of '-quoted elements.
-#
-# If the test fails an error is raised.
-# If the test succeeds the argument is echoed.
-#
-# Testing criteria:
-#   A list has the form "'first' 'second' '...' 'last'".  So it has a
-#   leading and a final quote and the elements are separated by "' '"
-#   constructs.  If these are all removed there should not be any
-#   unescaped single-quotes left.  Watch out for escaped single
-#   quotes; they have the form '\'' (sq bs sq sq).
-
-# Arguments: 1
-# Output: the argument <list> unchanged, if the check succeeded.
-#
-# Variable prefix: lg
-#
-list_get()
-{
-  func_check list_get = 1 "$@";
-  eval lg_list='"${'$1'}"';
-  # remove leading and final space characters
-  lg_list="$(echo x"${lg_list}" | sed -e '
-s/^x['"${_SPACE}${_TAB}"']*//
-s/['"${_SPACE}${_TAB}"']*$//
-')";
-  case "${lg_list}" in
-  '')
-    eval ${_UNSET} lg_list;
-    eval "${return_ok}";
-    ;;
-  \'*\')
-    cat <<EOF
-${lg_list}
-EOF
-    eval ${_UNSET} lg_list;
-    eval "${return_ok}";
-    ;;
-  *)
-    error "list_get(): bad list: $1"
-    ;;
-  esac;
-  eval ${_UNSET} lg_list;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# list_has (<var_name> <element>)
-#
-# Arguments: 2
-#   <var_name>: a variable name for a list of single-quoted elements
-#   <element>:  some sequence of characters.
-# Output:
-#   if <list> is empty:  "'<element>' '...'"
-#   otherwise:           "list '<element>' ..."
-#
-list_has()
-{
-  func_check list_has = 2 "$@";
-  eval _list='"${'$1'}"';
-  if obj _list is_empty;
-  then
-    eval "${return_no}";
-  fi;
-  _element="$2";
-  case "$2" in
-    \'*\')  _element="$2"; ;;
-    *)      _element="'$2'"; ;;
-  esac;
-  if string_contains "${_list}" "${_element}";
-  then
-    eval "${return_yes}";
-  else
-    eval "${return_no}";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# list_has_not (<list> <element>)
-#
-# Arguments: 2
-#   <list>:    a space-separated list of single-quoted elements.
-#   <element>: some sequence of characters.
-# Output:
-#   if <list> is empty:  "'<element>' '...'"
-#   otherwise:           "<list> '<element>' ..."
-#
-list_has_not()
-{
-  func_check list_has_not = 2 "$@";
-  eval _list='"${'$1'}"';
-  if obj _list is_empty;
-  then
-    eval "${return_yes}";
-  fi;
-  _element="$2";
-  case "$2" in
-    \'*\')  _element="$2"; ;;
-    *)      _element="'$2'"; ;;
-  esac;
-  if string_contains "${_list}" "${_element}";
-  then
-    eval "${return_no}";
-  else
-    eval "${return_yes}";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-landmark '7: man_*()';
-########################################################################
-
-########################################################################
-# man_do_filespec (<filespec>)
-#
-# Print suitable man page(s) for filespec to $_TMP_CAT.
-#
-# Arguments : 2
-#   <filespec>: argument of the form `man:name.section', `man:name',
-#               `man:name(section)', `name.section', `name'.
-#
-# Globals   : $_OPT_ALL
-#
-# Output    : none.
-# Return    : `0' if man page was found, `1' else.
-#
-# Only called from do_fileargs(), checks on $MANPATH and
-# $_MAN_ENABLE are assumed.
-#
-# Variable prefix: mdf
-#
-man_do_filespec()
-{
-  func_check man_do_filespec = 1 "$@";
-  if obj _MAN_PATH is_empty;
-  then
-    eval "${return_bad}";
-  fi;
-  if is_empty "$1";
-  then
-    eval "${return_bad}";
-  fi;
-  mdf_spec="$1";
-  mdf_name='';
-  mdf_section='';
-  case "${mdf_spec}" in
-    */*)			# not a man spec when it contains '/'
-      eval ${_UNSET} mdf_got_one;
-      eval ${_UNSET} mdf_name;
-      eval ${_UNSET} mdf_section;
-      eval ${_UNSET} mdf_spec;
-      eval "${return_bad}";
-      ;;
-    man:?*\(?*\))		# man:name(section)
-      mdf_name="$(echo x"${mdf_spec}" \
-               | sed -e 's/^xman:\(..*\)(\(..*\))$/\1/')";
-      mdf_section="$(echo x"${mdf_spec}" \
-               | sed -e 's/^xman:\(..*\)(\(..*\))$/\2/')";
-      ;;
-    man:?*.[0-9on])			# man:name.section
-      mdf_name="$(echo x"${mdf_spec}" \
-               | sed -e 's/^xman:\(..*\)\..$/\1/')";
-      mdf_section="$(echo x"${mdf_spec}" \
-               | sed -e 's/^x.*\(.\)$/\1/')";
-      ;;
-    man:?*)			# man:name
-      mdf_name="$(echo x"${mdf_spec}" | sed -e 's/^xman://')";
-      ;;
-    ?*\(?*\))			# name(section)
-      mdf_name="$(echo x"${mdf_spec}" \
-               | sed -e 's/^x\(..*\)(\(..*\))$/\1/')";
-      mdf_section="$(echo x"${mdf_spec}" \
-               | sed -e 's/^x\(..*\)(\(..*\))$/\2/')";
-      ;;
-    ?*.[0-9on])			# name.section
-      mdf_name="$(echo x"${mdf_spec}" \
-               | sed -e 's/^x\(..*\)\..$/\1/')";
-      mdf_section="$(echo x"${mdf_spec}" \
-               | sed -e 's/^x.*\(.\)$/\1/')";
-      ;;
-    ?*)
-      mdf_name="${mdf_spec}";
-      ;;
-  esac;
-  if obj mdf_name is_empty;
-  then
-    eval ${_UNSET} mdf_got_one;
-    eval ${_UNSET} mdf_name;
-    eval ${_UNSET} mdf_section;
-    eval ${_UNSET} mdf_spec;
-    eval "${return_bad}";
-  fi;
-  mdf_got_one='no';
-  if obj mdf_section is_empty;
-  then
-    eval set x "${_MAN_AUTO_SEC}";
-    shift;
-    for s
-    do
-      mdf_s="$s";
-      if man_search_section "${mdf_name}" "${mdf_s}";
-      then			# found
-        if obj _MAN_ALL is_yes;
-        then
-          mdf_got_one='yes';
-        else
-          eval ${_UNSET} mdf_got_one;
-          eval ${_UNSET} mdf_name;
-          eval ${_UNSET} mdf_s;
-          eval ${_UNSET} mdf_section;
-          eval ${_UNSET} mdf_spec;
-          eval "${return_good}";
-        fi;
-      fi;
-    done;
-  else
-    if man_search_section "${mdf_name}" "${mdf_section}";
-    then
-      eval ${_UNSET} mdf_got_one;
-      eval ${_UNSET} mdf_name;
-      eval ${_UNSET} mdf_s;
-      eval ${_UNSET} mdf_section;
-      eval ${_UNSET} mdf_spec;
-      eval "${return_good}";
-    else
-      eval ${_UNSET} mdf_got_one;
-      eval ${_UNSET} mdf_name;
-      eval ${_UNSET} mdf_section;
-      eval ${_UNSET} mdf_spec;
-      eval "${return_bad}";
-    fi;
-  fi;
-  if obj _MAN_ALL is_yes && is_yes "${mdf_got_one}";
-  then
-    eval ${_UNSET} mdf_got_one;
-    eval ${_UNSET} mdf_name;
-    eval ${_UNSET} mdf_s;
-    eval ${_UNSET} mdf_section;
-    eval ${_UNSET} mdf_spec;
-    eval "${return_good}";
-  fi;
-  eval ${_UNSET} mdf_got_one;
-  eval ${_UNSET} mdf_name;
-  eval ${_UNSET} mdf_s;
-  eval ${_UNSET} mdf_section;
-  eval ${_UNSET} mdf_spec;
-  eval "${return_bad}";
-} # man_do_filespec()
-
-
-########################################################################
-# man_register_file (<file> <name> [<section>])
-#
-# Write a found man page file and register the title element.
-#
-# Arguments: 1, 2, or 3; maybe empty
-# Output: none
-#
-man_register_file()
-{
-  func_check man_register_file '>=' 2 "$@";
-  case "$#" in
-    2|3) do_nothing; ;;
-    *)
-      error "man_register_file() expects 2 or 3 arguments.";
-      ;;
-  esac;
-  if is_empty "$1";
-  then
-    error 'man_register_file(): file name is empty';
-  fi;
-  to_tmp "$1";
-  case "$#" in
-    2)
-       register_title "man:$2";
-       eval "${return_ok}";
-       ;;
-    3)
-       register_title "$2.$3";
-       eval "${return_ok}";
-       ;;
-  esac;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# man_search_section (<name> <section>)
-#
-# Retrieve man pages.
-#
-# Arguments : 2
-# Globals   : $_MAN_PATH, $_MAN_EXT
-# Return    : 0 if found, 1 otherwise
-#
-# Variable prefix: mss
-#
-man_search_section()
-{
-  func_check man_search_section = 2 "$@";
-  if obj _MAN_PATH is_empty;
-  then
-    eval "${return_bad}";
-  fi;
-  if is_empty "$1";
-  then
-    eval "${return_bad}";
-  fi;
-  if is_empty "$2";
-  then
-    eval "${return_bad}";
-  fi;
-  mss_name="$1";
-  mss_section="$2";
-  eval set x "$(path_split "${_MAN_PATH}")";
-  shift;
-  mss_got_one='no';
-  if obj _MAN_EXT is_empty;
-  then
-    for d
-    do
-      mss_dir="$(dirname_append "$d" "man${mss_section}")";
-      if obj mss_dir is_dir;
-      then
-        mss_prefix="$(\
-          dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
-        mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
-                     sed -e '\| found|s|.*||'
-                     )";
-        if obj mss_files is_not_empty;
-        then
-          # for f in $mss_files
-          for f in $(eval set x ${mss_files}; shift; echo "$@")
-          do
-            mss_f="$f";
-            if obj mss_f is_file;
-            then
-              if is_yes "${mss_got_one}";
-              then
-                register_file "${mss_f}";
-              elif obj _MAN_ALL is_yes;
-              then
-                man_register_file "${mss_f}" "${mss_name}";
-              else
-                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${_UNSET} mss_dir;
-                eval ${_UNSET} mss_ext;
-                eval ${_UNSET} mss_f;
-                eval ${_UNSET} mss_files;
-                eval ${_UNSET} mss_got_one;
-                eval ${_UNSET} mss_name;
-                eval ${_UNSET} mss_prefix;
-                eval ${_UNSET} mss_section;
-                eval "${return_good}";
-              fi;
-              mss_got_one='yes';
-            fi;
-          done;
-        fi;
-      fi;
-    done;
-  else
-    mss_ext="${_MAN_EXT}";
-    # check for directory name having trailing extension
-    for d
-    do
-      mss_dir="$(dirname_append $d man${mss_section}${mss_ext})";
-      if obj mss_dir is_dir;
-      then
-        mss_prefix=\
-          "$(dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
-        mss_files="$( eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
-                     sed -e '\|not found|s|.*||'
-                     )";
-        if obj mss_files is_not_empty;
-        then
-          # for f in $mss_files
-          for f in $(eval set x ${mss_files}; shift; echo "$@")
-          do
-            mss_f="$f";
-            if obj mss_f is_file;
-            then
-              if is_yes "${mss_got_one}";
-              then
-                register_file "${mss_f}";
-              elif obj _MAN_ALL is_yes;
-              then
-                man_register_file "${mss_f}" "${mss_name}";
-              else
-                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${_UNSET} mss_dir;
-                eval ${_UNSET} mss_ext;
-                eval ${_UNSET} mss_f;
-                eval ${_UNSET} mss_files;
-                eval ${_UNSET} mss_got_one;
-                eval ${_UNSET} mss_name;
-                eval ${_UNSET} mss_prefix;
-                eval ${_UNSET} mss_section;
-                eval "${return_good}";
-              fi;
-              mss_got_one='yes';
-            fi;
-          done;
-        fi;
-      fi;
-    done;
-    # check for files with extension in directories without extension
-    for d
-    do
-      mss_dir="$(dirname_append "$d" "man${mss_section}")";
-      if obj mss_dir is_dir;
-      then
-        mss_prefix="$(dirname_append "${mss_dir}" \
-                        "${mss_name}.${mss_section}${mss_ext}")";
-        mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
-                     sed -e '\|not found|s|.*||'
-                     )";
-        if obj mss_files is_not_empty;
-        then
-          # for f in $mss_files
-          for f in $(eval set x ${mss_files}; shift; echo "$@")
-          do
-            mss_f="$f";
-            if obj mss_f is_file;
-            then
-              if is_yes "${mss_got_one}";
-              then
-                register_file "${mss_f}";
-              elif obj _MAN_ALL is_yes;
-              then
-                man_register_file "${mss_f}" "${mss_name}";
-              else
-                man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
-                eval ${_UNSET} mss_dir;
-                eval ${_UNSET} mss_ext;
-                eval ${_UNSET} mss_f;
-                eval ${_UNSET} mss_files;
-                eval ${_UNSET} mss_got_one;
-                eval ${_UNSET} mss_name;
-                eval ${_UNSET} mss_prefix;
-                eval ${_UNSET} mss_section;
-                eval "${return_good}";
-              fi;
-              mss_got_one='yes';
-            fi;
-          done;
-        fi;
-      fi;
-    done;
-  fi;
-  if obj _MAN_ALL is_yes && is_yes "${mss_got_one}";
-  then
-    eval ${_UNSET} mss_dir;
-    eval ${_UNSET} mss_ext;
-    eval ${_UNSET} mss_f;
-    eval ${_UNSET} mss_files;
-    eval ${_UNSET} mss_got_one;
-    eval ${_UNSET} mss_name;
-    eval ${_UNSET} mss_prefix;
-    eval ${_UNSET} mss_section;
-    eval "${return_good}";
-  fi;
-  eval ${_UNSET} mss_dir;
-  eval ${_UNSET} mss_ext;
-  eval ${_UNSET} mss_f;
-  eval ${_UNSET} mss_files;
-  eval ${_UNSET} mss_got_one;
-  eval ${_UNSET} mss_name;
-  eval ${_UNSET} mss_prefix;
-  eval ${_UNSET} mss_section;
-  eval "${return_bad}";
-} # man_search_section()
-
-
-########################################################################
-# man_setup ()
-#
-# Setup the variables $_MAN_* needed for man page searching.
-#
-# Globals:
-#   in:     $_OPT_*, $_MANOPT_*, $LANG, $LC_MESSAGES, $LC_ALL,
-#           $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM, $MANOPT.
-#   out:    $_MAN_PATH, $_MAN_LANG, $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2,
-#           $_MAN_SEC, $_MAN_ALL
-#   in/out: $_MAN_ENABLE
-#
-# The precedence for the variables related to `man' is that of GNU
-# `man', i.e.
-#
-# $LANG; overridden by
-# $LC_MESSAGES; overridden by
-# $LC_ALL; this has the same precedence as
-# $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM; overridden by
-# $MANOPT; overridden by
-# the groffer command line options.
-#
-# Variable prefix: ms
-#
-man_setup()
-{
-  func_check main_man_setup = 0 "$@";
-
-  if obj _MAN_IS_SETUP is_yes;
-  then
-    eval "${return_ok}";
-  fi;
-  _MAN_IS_SETUP='yes';
-
-  if obj _MAN_ENABLE is_not_yes;
-  then
-    eval "${return_ok}";
-  fi;
-
-  # determine basic path for man pages
-  _MAN_PATH="$(get_first_essential \
-               "${_OPT_MANPATH}" "${_MANOPT_PATH}" "${MANPATH}")";
-  if obj _MAN_PATH is_empty;
-  then
-    manpath_set_from_path;
-  else
-    _MAN_PATH="$(path_clean "${_MAN_PATH}")";
-  fi;
-  if obj _MAN_PATH is_empty;
-  then
-    if is_prog 'manpath';
-    then
-      _MAN_PATH="$(manpath 2>${_NULL_DEV})"; # not always available
-    fi;
-  fi;
-  if obj _MAN_PATH is_empty;
-  then
-    _MAN_ENABLE="no";
-    eval "${return_ok}";
-  fi;
-
-  _MAN_ALL="$(get_first_essential "${_OPT_ALL}" "${_MANOPT_ALL}")";
-  if obj _MAN_ALL is_empty;
-  then
-    _MAN_ALL='no';
-  fi;
-
-  _MAN_SYS="$(get_first_essential \
-              "${_OPT_SYSTEMS}" "${_MANOPT_SYS}" "${SYSTEM}")";
-  ms_lang="$(get_first_essential \
-           "${_OPT_LANG}" "${LC_ALL}" "${LC_MESSAGES}" "${LANG}")";
-  case "${ms_lang}" in
-    C|POSIX)
-      _MAN_LANG="";
-      _MAN_LANG2="";
-      ;;
-    ?)
-      _MAN_LANG="${ms_lang}";
-      _MAN_LANG2="";
-      ;;
-    *)
-      _MAN_LANG="${ms_lang}";
-      # get first two characters of $ms_lang
-      _MAN_LANG2="$(echo x"${ms_lang}" | sed -e 's/^x\(..\).*$/\1/')";
-      ;;
-  esac;
-  # from now on, use only $_LANG, forget about $_OPT_LANG, $LC_*.
-
-  manpath_add_lang_sys;		# this is very slow
-
-  _MAN_SEC="$(get_first_essential \
-              "${_OPT_SECT}" "${_MANOPT_SEC}" "${MANSEC}")";
-  if obj _MAN_PATH is_empty;
-  then
-    _MAN_ENABLE="no";
-    eval ${_UNSET} ms_lang;
-    eval "${return_ok}";
-  fi;
-
-  _MAN_EXT="$(get_first_essential \
-              "${_OPT_EXTENSION}" "${_MANOPT_EXTENSION}")";
-  eval ${_UNSET} ms_lang;
-  eval "${return_ok}";
-} # man_setup()
-
-
-########################################################################
-landmark '8: manpath_*()';
-########################################################################
-
-########################################################################
-# manpath_add_lang_sys ()
-#
-# Add language and operating system specific directories to man path.
-#
-# Arguments : 0
-# Output    : none
-# Globals:
-#   in:     $_MAN_SYS: has the form `os1,os2,...', a comma separated
-#             list of names of operating systems.
-#           $_MAN_LANG and $_MAN_LANG2: each a single name
-#   in/out: $_MAN_PATH: has the form `dir1:dir2:...', a colon
-#             separated list of directories.
-#
-# Variable prefix: mals
-#
-manpath_add_lang_sys()
-{
-  func_check manpath_add_lang_sys = 0 "$@";
-  if obj _MAN_PATH is_empty;
-  then
-    eval "${return_ok}";
-  fi;
-  # twice test both sys and lang
-  eval set x "$(path_split "${_MAN_PATH}")";
-  shift;
-  mals_mp='';
-  for p
-  do				# loop on man path directories
-    mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
-  done;
-  eval set x "$(path_split "${mals_mp}")";
-  shift;
-  for p
-  do				# loop on man path directories
-    mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
-  done;
-  _MAN_PATH="$(path_chop "${mals_mp}")";
-  eval ${_UNSET} mals_mp;
-  eval "${return_ok}";
-}
-
-
-# To the directory in $1 append existing sys/lang subdirectories
-# Function is necessary to split the OS list.
-#
-# globals: in: $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2
-# argument: 2: `man_path' and `dir'
-# output: colon-separated path of the retrieved subdirectories
-#
-# Variable prefix: _mals
-#
-_manpath_add_lang_sys_single()
-{
-  func_check _manpath_add_lang_sys_single = 2 "$@";
-  _mals_res="$1";
-  _mals_parent="$2";
-  eval set x "$(list_from_split "${_MAN_SYS}" ',')";
-  shift;
-  for d in "$@" "${_MAN_LANG}" "${_MAN_LANG2}"
-  do
-    _mals_dir="$(dirname_append "${_mals_parent}" "$d")";
-    if obj _mals_res path_not_contains "${_mals_dir}" && \
-       obj _mals_dir is_dir;
-    then
-      _mals_res="${_mals_res}:${_mals_dir}";
-    fi;
-  done;
-  if path_not_contains "${_mals_res}" "${_mals_parent}";
-  then
-    _mals_res="${_mals_res}:${_mals_parent}";
-  fi;
-  path_chop "${_mals_res}";
-  eval ${_UNSET} _mals_dir;
-  eval ${_UNSET} _mals_parent;
-  eval ${_UNSET} _mals_res;
-  eval "${return_ok}";
-}
-
-# end manpath_add_lang_sys ()
-
-
-########################################################################
-# manpath_set_from_path ()
-#
-# Determine basic search path for man pages from $PATH.
-#
-# Return:    `0' if a valid man path was retrieved.
-# Output:    none
-# Globals:
-#   in:  $PATH
-#   out: $_MAN_PATH
-#
-# Variable prefix: msfp
-#
-manpath_set_from_path()
-{
-  func_check manpath_set_from_path = 0 "$@";
-
-  msfp_manpath='';
-
-  # get a basic man path from $PATH
-  if obj PATH is_not_empty;
-  then
-    eval set x "$(path_split "${PATH}")";
-    shift;
-    for d
-    do
-      # delete the final `/bin' part
-      msfp_base="$(echo x"$d" | sed -e '
-s/^x//
-s|//*bin/*$||
-')";
-      for e in /share/man /man
-      do
-        msfp_mandir="${msfp_base}$e";
-        if test -d "${msfp_mandir}" && test -r "${msfp_mandir}";
-        then
-          msfp_manpath="${msfp_manpath}:${msfp_mandir}";
-        fi;
-      done;
-    done;
-  fi;
-
-  # append some default directories
-  for d in /usr/local/share/man /usr/local/man \
-           /usr/share/man /usr/man \
-           /usr/X11R6/man /usr/openwin/man \
-           /opt/share/man /opt/man \
-           /opt/gnome/man /opt/kde/man
-  do
-    msfp_d="$d";
-    if obj msfp_manpath path_not_contains "${msfp_d}" && obj mfsp_d is_dir;
-    then
-      msfp_manpath="${msfp_manpath}:${mfsp_d}";
-    fi;
-  done;
-
-  _MAN_PATH="${msfp_manpath}";
-  eval ${_UNSET} msfp_base;
-  eval ${_UNSET} msfp_d;
-  eval ${_UNSET} msfp_mandir;
-  eval ${_UNSET} msfp_manpath;
-  eval "${return_ok}";
-} # manpath_set_from_path()
-
-
-########################################################################
-landmark '9: obj_*()';
-########################################################################
-
-########################################################################
-# obj (<object> <call_name> <arg>...)
-#
-# This works like a method (object function) call for an object.
-# Run "<call_name> $<object> <arg> ...".
-#
-# The first argument represents an object whose data is given as first
-# argument to <call_name>().
-#
-# Argument: >=2
-#           <object>: variable name
-#           <call_name>: a program or function name
-#
-# Variable prefix: o
-#
-obj()
-{
-  func_check obj '>=' 2 "$@";
-  if is_empty "$2";
-  then
-    error "obj(): function name is empty."
-  else
-    o_func="$2";
-  fi;
-  eval o_arg1='"${'$1'}"';
-  shift;
-  shift;
-  eval "${o_func}"' "${o_arg1}" "$@"';
-  n="$?";
-  eval ${_UNSET} o_arg1;
-  eval ${_UNSET} o_func;
-  eval "${return_var} $n";
-} # obj()
-
-
-########################################################################
-# obj_data (<object>)
-#
-# Print the data of <object>, i.e. the content of $<object>.
-# For possible later extensions.
-#
-# Arguments: 1
-#            <object>: a variable name
-# Output:    the data of <object>
-#
-# Variable prefix: od
-#
-obj_data()
-{
-  func_check obj '=' 1 "$@";
-  if is_empty "$1";
-  then
-    error "obj_data(): object name is empty."
-  fi;
-  eval od_res='"${'$1'}"';
-  cat <<EOF
-${od_res}
-EOF
-  eval ${_UNSET} od_res;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# obj_from_output (<object> <call_name> <arg>...)
-#
-# Run '$<object>="$(<call_name> <arg>...)"' to set the result of a
-# function call to a global variable.
-#
-# Arguments: >=2
-#            <object>: a variable name
-#            <call_name>: the name of a function or program
-#            <arg>: optional argument to <call_name>
-# Output:    none
-#
-# Variable prefix: ofo
-#
-obj_from_output()
-{
-  func_check obj_from_output '>=' 2 "$@";
-  if is_empty "$1";
-  then
-    error "res(): variable name is empty.";
-  elif is_empty "$2";
-  then
-    error "res(): function name is empty."
-  else
-    ofo_result_name="$1";
-  fi;
-  shift;
-  eval "${ofo_result_name}"'="$('"$@"')"';
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# obj_set (<object> <data>)
-#
-# Set the data of <object>, i.e. call "$<object>=<data>".
-#
-# Arguments: 2
-#            <object>: a variable name
-#            <data>: a string
-# Output::   none
-#
-obj_set()
-{
-  func_check obj_set '=' 2 "$@";
-  if is_empty "$1";
-  then
-    error "obj_set(): object name is empty."
-  fi;
-  eval "$1"='"$2"';
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# path_chop (<path>)
-#
-# Remove unnecessary colons from path.
-#
-# Argument: 1, a colon separated path.
-# Output:   path without leading, double, or trailing colons.
-#
-path_chop()
-{
-  func_check path_chop = 1 "$@";
-
-  # replace multiple colons by a single colon `:'
-  # remove leading and trailing colons
-  echo x"$1" | sed -e '
-s/^x:*//
-s/:::*/:/g
-s/:*$//
-';
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# path_clean (<path>)
-#
-# Remove non-existing directories from a colon-separated list.
-#
-# Argument: 1, a colon separated path.
-# Output:   colon-separated list of existing directories.
-#
-# Variable prefix: pc
-#
-path_clean()
-{
-  func_check path_clean = 1 "$@";
-  if is_not_equal "$#" 1;
-  then
-    error 'path_clean() needs 1 argument.';
-  fi;
-  pc_arg="$1";
-  eval set x "$(path_split "${pc_arg}")";
-  shift;
-  pc_res="";
-  for i
-  do
-    pc_i="$i";
-    if obj pc_i is_not_empty \
-       && obj pc_res path_not_contains "${pc_i}" \
-       && obj pc_i is_dir;
-    then
-      case "${pc_i}" in
-        ?*/) pc_res="${pc_res}$(dirname_chop "${pc_i}")"; ;;
-        *)  pc_res="${pc_res}:${pc_i}";
-      esac;
-    fi;
-  done;
-  eval ${_UNSET} pc_arg;
-  eval ${_UNSET} pc_i;
-  eval ${_UNSET} pc_res;
-  if path_chop "${pc_res}";
-  then
-    eval "${return_ok}";
-  else
-    eval "${return_bad}";
-  fi;
-}
-
-
-########################################################################
-# path_contains (<path> <dir>)
-#-
-# Test whether `dir' is contained in `path', a list separated by `:'.
-#
-# Arguments : 2 arguments.
-# Return    : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-path_contains()
-{
-  func_check path_contains = 2 "$@";
-  case ":$1:" in
-    *":$2:"*)
-      eval "${return_yes}";
-      ;;
-    *)
-      eval "${return_no}";
-      ;;
-  esac;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# path_not_contains (<path> <dir>)
-#
-# Test whether `dir' is not contained in colon separated `path'.
-#
-# Arguments : 2 arguments.
-#
-path_not_contains()
-{
-  func_check path_not_contains = 2 "$@";
-  if path_contains "$1" "$2";
-  then
-    eval "${return_no}";
-  else
-    eval "${return_yes}";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# path_split (<path>)
-#
-# In `path' escape white space and replace each colon by a space.
-#
-# Arguments: 1: a colon-separated path
-# Output:    the resulting list, process with `eval set'
-#
-path_split()
-{
-  func_check path_split = 1 "$@";
-  list_from_split "$1" ':';
-  eval "${return_ok}";
-}
-
-
-########################################################################
-landmark '10: register_*()';
-########################################################################
-
-########################################################################
-# register_file (<filename>)
-#
-# Write a found file and register the title element.
-#
-# Arguments: 1: a file name
-# Output: none
-#
-register_file()
-{
-  func_check register_file = 1 "$@";
-  if is_empty "$1";
-  then
-    error 'register_file(): file name is empty';
-  fi;
-  if is_equal "$1" '-';
-  then
-    to_tmp "${_TMP_STDIN}";
-    register_title 'stdin';
-  else
-    to_tmp "$1";
-    register_title "$(base_name "$1")";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# register_title (<filespec>)
-#
-# Create title element from <filespec> and append to $_REGISTERED_TITLE
-#
-# Globals: $_REGISTERED_TITLE (rw)
-#
-# Variable prefix: rt
-#
-register_title()
-{
-  func_check register_title = 1 "$@";
-  if is_empty "$1";
-  then
-    eval "${return_ok}";
-  fi;
-  rt_title="$(base_name "$1")";	# remove directory part
-
-  # remove extension `.gz'
-  rt_title="$(echo x"${rt_title}" | sed -e '
-s/^x//
-s/\.gz$//
-')";
-  # remove extension `.Z'
-  rt_title="$(echo x"${rt_title}" | sed -e '
-s/^x//
-s/\.Z$//
-')";
-
-  if obj rt_title is_empty;
-  then
-    eval "${return_ok}";
-  fi;
-  _REGISTERED_TITLE="${_REGISTERED_TITLE} ${rt_title}";
-  eval ${_UNSET} rt_title;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# reset ()
-#
-# Reset the variables that can be affected by options to their default.
-#
-#
-# Defined in section `Preset' after the rudimentary shell tests.
-
-
-########################################################################
-# save_stdin ()
-#
-# Store standard input to temporary file (with decompression).
-#
-# Variable prefix: ss
-#
-if obj _HAS_COMPRESSION is_yes;
-then
-  save_stdin()
-  {
-    func_check save_stdin = 0 "$@";
-    ss_f="${_TMP_DIR}"/INPUT;
-    cat >"${ss_f}";
-    cat_z "${ss_f}" >"${_TMP_STDIN}";
-    rm -f "${ss_f}";
-    eval ${_UNSET} ss_f;
-    eval "${return_ok}";
-  }
-else
-  save_stdin()
-  {
-    func_check save_stdin = 0 "$@";
-    cat >"${_TMP_STDIN}";
-    eval "${return_ok}";
-  }
-fi;
-
-
-########################################################################
-landmark '11: stack_*()';
-########################################################################
-
-########################################################################
-# string_contains (<string> <part>)
-#
-# Test whether `part' is contained in `string'.
-#
-# Arguments : 2 text arguments.
-# Return    : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-string_contains()
-{
-  func_check string_contains = 2 "$@";
-  case "$1" in
-    *"$2"*)
-      eval "${return_yes}";
-      ;;
-    *)
-      eval "${return_no}";
-      ;;
-  esac;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# string_not_contains (<string> <part>)
-#
-# Test whether `part' is not substring of `string'.
-#
-# Arguments : 2 text arguments.
-# Return    : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-string_not_contains()
-{
-  func_check string_not_contains = 2 "$@";
-  if string_contains "$1" "$2";
-  then
-    eval "${return_no}";
-  else
-    eval "${return_yes}";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-landmark '12: tmp_*()';
-########################################################################
-
-########################################################################
-# tmp_cat ()
-#
-# output the temporary cat file (the concatenation of all input)
-#
-tmp_cat()
-{
-  func_check tmp_cat '=' 0 "$@";
-  cat "${_TMP_CAT}";
-  eval "${return_var}" "$?";
-}
-
-
-########################################################################
-# tmp_create (<suffix>?)
-#
-# Create temporary file.
-#
-# It's safe to use the shell process ID together with a suffix to
-# have multiple temporary files.
-#
-# Globals: $_TMP_DIR
-#
-# Output : name of created file
-#
-# Variable prefix: tc
-#
-tmp_create()
-{
-  func_check tmp_create '<=' 1 "$@";
-  # the output file does not have `,' as first character, so these are
-  # different names from the output file.
-  tc_tmp="${_TMP_DIR}/,$1";
-  : >"${tc_tmp}"
-  cat <<EOF
-${tc_tmp}
-EOF
-  eval ${_UNSET} tc_tmp;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# to_tmp (<filename>)
-#
-# print file (decompressed) to the temporary cat file
-#
-to_tmp()
-{
-  func_check to_tmp = 1 "$@";
-  if is_file "$1";
-  then
-    if obj _OPT_LOCATION is_yes;
-    then
-      echo2 "$1";
-    fi;
-    if obj _OPT_WHATIS is_yes;
-    then
-      what_is "$1" >>"${_TMP_CAT}";
-    else
-      cat_z "$1" >>"${_TMP_CAT}";
-    fi;
-  else
-    error "to_tmp(): could not read file \`$1'.";
-  fi;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# trap_clean ()
-#
-# disable trap on all exit codes ($_ALL_EXIT)
-#
-# Arguments: 0
-# Globals:   $_ALL_EXIT
-#
-trap_clean()
-{
-  func_check trap_clean = 0 "$@";
-  # for i in $_ALL_EXIT
-  for i in $(eval set x ${_ALL_EXIT}; shift; echo "$@")
-  do
-    trap "" "$i" 2>${_NULL_DEV} || :;
-  done;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# trap_set (<functionname>)
-#
-# call function on all exit codes ($_ALL_EXIT)
-#
-# Arguments: 1 (name of a shell function)
-# Globals:   $_ALL_EXIT
-#
-trap_set()
-{
-  func_check trap_set = 1 "$@";
-  # for i in $_ALL_EXIT
-  for i in $(eval set x ${_ALL_EXIT}; shift; echo "$@")
-  do
-    trap "$1" "$i" 2>${_NULL_DEV} || :;
-  done;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# usage ()
-#
-# print usage information to stderr; for groffer option --help.
-#
-usage()
-{
-  func_check usage = 0 "$@";
-  echo;
-  version;
-  echo 'Usage: '"${_PROGRAM_NAME}"' [option]... [filespec]...';
-  cat <<EOF
-
-Display roff files, standard input, and/or Unix manual pages with a X
-Window viewer or in several text modes.  All input is decompressed
-on-the-fly with all formats that gzip can handle.
-
-"filespec" is one of
-  "filename"       name of a readable file
-  "-"              for standard input
-  "man:name.n"     man page "name" in section "n"
-  "man:name"       man page "name" in first section found
-  "name.n"         man page "name" in section "n"
-  "name"           man page "name" in first section found
-and some more (see groffer(1) for details).
-
--h --help        print this usage message.
--Q --source      output as roff source.
--T --device=name pass to groff using output device "name".
--v --version     print version information.
--V               display the groff execution pipe instead of formatting.
--X --X --x       display with "gxditview" using groff -X.
--Z --ditroff --intermediate-output
-                 generate groff intermediate output without
-                 post-processing and viewing, like groff -Z.
-All other short options are interpreted as "groff" formatting options.
-
-The most important groffer long options are
-
---apropos=name   start man's "apropos" program for "name".
---apropos-data=name
-                 "apropos" for "name" in man's data sections 4, 5, 7.
---apropos-devel=name
-                 "apropos" for "name" in development sections 2, 3, 9.
---apropos-progs=name
-                 "apropos" for "name" in man's program sections 1, 6, 8.
---auto           choose mode automatically from the default mode list.
---default        reset all options to the default value.
---default-modes=mode1,mode2,...
-                 set sequence of automatically tried modes.
---dvi            display in a viewer for TeX device independent format.
---dvi-viewer     choose the viewer program for dvi mode.
---groff          process like groff, disable viewing features.
---help           display this helping output.
---html --www     display in a web browser.
---html-viewer    choose the web browser for www mode.
---man            check file parameters first whether they are man pages.
---mode=auto|dvi|groff|html|pdf|ps|source|text|tty|www|x|X
-                 choose display mode.
---no-man         disable man-page facility.
---pager=program  preset the paging program for tty mode.
---pdf            display in a PDF viewer.
---pdf-viewer     choose the viewer program for pdf mode.
---ps             display in a Postscript viewer.
---ps-viewer      choose the viewer program for ps mode.
---shell          specify shell under which to run this program.
---text           output in a text device without a pager.
---tty            display with a pager on text terminal even when in X.
---www-viewer     same as --html-viewer
---x-viewer       choose viewer program for x mode (X mode).
---X-viewer       same as "--xviewer".
-
-The usual X Windows toolkit options transformed into GNU long options
---background=color, --bd=size, --bg=color, --bordercolor=color,
---borderwidth=size, --bw=size, --display=Xdisplay, --fg=color,
---fn=font, --font=font, --foreground=color, --geometry=geom, --iconic,
---resolution=dpi, --rv, --title=text, --xrm=resource
-
-Long options of GNU "man"
- --all, --ascii, --ditroff, --extension=suffix, --locale=language,
---local-file=name, --location, --manpath=dir1:dir2:...,
---sections=s1:s2:..., --systems=s1,s2,..., --whatis, --where, ...
-
-EOF
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# version ()
-#
-# print version information to stderr
-#
-version()
-{
-  func_check version = 0 "$@";
-  echo2 "${_PROGRAM_NAME} ${_PROGRAM_VERSION} of ${_LAST_UPDATE}";
-  # also display groff's version, but not the called subprograms
-  groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /' >&2;
-  eval "${return_ok}";
-}
-
-
-########################################################################
-# warning (<string>)
-#
-# Print warning to stderr
-#
-warning()
-{
-  echo2 "warning: $*";
-}
-
-
-########################################################################
-# what_is (<filename>)
-#
-# Interpret <filename> as a man page and display its `whatis'
-# information as a fragment written in the groff language.
-#
-# Variable prefix: wi
-#
-what_is()
-{
-  func_check what_is = 1 "$@";
-  if is_not_file "$1";
-  then
-    error "what_is(): argument is not a readable file."
-  fi;
-  wi_dot='^\.['"${_SPACE}${_TAB}"']*';
-  cat <<EOF
-.br
-  $1:
-.br
-EOF
-  # grep the line containing `.TH' macro, if any
-  wi_res="$(cat_z "$1" | sed -e '/'"${wi_dot}"'TH /p
-d')";
-  if obj wi_res is_not_empty;
-  then				# traditional man style
-    # get the text between the first and the second `.SH' macro, by
-    # - delete up to first .SH;
-    # - of this, print everything up to next .SH, and delete the rest;
-    # - of this, delete the final .SH line;
-    cat_z "$1" | sed -e '1,/'"${wi_dot}"'SH/d' \
-              | sed -e '1,/'"${wi_dot}"'SH/p
-d' \
-              | sed -e '/'"${wi_dot}"'SH/d';
-    eval ${_UNSET} wi_dot;
-    eval ${_UNSET} wi_res;
-    eval "${return_ok}";
-  fi;
-  # grep the line containing `.Dd' macro, if any
-  wi_res="$(cat_z "$1" | sed -e '/'"${wi_dot}"'Dd /p
-d')";
-  if obj wi_res is_not_empty;
-  then				# BSD doc style
-    # get the text between the first and the second `.Nd' macro, by
-    # - delete up to first .Nd;
-    # - of this, print everything up to next .Nd, and delete the rest;
-    # - of this, delete the final .Nd line;
-    cat_z "$1" | sed -e '1,/'"${wi_dot}"'Nd/d' \
-              | sed -e '1,/'"${wi_dot}"'Nd/p
-d' \
-              | sed -e '/'"${wi_dot}"'Nd/d';
-    eval ${_UNSET} wi_dot;
-    eval ${_UNSET} wi_res;
-    eval "${return_ok}";
-  fi;
-  echo 'is not a man page.';
-  eval ${_UNSET} wi_dot;
-  eval ${_UNSET} wi_res;
-  eval "${return_bad}";
-}
-
-
-########################################################################
-# where_is (<program>)
-#
-# Output path of a program if in $PATH.
-#
-# Arguments : >=1 (empty allowed)
-#   more args are ignored, this allows to specify progs with arguments
-# Return    : `0' if arg1 is a program in $PATH, `1' otherwise.
-#
-# Variable prefix: w
-#
-where_is()
-{
-  func_check where_is '>=' 1 "$@";
-  w_arg="$1";
-  if obj w_arg is_empty;
-  then
-    eval ${_UNSET} w_arg;
-    eval "${return_bad}";
-  fi;
-  case "${w_arg}" in
-    /*)
-      eval ${_UNSET} w_arg;
-      eval ${_UNSET} w_file;
-      if test -f "${w_arg}" && test -x "${w_arg}";
-      then
-        eval "${return_ok}";
-      else
-        eval "${return_bad}";
-      fi;
-      ;;
-  esac;
-  eval set x "$(path_split "${PATH}")";
-  shift;
-  for p
-  do
-    case "$p" in
-      */) w_file=${p}${w_arg}; ;;
-      *)  w_file=${p}/${w_arg}; ;;
-    esac;
-    if test -f "${w_file}" && test -x "${w_file}";
-    then
-      cat <<EOF
-${w_file}
-EOF
-      eval ${_UNSET} w_arg;
-      eval ${_UNSET} w_file;
-      eval "${return_ok}";
-    fi;
-  done;
-  eval ${_UNSET} w_arg;
-  eval ${_UNSET} w_file;
-  eval "${return_bad}";
-}
-
-
-########################################################################
-#                        main* Functions
-########################################################################
-
-# The main area contains the following parts:
-# - main_init(): initialize temporary files and set exit trap
-# - main_parse_MANOPT(): parse $MANOPT
-# - main_parse_args(): argument parsing
-# - main_set_mode (): determine the display mode
-# - main_do_fileargs(): process filespec arguments
-# - main_set_resources(): setup X resources
-# - main_display(): do the displaying
-# - main(): the main function that calls all main_*()
-
-# These parts are implemented as functions, being defined below in the
-# sequence they are called in the main() function.
-
-
-landmark '13: main_init()';
-#######################################################################
-# main_init ()
-#
-# set exit trap and create temporary files
-#
-# Globals: $_TMP_DIR, $_TMP_CAT, $_TMP_STDIN
-#
-# Variable prefix: mi
-#
-main_init()
-{
-  func_check main_init = 0 "$@";
-  # call clean_up() on any signal
-  trap_set clean_up;
-
-  # create temporary directory
-  umask 0022;
-  _TMP_DIR='';
-  for d in "${GROFF_TMPDIR}" "${TMPDIR}" "${TMP}" "${TEMP}" \
-           "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.'
-  do
-    mi_dir="$d";
-    if obj mi_dir is_empty || obj mi_dir is_not_dir || \
-       obj mi_dir is_not_writable;
-    then
-      continue;
-    fi;
-
-    case "${mi_dir}" in
-    */)
-      _TMP_DIR="${mi_dir}";
-      ;;
-    *)
-      _TMP_DIR="${mi_dir}"'/';
-      ;;
-    esac;
-    _TMP_DIR="${_TMP_DIR}${_PROGRAM_NAME}${_PROCESS_ID}";
-    if obj _TMP_DIR is_existing;
-    then
-      eval rm -f -r  "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
-      if obj _TMP_DIR is_existing;
-      then
-        mi_tdir_="${_TMP_DIR}"_;
-        mi_n=1;
-        mi_tdir_n="${mi_tdir_}${mi_n}";
-        while obj mi_tdir_n is_existing;
-        do
-          eval rm -f -r "'${mi_tdir_n}'" >${_NULL_DEV} 2>&1;
-          if obj mi_tdir_n is_existing;
-          then
-            # directory could not be removed
-            mi_n="$(expr "${mi_n}" + 1)";
-            mi_tdir_n="${mi_tdir_}${mi_n}";
-            continue;
-          fi;
-        done;
-        _TMP_DIR="${mi_tdir_n}";
-      fi;
-    fi;
-    eval mkdir "${_TMP_DIR}";
-    if is_not_equal "$?" 0;
-    then
-      if obj _TMP_DIR is_existing;
-      then
-        eval rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
-      fi;
-      _TMP_DIR='';
-      continue;
-    fi;
-    if obj _TMP_DIR is_dir && obj _TMP_DIR is_writable;
-    then
-      # $_TMP_DIR can now be used as temporary directory
-      break;
-    fi;
-    if obj _TMP_DIR is_existing;
-    then
-      rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1;
-    fi;
-    _TMP_DIR='';
-    continue;
-  done;
-  if obj _TMP_DIR is_empty;
-  then
-    error "main_init: \
-Couldn't create a directory for storing temporary files.";
-  fi;
-
-  _TMP_CAT="$(tmp_create groffer_cat)";
-  _TMP_STDIN="$(tmp_create groffer_input)";
-
-  # groffer configuration files
-  # for f in $_CONF_FILES
-  for f in $(eval set x ${_CONF_FILES}; shift; echo "$@")
-  do
-    mi_file="$f";
-    if obj mi_file is_file;
-    then
-      echo '_groffer_opt=""' >>${_TMP_CAT};
-      # collect the lines starting with a minus
-      cat "$mi_file" | sed -e '
-/^[	 ]*#/d
-s/^[	 ]*\(-.*\)$/_groffer_opt="${_groffer_opt} \1"/
-' >>${_TMP_CAT};
-      # prepend the collected information to $GROFFER_OPT
-      echo 'GROFFER_OPT="${_groffer_opt} ${GROFFER_OPT}"' >>${_TMP_CAT};
-    fi;
-  done;
-  eval . "${_TMP_CAT}";
-  _TMP_CAT="$(tmp_create groffer_cat)";
-
-  eval ${_UNSET} mi_dir;
-  eval ${_UNSET} mi_file;
-  eval ${_UNSET} mi_n;
-  eval ${_UNSET} mi_tdir_;
-  eval ${_UNSET} mi_tdir_n;
-  eval "${return_ok}";
-} # main_init()
-
-
-landmark '14: main_parse_MANOPT()';
-########################################################################
-# main_parse_MANOPT ()
-#
-# Parse $MANOPT to retrieve man options, but only if it is a non-empty
-# string; found man arguments can be overwritten by the command line.
-#
-# Globals:
-#   in: $MANOPT, $_OPTS_MANOPT_*
-#   out: $_MANOPT_*
-#   in/out: $GROFFER_OPT
-#
-# Variable prefix: mpm
-#
-main_parse_MANOPT()
-{
-  func_check main_parse_MANOPT = 0 "$@";
-  mpm_list='';
-  if obj MANOPT is_not_empty;
-  then
-    MANOPT="$(echo x"${MANOPT}" | sed -e 's/^x'"${_SPACE}${_SPACE}"'*//')";
-  fi;
-  if obj MANOPT is_empty;
-  then
-    eval ${_UNSET} mpm_list;
-    eval ${_UNSET} mpm_opt;
-    eval "${return_ok}";
-  fi;
-  # add arguments in $MANOPT by mapping them to groffer options
-  eval set x "$(list_from_cmdline _OPTS_MANOPT "${MANOPT}")";
-  shift;
-  until test "$#" -le 0 || is_equal "$1" '--';
-  do
-    mpm_opt="$1";
-    shift;
-    case "${mpm_opt}" in
-      -7|--ascii)
-        list_append mpm_list '--ascii';
-        ;;
-      -a|--all)
-        list_append mpm_list '--all';
-        ;;
-      -c|--catman)
-        do_nothing;
-        shift;
-        ;;
-      -d|--debug)
-        list_append mpm_list '--debug';
-        ;;
-      -D|--default)
-        # undo all man options so far
-        mpm_list='';
-        ;;
-      -e|--extension)
-        list_append mpm_list '--extension';
-        shift;
-        ;;
-      -f|--whatis)
-        list_append mpm_list '--whatis';
-        shift;
-        ;;
-      -h|--help)
-        do_nothing;
-        shift;
-        ;;
-      -k|--apropos)
-	# groffer's --apropos takes an argument, but man's does not, so
-        do_nothing;
-        shift;
-        ;;
-      -l|--local-file)
-        list_append mpm_list '--local-file';
-        ;;
-      -L|--locale)
-        list_append mpm_list '--locale' "$1";
-        shift;
-        ;;
-      -m|--systems)
-        list_append mpm_list '--systems' "$1";
-        shift;
-        ;;
-      -M|--manpath)
-        list_append mpm_list '--manpath' "$1";
-        shift;
-        ;;
-      -p|--preprocessor)
-        do_nothing;
-        shift;
-        ;;
-      -P|--pager|--tty-viewer)
-        list_append mpm_list '--pager' "$1";
-        shift;
-        ;;
-      -r|--prompt)
-        do_nothing;
-        shift;
-        ;;
-      -S|--sections)
-        list_append mpm_list '--sections' "$1";
-        shift;
-        ;;
-      -t|--troff)
-        do_nothing;
-        shift;
-        ;;
-      -T|--device)
-        list_append mpm_list '-T' "$1";
-        shift;
-        ;;
-      -u|--update)
-        do_nothing;
-        shift;
-        ;;
-      -V|--version)
-        do_nothing;
-        ;;
-      -w|--where|--location)
-        list_append mpm_list '--location';
-        ;;
-      -Z|--ditroff)
-        list_append mpm_list '-Z' "$1";
-        shift;
-        ;;
-      # ignore all other options
-    esac;
-  done;
-  # append the 2 lists in $mpm_list and $GROFFER_OPT to $GROFFER_OPT
-  if obj GROFFER_OPT is_empty;
-  then
-    GROFFER_OPT="${mpm_list}";
-  elif obj mpm_list is_not_empty;
-  then
-    GROFFER_OPT="${mpm_list} ${GROFFER_OPT}";
-  fi;
-  eval ${_UNSET} mpm_list;
-  eval ${_UNSET} mpm_opt;
-  eval "${return_ok}";
-} # main_parse_MANOPT()
-
-
-landmark '15: main_parse_args()';
-########################################################################
-# main_parse_args (<command_line_args>*)
-#
-# Parse arguments; process options and filespec parameters
-#
-# Arguments: pass the command line arguments unaltered.
-# Globals:
-#   in:  $_OPTS_*
-#   out: $_OPT_*, $_ADDOPTS, $_FILEARGS
-#
-#  Variable prefix: mpa
-#
-main_parse_args()
-{
-  func_check main_parse_args '>=' 0 "$@";
-
-  eval set x "${GROFFER_OPT}" '"$@"';
-  shift;
-
-  eval set x "$(list_from_cmdline _OPTS_CMDLINE "$@")";
-  shift;
-
-  # By the call of `eval', unnecessary quoting was removed.  So the
-  # positional shell parameters ($1, $2, ...) are now guaranteed to
-  # represent an option or an argument to the previous option, if any;
-  # then a `--' argument for separating options and
-  # parameters; followed by the filespec parameters if any.
-
-  # Note, the existence of arguments to options has already been checked.
-  # So a check for `$#' or `--' should not be done for arguments.
-
-  until test "$#" -le 0 || is_equal "$1" '--';
-  do
-    mpa_opt="$1";		# $mpa_opt is fed into the option handler
-    shift;
-    case "${mpa_opt}" in
-      -h|--help)
-        usage;
-        leave;
-        ;;
-      -Q|--source)		# output source code (`Quellcode').
-        _OPT_MODE='source';
-        ;;
-      -T|--device|--troff-device) # device; arg
-        _OPT_DEVICE="$1";
-        _check_device_with_mode;
-        shift;
-        ;;
-      -v|--version)
-        version;
-        leave;
-        ;;
-      -V)
-        _OPT_V='yes';
-        ;;
-      -Z|--ditroff|--intermediate-output) # groff intermediate output
-        _OPT_Z='yes';
-        ;;
-      -X)
-        _OPT_MODE=X;
-        ;;
-      -?)
-        # delete leading `-'
-        mpa_optchar="$(echo x"${mpa_opt}" | sed -e 's/^x-//')";
-        if list_has _OPTS_GROFF_SHORT_NA "${mpa_optchar}";
-        then
-          list_append _ADDOPTS_GROFF "${mpa_opt}";
-        elif list_has _OPTS_GROFF_SHORT_ARG "${mpa_optchar}";
-        then
-          list_append _ADDOPTS_GROFF "${mpa_opt}" "$1";
-          shift;
-        else
-          error "main_parse_args(): Unknown option : \`$1'";
-        fi;
-        ;;
-      --all)
-          _OPT_ALL="yes";
-          ;;
-      --apropos)		# run `apropos'
-	apropos_run "$1";
-        mpa_code="$?";
-        clean_up;
-        exit "${mpa_code}";
-        ;;
-      --apropos-data)		# run `apropos' for data sections
-	apropos_run "$1" | grep '^[^(]*([457][^)]*)';
-        mpa_code="$?";
-        clean_up;
-        exit "${mpa_code}";
-        ;;
-      --apropos-devel)		# run `apropos' for development sections
-	apropos_run "$1" | grep '^[^(]*([239][^)]*)';
-        mpa_code="$?";
-        clean_up;
-        exit "${mpa_code}";
-        ;;
-      --apropos-progs)		# run `apropos' for program sections
-	apropos_run "$1" | grep '^[^(]*([168][^)]*)';
-        mpa_code="$?";
-        clean_up;
-        exit "${mpa_code}";
-        ;;
-      --ascii)
-        list_append _ADDOPTS_GROFF '-mtty-char';
-        if obj _OPT_MODE is_empty;
-        then
-         _OPT_MODE='text';
-        fi;
-        ;;
-      --auto)			# the default automatic mode
-        _OPT_MODE='';
-        ;;
-      --bd)			# border color for viewers, arg;
-        _OPT_BD="$1";
-        shift;
-        ;;
-      --bg|--backgroud)		# background color for viewers, arg;
-        _OPT_BG="$1";
-        shift;
-        ;;
-      --bw)			# border width for viewers, arg;
-        _OPT_BW="$1";
-        shift;
-        ;;
-      --default)		# reset variables to default
-        reset;
-        ;;
-      --default-modes)		# sequence of modes in auto mode; arg
-        _OPT_DEFAULT_MODES="$1";
-        shift;
-        ;;
-      --debug)			# only for development
-        _OPT_DEBUG='yes';
-        ;;
-      --display)		# set X display, arg
-        _OPT_DISPLAY="$1";
-        shift;
-        ;;
-      --dvi)
-        _OPT_MODE='dvi';
-        ;;
-      --dvi-viewer)		# viewer program for dvi mode; arg
-        _OPT_VIEWER_DVI="$1";
-        shift;
-        ;;
-      --extension)		# the extension for man pages, arg
-        _OPT_EXTENSION="$1";
-        shift;
-        ;;
-      --fg|--foreground)	# foreground color for viewers, arg;
-        _OPT_FG="$1";
-        shift;
-        ;;
-      --fn|--font)		# set font for viewers, arg;
-        _OPT_FN="$1";
-        shift;
-        ;;
-      --geometry)		# window geometry for viewers, arg;
-        _OPT_GEOMETRY="$1";
-        shift;
-        ;;
-      --groff)
-        _OPT_MODE='groff';
-        ;;
-      --html|--www)		# display with web browser
-        _OPT_MODE=html;
-        ;;
-      --html-viewer|--www-viewer) # viewer program for html mode; arg
-        _OPT_VIEWER_HTML="$1";
-        shift;
-        ;;
-      --iconic)			# start viewers as icons
-        _OPT_ICONIC='yes';
-        ;;
-      --locale)			# set language for man pages, arg
-        # argument is xx[_territory[.codeset[@modifier]]] (ISO 639,...)
-        _OPT_LANG="$1";
-        shift;
-        ;;
-      --local-file)		# force local files; same as `--no-man'
-        _MAN_FORCE='no';
-        _MAN_ENABLE='no';
-        ;;
-      --location|--where)	# print file locations to stderr
-        _OPT_LOCATION='yes';
-        ;;
-      --man)			# force all file params to be man pages
-        _MAN_ENABLE='yes';
-        _MAN_FORCE='yes';
-        ;;
-      --manpath)		# specify search path for man pages, arg
-        # arg is colon-separated list of directories
-        _OPT_MANPATH="$1";
-        shift;
-        ;;
-      --mode)			# display mode
-        mpa_arg="$1";
-        shift;
-        case "${mpa_arg}" in
-          auto|'')		# search mode automatically among default
-	    _OPT_MODE='';
-            ;;
-          groff)		# pass input to plain groff
-            _OPT_MODE='groff';
-            ;;
-          html|www)		# display with a web browser
-            _OPT_MODE='html';
-            ;;
-          dvi)			# display with xdvi viewer
-            _OPT_MODE='dvi';
-            ;;
-          pdf)			# display with PDF viewer
-            _OPT_MODE='pdf';
-            ;;
-          ps)			# display with Postscript viewer
-            _OPT_MODE='ps';
-            ;;
-          text)			# output on terminal
-            _OPT_MODE='text';
-            ;;
-          tty)			# output on terminal
-            _OPT_MODE='tty';
-            ;;
-          X|x)			# output on X roff viewer
-            _OPT_MODE='x';
-            ;;
-          Q|source)		# display source code
-            _OPT_MODE="source";
-            ;;
-	  *)
-            error "main_parse_args(): unknown mode ${mpa_arg}";
-            ;;
-        esac;
-        ;;
-      --no-location)		# disable former call to `--location'
-        _OPT_LOCATION='yes';
-        ;;
-      --no-man)			# disable search for man pages
-        # the same as --local-file
-        _MAN_FORCE="no";
-        _MAN_ENABLE="no";
-        ;;
-      --pager)			# set paging program for tty mode, arg
-        _OPT_PAGER="$1";
-        shift;
-        ;;
-      --pdf)
-        _OPT_MODE='pdf';
-        ;;
-      --pdf-viewer)		# viewer program for ps mode; arg
-        _OPT_VIEWER_PDF="$1";
-        shift;
-        ;;
-      --ps)
-        _OPT_MODE='ps';
-        ;;
-      --ps-viewer)		# viewer program for ps mode; arg
-        _OPT_VIEWER_PS="$1";
-        shift;
-        ;;
-      --resolution)		# set resolution for X devices, arg
-        mpa_arg="$1";
-        shift;
-        case "${mpa_arg}" in
-          75|75dpi)
-            mpa_dpi=75;
-            ;;
-          100|100dpi)
-            mpa_dpi=100;
-            ;;
-          *)
-            error "main_parse_args(): \
-only resoutions of 75 or 100 dpi are supported";
-            ;;
-        esac;
-        _OPT_RESOLUTION="${mpa_dpi}";
-        ;;
-      --rv)
-        _OPT_RV='yes';
-        ;;
-      --sections)		# specify sections for man pages, arg
-        # arg is colon-separated list of section names
-        _OPT_SECTIONS="$1";
-        shift;
-        ;;
-      --shell)
-        # already done during the first run; so ignore the argument
-        shift;
-        ;;
-      --systems)		# man pages for different OS's, arg
-        # argument is a comma-separated list
-        _OPT_SYSTEMS="$1";
-        shift;
-        ;;
-      --text)			# text mode without pager
-        _OPT_MODE=text;
-        ;;
-      --title)			# title for X viewers; arg
-        _OPT_TITLE="$1";
-        shift;
-        ;;
-      --tty)			# tty mode, text with pager
-        _OPT_MODE=tty;
-        ;;
-      --text-device|--tty-device) # device for tty mode; arg
-        _OPT_TEXT_DEVICE="$1";
-        shift;
-        ;;
-      --whatis)
-        _OPT_WHATIS='yes';
-        ;;
-      --X|--x)
-        _OPT_MODE=x;
-        ;;
-      --xrm)			# pass X resource string, arg;
-        list_append _OPT_XRM "$1";
-        shift;
-        ;;
-      --x-viewer|--X-viewer)	# viewer program for x mode; arg
-        _OPT_VIEWER_X="$1";
-        shift;
-        ;;
-      *)
-        error 'main_parse_args(): error on argument parsing : '"\`$*'";
-        ;;
-    esac;
-  done;
-  shift;			# remove `--' argument
-
-  if obj _DEBUG is_not_yes;
-  then
-    if obj _OPT_DEBUG is_yes;
-    then
-      _DEBUG='yes';
-      _DEBUG_LM='yes';
-      _DEBUG_KEEP_FILES='yes';
-    fi;
-  fi;
-
-  # Remaining arguments are file names (filespecs).
-  # Save them to list $_FILEARGS
-  if is_equal "$#" 0;
-  then				# use "-" for standard input
-    set x '-';
-    shift;
-  fi;
-  _FILEARGS='';
-  list_append _FILEARGS "$@";
-  if list_has _FILEARGS '-';
-  then
-    save_stdin;
-  fi;
-  # $_FILEARGS must be retrieved with `eval set x "$_FILEARGS"; shift;'
-  eval ${_UNSET} mpa_arg;
-  eval ${_UNSET} mpa_code;
-  eval ${_UNSET} mpa_dpi;
-  eval ${_UNSET} mpa_opt;
-  eval ${_UNSET} mpa_optchar;
-  eval "${return_ok}";
-} # main_parse_args()
-
-
-# Called from main_parse_args() because double `case' is not possible.
-# Globals: $_OPT_DEVICE, $_OPT_MODE
-_check_device_with_mode()
-{
-  func_check _check_device_with_mode = 0 "$@";
-  case "${_OPT_DEVICE}" in
-    dvi)
-      _OPT_MODE=dvi;
-      eval "${return_ok}";
-      ;;
-    html)
-      _OPT_MODE=html;
-      eval "${return_ok}";
-      ;;
-    lbp|lj4)
-      _OPT_MODE=groff;
-      eval "${return_ok}";
-      ;;
-    ps)
-      _OPT_MODE=ps;
-      eval "${return_ok}";
-      ;;
-    ascii|cp1047|latin1|utf8)
-      if obj _OPT_MODE is_not_equal text;
-      then
-        _OPT_MODE=tty;		# default text mode
-      fi;
-      eval "${return_ok}";
-      ;;
-    X*)
-      _OPT_MODE=x;
-      eval "${return_ok}";
-      ;;
-    *)				# unknown device, go to groff mode
-      _OPT_MODE=groff;
-      eval "${return_ok}";
-      ;;
-  esac;
-  eval "${return_error}";
-} # _check_device_with_mode() of main_parse_args()
-
-
-landmark '16: main_set_mode()';
-########################################################################
-# main_set_mode ()
-#
-# Determine the display mode.
-#
-# Globals:
-#   in:  $DISPLAY, $_OPT_MODE, $_OPT_DEVICE
-#   out: $_DISPLAY_MODE
-#
-# Variable prefix: msm
-#
-main_set_mode()
-{
-  func_check main_set_mode = 0 "$@";
-
-  # handle apropos
-  if obj _OPT_APROPOS is_not_empty;
-  then
-    apropos "${_OPT_APROPOS}";
-    msm_code="$?";
-    clean_up;
-    exit "${msm_code}";
-  fi;
-  if obj _OPT_APROPOS_DATA is_not_empty;
-  then
-    apropos "$@" | grep '^[^(]*([457])';
-    msm_code="$?";
-    clean_up;
-    exit "${msm_code}";
-  fi;
-  if obj _OPT_APROPOS_DEVEL is_not_empty;
-  then
-    apropos "$@" | grep '^[^(]*([239])';
-    msm_code="$?";
-    clean_up;
-    exit "${msm_code}";
-  fi;
-  if obj _OPT_APROPOS_PROGS is_not_empty;
-  then
-    apropos "$@" | grep '^[^(]*([168])';
-    msm_code="$?";
-    clean_up;
-    exit "${msm_code}";
-  fi;
-
-  # set display
-  if obj _OPT_DISPLAY is_not_empty;
-  then
-    DISPLAY="${_OPT_DISPLAY}";
-  fi;
-
-  if obj _OPT_V is_yes;
-  then
-    list_append _ADDOPTS_GROFF '-V';
-  fi;
-  if obj _OPT_Z is_yes;
-  then
-    _DISPLAY_MODE='groff';
-    list_append _ADDOPTS_GROFF '-Z';
-  fi;
-  if obj _OPT_MODE is_equal 'groff';
-  then
-    _DISPLAY_MODE='groff';
-  fi;
-  if obj _DISPLAY_MODE is_equal 'groff';
-  then
-    eval ${_UNSET} msm_code;
-    eval ${_UNSET} msm_modes;
-    eval ${_UNSET} msm_viewer;
-    eval ${_UNSET} msm_viewers;
-    eval "${return_ok}";
-  fi;
-
-  if obj _OPT_MODE is_equal 'source';
-  then
-    _DISPLAY_MODE='source';
-    eval ${_UNSET} msm_code;
-    eval ${_UNSET} msm_modes;
-    eval ${_UNSET} msm_viewer;
-    eval ${_UNSET} msm_viewers;
-    eval "${return_ok}";
-  fi;
-
-  case "${_OPT_MODE}" in
-    '')				# automatic mode
-      case "${_OPT_DEVICE}" in
-        X*)
-          if obj DISPLAY is_empty;
-          then
-            error "main_set_mode(): \
-no X display found for device ${_OPT_DEVICE}";
-          fi;
-          _DISPLAY_MODE='x';
-          eval ${_UNSET} msm_code;
-          eval ${_UNSET} msm_modes;
-          eval ${_UNSET} msm_viewer;
-          eval ${_UNSET} msm_viewers;
-          eval "${return_ok}";
-          ;;
-        ascii|cp1047|latin1|utf8)
-          if obj _DISPLAY_MODE is_not_equal 'text';
-          then
-            _DISPLAY_MODE='tty';
-          fi;
-          eval ${_UNSET} msm_code;
-          eval ${_UNSET} msm_modes;
-          eval ${_UNSET} msm_viewer;
-          eval ${_UNSET} msm_viewers;
-          eval "${return_ok}";
-          ;;
-      esac;
-      if obj DISPLAY is_empty;
-      then
-        _DISPLAY_MODE='tty';
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-      fi;
-
-      if obj _OPT_DEFAULT_MODES is_empty;
-      then
-        msm_modes="${_DEFAULT_MODES}";
-      else
-        msm_modes="${_OPT_DEFAULT_MODES}";
-      fi;
-      ;;
-    text)
-      _DISPLAY_MODE='text';
-      eval ${_UNSET} msm_code;
-      eval ${_UNSET} msm_modes;
-      eval ${_UNSET} msm_viewer;
-      eval ${_UNSET} msm_viewers;
-      eval "${return_ok}";
-      ;;
-    tty)
-      _DISPLAY_MODE='tty';
-      eval ${_UNSET} msm_code;
-      eval ${_UNSET} msm_modes;
-      eval ${_UNSET} msm_viewer;
-      eval ${_UNSET} msm_viewers;
-      eval "${return_ok}";
-      ;;
-    *)				# display mode was given
-      if obj DISPLAY is_empty;
-      then
-        error "main_set_mode(): \
-you must be in X Window for ${_OPT_MODE} mode.";
-      fi;
-      msm_modes="${_OPT_MODE}";
-      ;;
-  esac;
-
-  # only viewer modes are left
-  eval set x "$(list_from_split "${msm_modes}" ',')";
-  shift;
-  while test "$#" -gt 0;
-  do
-    m="$1";
-    shift;
-    case "$m" in
-      text)
-        _DISPLAY_MODE='text';
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      tty)
-        _DISPLAY_MODE='tty';
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      x)
-        if obj _OPT_VIEWER_X is_not_empty;
-        then
-          msm_viewers="${_OPT_VIEWER_X}";
-        else
-          msm_viewers="${_VIEWER_X}";
-        fi;
-        msm_viewer="$(_get_first_prog "${msm_viewers}")";
-        if is_not_equal "$?" 0;
-        then
-          continue;
-        fi;
-        _DISPLAY_PROG="${msm_viewer}";
-        _DISPLAY_MODE='x';
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      X)
-        _DISPLAY_MODE='X';
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      dvi)
-        if obj _OPT_VIEWER_DVI is_not_empty;
-        then
-          msm_viewers="${_OPT_VIEWER_DVI}";
-        else
-          msm_viewers="${_VIEWER_DVI}";
-        fi;
-        msm_viewer="$(_get_first_prog "${msm_viewers}")";
-        if is_not_equal "$?" 0;
-        then
-          continue;
-        fi;
-        _DISPLAY_PROG="${msm_viewer}";
-        _DISPLAY_MODE="dvi";
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      pdf)
-        if obj _OPT_VIEWER_PDF is_not_empty;
-        then
-          msm_viewers="${_OPT_VIEWER_PDF}";
-        else
-          msm_viewers="${_VIEWER_PDF}";
-        fi;
-        msm_viewer="$(_get_first_prog "${msm_viewers}")";
-        if is_not_equal "$?" 0;
-        then
-          continue;
-        fi;
-        _DISPLAY_PROG="${msm_viewer}";
-        _DISPLAY_MODE="pdf";
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      ps)
-        if obj _OPT_VIEWER_PS is_not_empty;
-        then
-          msm_viewers="${_OPT_VIEWER_PS}";
-        else
-          msm_viewers="${_VIEWER_PS}";
-        fi;
-        msm_viewer="$(_get_first_prog "${msm_viewers}")";
-        if is_not_equal "$?" 0;
-        then
-          continue;
-        fi;
-        _DISPLAY_PROG="${msm_viewer}";
-        _DISPLAY_MODE="ps";
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-      html)
-        if obj _OPT_VIEWER_HTML is_not_empty;
-        then
-          msm_viewers="${_OPT_VIEWER_HTML}";
-        else
-          msm_viewers="${_VIEWER_HTML}";
-        fi;
-        msm_viewer="$(_get_first_prog "${msm_viewers}")";
-        if is_not_equal "$?" 0;
-        then
-          continue;
-        fi;
-        _DISPLAY_PROG="${msm_viewer}";
-        _DISPLAY_MODE=html;
-        eval ${_UNSET} msm_code;
-        eval ${_UNSET} msm_modes;
-        eval ${_UNSET} msm_viewer;
-        eval ${_UNSET} msm_viewers;
-        eval "${return_ok}";
-        ;;
-    esac;
-  done;
-  eval ${_UNSET} msm_code;
-  eval ${_UNSET} msm_modes;
-  eval ${_UNSET} msm_viewer;
-  eval ${_UNSET} msm_viewers;
-  error "main_set_mode(): no suitable display mode found.";
-} # main_set_mode()
-
-
-# _get_first_prog (<proglist>)
-#
-# Retrieve first argument that represents an existing program in $PATH.
-# Local function for main_set_mode().
-#
-# Arguments: 1; a comma-separated list of commands (with options),
-#               like $_VIEWER_*.
-#
-# Return  : `1' if none found, `0' if found.
-# Output  : the argument that succeded.
-#
-# Variable prefix: _gfp
-#
-_get_first_prog()
-{
-  if is_equal "$#" 0;
-  then
-    error "_get_first_prog() needs 1 argument.";
-  fi;
-  if is_empty "$1";
-  then
-    return "${_BAD}";
-  fi;
-  eval set x "$(list_from_split "$1" ',')";
-  shift;
-  for i
-  do
-    _gfp_i="$i";
-    if obj _gfp_i is_empty;
-    then
-      continue;
-    fi;
-    if eval is_prog "$(get_first_essential ${_gfp_i})";
-    then
-      cat <<EOF
-${_gfp_i}
-EOF
-      eval ${_UNSET} _gfp_i;
-      return "${_GOOD}";
-    fi;
-  done;
-  eval ${_UNSET} _gfp_i;
-  return "${_BAD}";
-} # _get_first_prog() of main_set_mode()
-
-
-landmark '17: main_do_fileargs()';
-#######################################################################
-# main_do_fileargs ()
-#
-# Process filespec arguments in $_FILEARGS.
-#
-# Globals:
-#   in: $_FILEARGS (process with `eval set x "$_FILEARGS"; shift;')
-#
-# Variable prefix: mdfa
-#
-main_do_fileargs()
-{
-  func_check main_do_fileargs = 0 "$@";
-  mdfa_exitcode="${_BAD}";
-  eval set x "${_FILEARGS}";
-  shift;
-  eval ${_UNSET} _FILEARGS;
-  # temporary storage of all input to $_TMP_CAT
-  while test "$#" -ge 2;
-  do
-    # test for `s name' arguments, with `s' a 1-char standard section
-    mdfa_filespec="$1";
-    shift;
-    case "${mdfa_filespec}" in
-      '')
-        continue;
-        ;;
-      '-')
-        if register_file '-';
-        then
-          mdfa_exitcode="${_GOOD}";
-        fi;
-        continue;
-        ;;
-      ?)
-        if list_has_not _MAN_AUTO_SEC "${mdfa_filespec}";
-        then
-          if do_filearg "${mdfa_filespec}";
-          then
-            mdfa_exitcode="${_GOOD}";
-          fi;
-          continue;
-        fi;
-        mdfa_name="$1";
-        case "${mdfa_name}" in
-          */*|man:*|*\(*\)|*."${mdfa_filespec}")
-            if do_filearg "${mdfa_filespec}";
-            then
-              mdfa_exitcode="${_GOOD}";
-            fi;
-            continue;
-            ;;
-        esac;
-        if do_filearg "man:${mdfa_name}(${mdfa_filespec})";
-        then
-          mdfa_exitcode="${_GOOD}";
-          shift;
-          continue;
-        else
-          if do_filearg "${mdfa_filespec}";
-          then
-            mdfa_exitcode="${_GOOD}";
-          fi;
-          continue;
-        fi;
-        ;;
-      *)
-        if do_filearg "${mdfa_filespec}";
-        then
-          mdfa_exitcode="${_GOOD}";
-        fi;
-        continue;
-        ;;
-    esac;
-  done;				# end of `s name' test
-  while test "$#" -gt 0;
-  do
-    mdfa_filespec="$1";
-    shift;
-    if do_filearg "${mdfa_filespec}";
-    then
-      mdfa_exitcode="${_GOOD}";
-    fi;
-  done;
-  if obj _DEBUG_KEEP_FILES is_not_yes;
-  then
-    rm -f "${_TMP_STDIN}";
-  fi;
-  if is_equal "${mdfa_exitcode}" "${_BAD}";
-  then
-    eval ${_UNSET} mdfa_exitcode;
-    eval ${_UNSET} mdfa_filespec;
-    eval ${_UNSET} mdfa_name;
-    eval "${return_bad}";
-  fi;
-  eval ${_UNSET} mdfa_exitcode;
-  eval ${_UNSET} mdfa_filespec;
-  eval ${_UNSET} mdfa_name;
-  eval "${return_ok}";
-} # main_do_fileargs()
-
-
-landmark '18: main_set_resources()';
-########################################################################
-# main_set_resources ()
-#
-# Determine options for setting X resources with $_DISPLAY_PROG.
-#
-# Globals: $_DISPLAY_PROG, $_OUTPUT_FILE_NAME
-#
-# Variable prefix: msr
-#
-main_set_resources()
-{
-  func_check main_set_resources = 0 "$@";
-  # $msr_prog   viewer program
-  # $msr_rl     resource list
-  msr_title="$(get_first_essential \
-                 "${_OPT_TITLE}" "${_REGISTERED_TITLE}")";
-  _OUTPUT_FILE_NAME='';
-  eval set x "${msr_title}";
-  shift;
-  until is_equal "$#" 0;
-  do
-    msr_n="$1";
-    case "${msr_n}" in
-    '')
-      continue;
-      ;;
-    ,*)
-      msr_n="$(echo x"$1" | sed -e 's/^x,,*//')";
-      ;;
-    esac
-    if obj msr_n is_empty;
-    then
-      continue;
-    fi;
-    if obj _OUTPUT_FILE_NAME is_not_empty;
-    then
-      _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}"',';
-    fi;
-    _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}${msr_n}";
-    shift;
-  done;
-  case "${_OUTPUT_FILE_NAME}" in
-  '')
-    _OUTPUT_FILE_NAME='-';
-    ;;
-  ,*)
-    error "main_set_resources(): ${_OUTPUT_FILE_NAME} starts with a comma.";
-    ;;
-  esac;
-  _OUTPUT_FILE_NAME="${_TMP_DIR}/${_OUTPUT_FILE_NAME}";
-
-  if obj _DISPLAY_PROG is_empty;
-  then				# for example, for groff mode
-    _DISPLAY_ARGS='';
-    eval ${_UNSET} msr_n;
-    eval ${_UNSET} msr_prog;
-    eval ${_UNSET} msr_rl;
-    eval ${_UNSET} msr_title;
-    eval "${return_ok}";
-  fi;
-
-  eval set x "${_DISPLAY_PROG}";
-  shift;
-  msr_prog="$(base_name "$1")";
-  msr_rl='';
-  if obj _OPT_BD is_not_empty;
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-bd' "${_OPT_BD}";
-        ;;
-    esac;
-  fi;
-  if obj _OPT_BG is_not_empty;
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-bg' "${_OPT_BG}";
-        ;;
-      xpdf)
-        list_append msr_rl '-papercolor' "${_OPT_BG}";
-        ;;
-    esac;
-  fi;
-  if obj _OPT_BW is_not_empty;
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        _list_append msr_rl '-bw' "${_OPT_BW}";
-        ;;
-    esac;
-  fi;
-  if obj _OPT_FG is_not_empty;
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-fg' "${_OPT_FG}";
-        ;;
-    esac;
-  fi;
-  if is_not_empty "${_OPT_FN}";
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-fn' "${_OPT_FN}";
-        ;;
-    esac;
-  fi;
-  if is_not_empty "${_OPT_GEOMETRY}";
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi|xpdf)
-        list_append msr_rl '-geometry' "${_OPT_GEOMETRY}";
-        ;;
-    esac;
-  fi;
-  if is_empty "${_OPT_RESOLUTION}";
-  then
-    _OPT_RESOLUTION="${_DEFAULT_RESOLUTION}";
-    case "${msr_prog}" in
-      gxditview|xditview)
-        list_append msr_rl '-resolution' "${_DEFAULT_RESOLUTION}";
-        ;;
-      xpdf)
-        case "${_DEFAULT_RESOLUTION}" in
-          75)
-            # 72dpi is '100'
-            list_append msr_rl '-z' '104';
-            ;;
-          100)
-            list_append msr_rl '-z' '139';
-            ;;
-        esac;
-        ;;
-    esac;
-  else
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-resolution' "${_OPT_RESOLUTION}";
-        ;;
-      xpdf)
-        case "${_OPT_RESOLUTION}" in
-          75)
-            list_append msr_rl '-z' '104';
-            # '100' corresponds to 72dpi
-            ;;
-          100)
-            list_append msr_rl '-z' '139';
-            ;;
-        esac;
-        ;;
-    esac;
-  fi;
-  if is_yes "${_OPT_ICONIC}";
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-iconic';
-        ;;
-    esac;
-  fi;
-  if is_yes "${_OPT_RV}";
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi)
-        list_append msr_rl '-rv';
-        ;;
-    esac;
-  fi;
-  if is_not_empty "${_OPT_XRM}";
-  then
-    case "${msr_prog}" in
-      ghostview|gv|gxditview|xditview|xdvi|xpdf)
-        eval set x "${_OPT_XRM}";
-        shift;
-        for i
-        do
-          list_append msr_rl '-xrm' "$i";
-        done;
-        ;;
-    esac;
-  fi;
-  if is_not_empty "${msr_title}";
-  then
-    case "${msr_prog}" in
-      gxditview|xditview)
-        list_append msr_rl '-title' "${msr_title}";
-        ;;
-    esac;
-  fi;
-  _DISPLAY_ARGS="${msr_rl}";
-  eval ${_UNSET} msr_n;
-  eval ${_UNSET} msr_prog;
-  eval ${_UNSET} msr_rl;
-  eval ${_UNSET} msr_title;
-  eval "${return_ok}";
-} # main_set_resources
-
-
-landmark '19: main_display()';
-########################################################################
-# main_display ()
-#
-# Do the actual display of the whole thing.
-#
-# Globals:
-#   in: $_DISPLAY_MODE, $_OPT_DEVICE,
-#       $_ADDOPTS_GROFF, $_ADDOPTS_POST, $_ADDOPTS_X,
-#       $_REGISTERED_TITLE, $_TMP_CAT,
-#       $_OPT_PAGER $PAGER, $_MANOPT_PAGER,
-#       $_OUTPUT_FILE_NAME
-#
-# Variable prefix: md
-#
-main_display()
-{
-  func_check main_display = 0 "$@";
-
-  export md_addopts;
-  export md_groggy;
-  export md_modefile;
-
-  if obj _TMP_CAT is_non_empty_file;
-  then
-    md_modefile="${_OUTPUT_FILE_NAME}";
-  else
-    clean_up;
-    echo2 'groffer: empty input.';
-    eval ${_UNSET} md_modefile;
-    eval "${return_ok}";
-  fi;
-  case "${_DISPLAY_MODE}" in
-    groff)
-      _ADDOPTS_GROFF="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
-      if obj _OPT_DEVICE is_not_empty;
-      then
-        _ADDOPTS_GROFF="${_ADDOPTS_GROFF} -T${_OPT_DEVICE}";
-      fi;
-      md_groggy="$(tmp_cat | eval grog "${md_options}")";
-      trap_clean;
-      if obj _OPT_V is_yes;
-      then
-        echo "File:            ${md_modefile}";
-        echo "Mode:            ${_DISPLAY_MODE}";
-        echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
-        eval "${md_groggy}" "${_ADDOPTS_GROFF}";
-        clean_up;
-      else
-        # start a new shell program to get another process ID.
-        /bin/sh -c '
-          set -e;
-          test -f "${md_modefile}" && rm -f "${md_modefile}";
-          mv "${_TMP_CAT}" "${md_modefile}";
-          cat "${md_modefile}" | \
-          (
-            clean_up()
-            {
-              if test -d "${_TMP_DIR}";
-              then
-                rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
-              fi;
-            }
-            trap clean_up 0 2>${_NULL_DEV} || :;
-            eval "${md_groggy}" "${_ADDOPTS_GROFF}";
-          ) &'
-      fi;
-      ;;
-    text|tty)
-      case "${_OPT_DEVICE}" in
-        '')
-          md_device="$(get_first_essential \
-                         "${_OPT_TEXT_DEVICE}" "${_DEFAULT_TTY_DEVICE}")";
-          ;;
-        ascii|cp1047|latin1|utf8)
-          md_device="${_OPT_DEVICE}";
-          ;;
-        *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-          ;;
-      esac;
-      md_addopts="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
-      md_groggy="$(tmp_cat | grog -T${md_device})";
-      if obj _DISPLAY_MODE is_equal 'text';
-      then
-        if obj _OPT_V is_yes;
-        then
-          echo "File:            ${md_modefile}";
-          echo "Mode:            ${_DISPLAY_MODE}";
-          echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
-          eval "${md_groggy}" "${md_addopts}";
-        else
-          tmp_cat | eval "${md_groggy}" "${md_addopts}";
-        fi;
-      else
-        md_pager='';
-        for p in "${_OPT_PAGER}" "${PAGER}" "${_MANOPT_PAGER}" \
-                 'less -r -R' 'more' 'pager' 'cat'
-        do
-          md_p="$p";
-          if eval is_prog ${md_p};
-          then		      # no "" for is_prog() allows args for $p
-            md_pager="${md_p}";
-            break;
-          fi;
-        done;
-        if obj md_pager is_empty;
-        then
-          error 'main_display(): no pager program found for tty mode';
-        fi;
-        if obj _OPT_V is_yes;
-        then
-          echo "File:            ${md_modefile}";
-          echo "Mode:            ${_DISPLAY_MODE}";
-          echo "Display program: ${md_pager}";
-          eval "${md_groggy}" "${md_addopts}";
-        else
-          tmp_cat | eval "${md_groggy}" "${md_addopts}" | \
-                    eval "${md_pager}";
-        fi;
-      fi;
-      clean_up;
-      ;;
-    source)
-      tmp_cat;
-      clean_up;
-      ;;
-
-    #### viewer modes
-
-    dvi)
-      case "${_OPT_DEVICE}" in
-        ''|dvi) do_nothing; ;;
-        *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}"
-          ;;
-      esac;
-      md_modefile="${md_modefile}".dvi;
-      md_groggy="$(tmp_cat | grog -Tdvi)";
-      _do_display;
-      ;;
-    html)
-      case "${_OPT_DEVICE}" in
-        ''|html) do_nothing; ;;
-        *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-          ;;
-      esac;
-      md_modefile="${md_modefile}".html;
-      md_groggy="$(tmp_cat | grog -Thtml)";
-      _do_display;
-      ;;
-    pdf)
-      case "${_OPT_DEVICE}" in
-        ''|ps)
-          do_nothing;
-          ;;
-        *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-          ;;
-      esac;
-      md_groggy="$(tmp_cat | grog -Tps)";
-      trap_clean;
-      if obj _OPT_V is_yes;
-      then
-        echo "File:            ${md_modefile}.pdf";
-        echo "Mode:            ${_DISPLAY_MODE}";
-        echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
-        eval "${md_groggy}" "${_ADDOPTS_GROFF}";
-        clean_up;
-      else
-        # start a new shell program to get another process ID.
-        /bin/sh -c '
-          set -e;
-          _psfile="${md_modefile}.ps";
-          md_modefile="${md_modefile}.pdf";
-          test -f "${_psfile}" && rm -f "${_psfile}";
-          test -f "${md_modefile}" && rm -f "${md_modefile}";
-          cat "${_TMP_CAT}" | \
-            eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${_psfile}";
-          gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-             -sOutputFile="${md_modefile}" -c save pop -f "${_psfile}";
-          if test _"${_DEBUG_KEEP_FILES}"_ != _yes_;
-          then
-            test -f "${_psfile}" && rm -f "${_psfile}";
-            test -f "${_TMP_CAT}" && rm -f "${_TMP_CAT}";
-          fi;
-          (
-            clean_up() {
-              if test -d "${_TMP_DIR}";
-              then
-                rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
-              fi;
-            }
-            trap clean_up 0 2>${_NULL_DEV} || :;
-            eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
-          ) &'
-      fi;
-      ;;
-    ps)
-      case "${_OPT_DEVICE}" in
-        ''|ps)
-          do_nothing;
-          ;;
-        *)
-          warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-          ;;
-      esac;
-      md_modefile="${md_modefile}".ps;
-      md_groggy="$(tmp_cat | grog -Tps)";
-      _do_display;
-      ;;
-    x)
-      case "${_OPT_DEVICE}" in
-      X*)
-        md_device="${_OPT_DEVICE}"
-        ;;
-      *)
-        case "${_OPT_RESOLUTION}" in
-        100)
-          md_device='X100';
-          if obj _OPT_GEOMETRY is_empty
-          then
-            case "${_DISPLAY_PROG}" in
-            gxditview|xditview)
-              # add width of 800dpi for resolution of 100dpi to the args
-              list_append _DISPLAY_ARGS '-geometry' '800';
-              ;;
-            esac;
-          fi;
-          ;;
-        *)
-          md_device='X75-12';
-          ;;
-        esac
-      esac;
-      md_groggy="$(tmp_cat | grog -T${md_device} -Z)";
-      _do_display;
-      ;;
-    X)
-      case "${_OPT_DEVICE}" in
-      '')
-        md_groggy="$(tmp_cat | grog -X)";
-        ;;
-      X*|dvi|html|lbp|lj4|ps)
-        # these devices work with 
-        md_groggy="$(tmp_cat | grog -T"${_OPT_DEVICE}" -X)";
-        ;;
-      *)
-        warning "main_display(): \
-wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
-        md_groggy="$(tmp_cat | grog -Z)";
-        ;;
-      esac;
-      _do_display;
-      ;;
-    *)
-      error "main_display(): unknown mode \`${_DISPLAY_MODE}'";
-      ;;
-  esac;
-  eval ${_UNSET} md_addopts;
-  eval ${_UNSET} md_device;
-  eval ${_UNSET} md_groggy;
-  eval ${_UNSET} md_modefile;
-  eval ${_UNSET} md_options;
-  eval ${_UNSET} md_p;
-  eval ${_UNSET} md_pager;
-  eval "${return_ok}";
-} # main_display()
-
-
-# $md_modefile and $md_groggy come from main_display()
-_do_display()
-{
-  func_check _do_display = 0 "$@";
-  trap_clean;
-  if obj _OPT_V is_yes;
-  then
-    echo "File:            ${md_modefile}";
-    echo "Mode:            ${_DISPLAY_MODE}";
-    echo "Display program: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
-    eval "${md_groggy}" "${_ADDOPTS_GROFF}";
-    clean_up;
-  else
-    # start a new shell program for another process ID and better
-    # cleaning-up of the temporary files.
-    /bin/sh -c '
-      set -e;
-      test -f "${md_modefile}" && rm -f "${md_modefile}";
-      cat "${_TMP_CAT}" | \
-        eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${md_modefile}";
-      if test _"${_DEBUG_KEEP_FILES}"_ != _yes_;
-      then
-        rm -f "${_TMP_CAT}";
-      fi;
-      (
-        clean_up() {
-          if test -d "${_TMP_DIR}";
-          then
-            rm -f -r "'${_TMP_DIR}'" >${_NULL_DEV} 2>&1 || :;
-          fi;
-        }
-        trap clean_up 0 2>${_NULL_DEV} || :;
-        eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${md_modefile}";
-      ) &'
-  fi;
-  eval "${return_ok}";
-} # _do_display() of main_display()
-
-
-########################################################################
-# main (<command_line_args>*)
-#
-# The main function for groffer.
-#
-# Arguments:
-#
-main()
-{
-  func_check main '>=' 0 "$@";
-  # Do not change the sequence of the following functions!
-  main_init;
-  main_parse_MANOPT;
-  main_parse_args "$@";
-  main_set_mode;
-  main_do_fileargs;
-  main_set_resources;
-  main_display;
-  eval "${return_ok}";
-}
-
-landmark '20: end of function definitions';
-
-########################################################################
-
-main "$@";



