groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub RE...


From: Werner LEMBERG
Subject: [Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub RE...
Date: Sat, 02 Jul 2005 13:37:54 -0400

CVSROOT:        /cvsroot/groff
Module name:    groff
Branch:         
Changes by:     Werner LEMBERG <address@hidden> 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 address@hidden@' 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 address@hidden@'.

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 address@hidden@' 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 address@hidden@'.
+
+       ________________________________________________________________
        * 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 <address@hidden>
@@ -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
 <address@hidden> can be used.  For a general discussion, the
-mailing list <address@hidden> 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 <address@hidden> 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 address@hidden@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 @address@hidden
@@ -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}";
     ) &'
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]