This approach replaces the one Thomas Dickey applied in ncurses 20251101 with one that works on all ncurses man pages, not just terminfo(5).
* configure.in: Drop expansion of `CF_CHECK_TBL_X_OPTION` macro.
* MKterminfo.sh: Remove code conditional on `@TBL_X_OPTION@`. These
stop rewriting 'Lx' as 'L' anywhere in under-construction terminfo(5)
man page. That approach (1) fails with my previous changes to also
include an explicit column width and (2) could alter text outside of
table format descriptions.
* aclocal.m4 (CF_MAN_PAGES): Use `AC_REQUIRE()` to depend on
`CF_CHECK_TBL_X_OPTION`. Add stanza to populate `$cf_edit_man`
("edit_man.sh" on a POSIX system) with a test of
`$cf_cv_tbl_x_option_okay`. If that configuration variable is not
"yes", rewrite table format descriptions, removing the 'x' character.
Tested by deliberately inverting the sense of the aforementioned test in
"aclocal.m4".
---
aclocal.m4 | 10 ++++++++++
configure.in | 1 -
man/MKterminfo.sh | 10 ++--------
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 3d706cac8..5e55bb79d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -6081,6 +6081,7 @@ dnl so, what format is used. Use this information to
construct a script that
dnl will install man pages.
AC_DEFUN([CF_MAN_PAGES],
[
+AC_REQUIRE([CF_CHECK_TBL_X_OPTION])
CF_HELP_MESSAGE(Options to Specify How Manpages are Installed:)
CF_MANPAGE_FORMAT
CF_MANPAGE_RENAMES
@@ -6242,6 +6243,15 @@ cat >>$cf_edit_man <<CF_EOF
CF_EOF
fi
+cat >>$cf_edit_man <<CF_EOF
+if test $cf_cv_tbl_x_option_okay != yes ; then
+ # Remove column modifier 'x' from table descriptions if the
+ # system's tbl(1) doesn't support it.
+ sed -e '/^\.TS/,/\.$/s@x[[.]]@.@' \$TMP >\$TMP.unx
+ mv \$TMP.unx \$TMP
+fi
+CF_EOF
+
cat >>$cf_edit_man <<CF_EOF
if test \$cf_tables = yes ; then
tbl \$TMP >\$TMP.out
diff --git a/configure.in b/configure.in
index 55ee25007..b13ccff4e 100644
--- a/configure.in
+++ b/configure.in
@@ -2380,7 +2380,6 @@ esac
###############################################################################
CF_MAN_PAGES([ captoinfo clear infocmp infotocap reset tabs tic toe tput tset
])
-CF_CHECK_TBL_X_OPTION
################################################################################
test "x$use_database" = xyes && \
diff --git a/man/MKterminfo.sh b/man/MKterminfo.sh
index a401f89e7..05724a294 100755
--- a/man/MKterminfo.sh
+++ b/man/MKterminfo.sh
@@ -89,12 +89,8 @@ cat <<EOF
.\\" Some man(1) programs recognize the token in the first-line comment
.\\" as directing them to arrange such a pipeline.
EOF
-if test "@TBL_X_OPTION@" = no
-then
- sed -e "s/Lx/L/" "$head"
-else
- cat "$head"
-fi
+
+cat "$head"
cat >$pass1 <<EOF
/%%-STOP-HERE-%%/q
@@ -113,7 +109,6 @@ s/ str / /p
EOF
echo 's/^$/../' > $pass2
-test "@TBL_X_OPTION@" = no && echo "s/Lx/L/g" >> $pass2
sed -n -f $pass1 $caps | sed -f $pass2 | tr "\134" "\006" >$unsorted
@@ -148,6 +143,5 @@ cat > $pass3 << "EOF"
/^center expand;/s, expand,,
/^\.TS/,/^\\/s, lw[1-9][0-9]*\., l.,
EOF
-test "@TBL_X_OPTION@" = no && echo "s/Lx/L/g" >> $pass3
sed -f $pass3 "$tail"
--
2.30.2
signature.asc
Description: PGP signature
