Source-Changes-HG archive

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

[src/trunk]: src/distrib/notes Make .Te and .To also emit .Ti with quoted arg...



details:   https://anonhg.NetBSD.org/src/rev/4cd9504c9e3f
branches:  trunk
changeset: 461482:4cd9504c9e3f
user:      uwe <uwe%NetBSD.org@localhost>
date:      Wed Nov 27 19:07:31 2019 +0000

description:
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.

diffstat:

 distrib/notes/Makefile.inc  |   6 ++----
 distrib/notes/common/macros |  16 ++++++++++------
 2 files changed, 12 insertions(+), 10 deletions(-)

diffs (52 lines):

diff -r 421ac6f4b0b7 -r 4cd9504c9e3f distrib/notes/Makefile.inc
--- a/distrib/notes/Makefile.inc        Wed Nov 27 19:04:45 2019 +0000
+++ b/distrib/notes/Makefile.inc        Wed Nov 27 19:07:31 2019 +0000
@@ -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@localhost>
@@ -107,9 +107,7 @@
 # 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
diff -r 421ac6f4b0b7 -r 4cd9504c9e3f distrib/notes/common/macros
--- a/distrib/notes/common/macros       Wed Nov 27 19:04:45 2019 +0000
+++ b/distrib/notes/common/macros       Wed Nov 27 19:07:31 2019 +0000
@@ -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



Home | Main Index | Thread Index | Old Index