Module Name:    src
Committed By:   uwe
Date:           Wed Nov 27 19:07:32 UTC 2019

Modified Files:
        src/distrib/notes: Makefile.inc
        src/distrib/notes/common: macros

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/notes/Makefile.inc
cvs rdiff -u -r1.44 -r1.45 src/distrib/notes/common/macros

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/notes/Makefile.inc
diff -u src/distrib/notes/Makefile.inc:1.47 src/distrib/notes/Makefile.inc:1.48
--- src/distrib/notes/Makefile.inc:1.47	Wed Nov 27 15:58:12 2019
+++ src/distrib/notes/Makefile.inc	Wed Nov 27 19:07:31 2019
@@ -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 <r...@netbsd.org>
@@ -107,9 +107,7 @@ ${TARG}.more: ${SRCS} ${TOC.more} ${DIST
 # 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

Index: src/distrib/notes/common/macros
diff -u src/distrib/notes/common/macros:1.44 src/distrib/notes/common/macros:1.45
--- src/distrib/notes/common/macros:1.44	Wed Nov 27 09:29:25 2019
+++ src/distrib/notes/common/macros	Wed Nov 27 19:07:31 2019
@@ -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

Reply via email to