Source-Changes-HG archive

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

[src/trunk]: src/distrib/notes Use .open/.write instead of .tm to emit TOC.



details:   https://anonhg.NetBSD.org/src/rev/7f575cb00a24
branches:  trunk
changeset: 1005075:7f575cb00a24
user:      uwe <uwe%NetBSD.org@localhost>
date:      Thu Nov 28 00:06:39 2019 +0000

description:
Use .open/.write instead of .tm to emit TOC.

diffstat:

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

diffs (72 lines):

diff -r e88b99cacdf9 -r 7f575cb00a24 distrib/notes/Makefile.inc
--- a/distrib/notes/Makefile.inc        Wed Nov 27 23:57:41 2019 +0000
+++ b/distrib/notes/Makefile.inc        Thu Nov 28 00:06:39 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.50 2019/11/27 23:19:13 uwe Exp $
+#      $NetBSD: Makefile.inc,v 1.51 2019/11/28 00:06:39 uwe Exp $
 #
 
 # Ross Harvey <ross%NetBSD.org@localhost>
@@ -107,32 +107,26 @@
 # They are generated twice to take into account the
 # space taken by the TOC itself.
 
-# TOC is emitted with .tm on groff's stderr, divert those lines to stdout.
-# NB: /dev/stderr is nawk's internal designation, not /dev/stderr file.
-# TODO: use .open/.write instead.
-TOCPROC = 2>&1 >/dev/null | \
-       ${TOOL_AWK} '{ if ($$1 == ".Ti") print; else print > "/dev/stderr"; }'
-
 ${TARG}.PostScript.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.ASCII.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.HTML.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.more.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 
diff -r e88b99cacdf9 -r 7f575cb00a24 distrib/notes/common/macros
--- a/distrib/notes/common/macros       Wed Nov 27 23:57:41 2019 +0000
+++ b/distrib/notes/common/macros       Thu Nov 28 00:06:39 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: macros,v 1.48 2019/11/27 23:57:41 uwe Exp $
+.\"    $NetBSD: macros,v 1.49 2019/11/28 00:06:39 uwe Exp $
 .\"
 .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -311,10 +311,12 @@
 .\"   .Ti depth page "item"    (internal) output an entry
 .ds toc-file INSTALL.\*[format].toc
 .if dTOC \{\
+.tm ...writing \*[toc-file].tmp
+.open toc-tmp \*[toc-file].tmp
 .de mktoc
 .nr mktoc-level \\$1
 .shift
-.tm .Ti \\n[toc-level] \\n% "\\$*"
+.write toc-tmp .Ti \\n[toc-level] \\n% "\\$*"
 ..
 .rn Ss Ss-toc
 .de Ss



Home | Main Index | Thread Index | Old Index