Make .Te and .To also emit .Ti with quoted arguments.

I missed them b/c I tested on sparc notes and sparc/install is stuck
in the 90s and doesn't include common/sysinst.  Now that all emitted
.Ti have properly quoted arguments we can revert TOCPROC to simple
grep.

While here convert .Te and .To to also use $* so we we can also drop
quoting from their calls in common/sysinst now.  Don't actually drop
those quotes yet though, as we probably can further simplify the call
sites by emitting the headings automatically instead of duplicating
them.
This commit is contained in:
uwe 2019-11-27 19:07:31 +00:00
parent d5fb362f78
commit aa4a633943
2 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.47 2019/11/27 15:58:12 martin Exp $
# $NetBSD: Makefile.inc,v 1.48 2019/11/27 19:07:31 uwe Exp $
#
# Ross Harvey <ross@NetBSD.org>
@ -107,9 +107,7 @@ ${TARG}.more: ${SRCS} ${TOC.more} ${DISTRIBVERDEP}
# space taken by the TOC itself.
#
TOCPROC= 2>&1 >/dev/null |\
${TOOL_SED} -n -e 's/"//g' \
-e '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }'
TOCPROC= 2>&1 >/dev/null | ${TOOL_GREP} -e '^\.Ti'
${TARG}.PostScript.toc: ${SRCS}
${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp

View File

@ -1,4 +1,4 @@
.\" $NetBSD: macros,v 1.44 2019/11/27 09:29:25 martin Exp $
.\" $NetBSD: macros,v 1.45 2019/11/27 19:07:31 uwe Exp $
.\"
.\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -322,13 +322,17 @@
..
.\}
.de Te
.ie rHTML <a name="\\$2">\\$2</a>
.el \\$2
.if dTOC \.tm .Ti \\$1 \\n% \\$2
.nr Te-toc-level \\$1
.shift
.ie rHTML <a name="\\$*">\\$*</a>
.el \\$*
.if dTOC .tm .Ti \\n[Te-toc-level] \\n% "\\$*"
..
.de To
.if rHTML <a name="\\$2"></a>
.if dTOC \.tm .Ti \\$1 \\n% \\$2
.nr To-toc-level \\$1
.shift
.if rHTML <a name="\\$*"></a>
.if dTOC .tm .Ti \\n[To-toc-level] \\n% "\\$*"
..
.de Ti
.ie rHTML \{.ta (\n(.lu+\w'<a href="#\\$3"></a>'u)R