diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-28 13:00:52 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-28 13:00:52 +0000 |
commit | 08973cb4d1227bb54783bdeab50035c9a6bfbec0 (patch) | |
tree | 29302e4a7dce3f5a46a365d627f6e4d95bf18e20 /regress/usr.bin/mandoc | |
parent | 83c0700d2695f59ff8403c43a705f01176ecab53 (diff) |
Implement the roff \z escape sequence, intended to output the next
character without advancing the cursor position; implement it to
simply skip the next character, as it will usually be overwritten.
With this change, the pod2man(1) preamble user-defined string \*:,
intended to render as a diaeresis or umlaut diacritic above the
preceding character, is rendered in a slightly less ugly way,
though still not correctly. It was rendered as "z.." and is now
rendered as ".".
Given that the definition of \*: uses elaborate manual \h positioning,
there is little chance for mandoc(1) to ever render it correctly,
but at least we can refrain from printing out a spurious "z", and
we can make the \z do something semi-reasonable for easier cases.
Diffstat (limited to 'regress/usr.bin/mandoc')
-rw-r--r-- | regress/usr.bin/mandoc/roff/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/esc/Makefile | 15 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/esc/z.in | 22 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/esc/z.out_ascii | 15 |
4 files changed, 54 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/Makefile b/regress/usr.bin/mandoc/roff/Makefile index e4b892b517a..9bd19806a52 100644 --- a/regress/usr.bin/mandoc/roff/Makefile +++ b/regress/usr.bin/mandoc/roff/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.8 2011/11/17 16:28:46 schwarze Exp $ +# $OpenBSD: Makefile,v 1.9 2012/05/28 13:00:51 schwarze Exp $ -SUBDIR+= args cond string br na ps rm sp +SUBDIR+= args esc cond string br na ps rm sp ascii groff groff-clean obj-clean tman: _SUBDIRUSE diff --git a/regress/usr.bin/mandoc/roff/esc/Makefile b/regress/usr.bin/mandoc/roff/esc/Makefile new file mode 100644 index 00000000000..41c7afe8bc4 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/esc/Makefile @@ -0,0 +1,15 @@ +# $OpenBSD: Makefile,v 1.1 2012/05/28 13:00:51 schwarze Exp $ + +REGRESS_TARGETS=z + +# Postprocessing to remove "character backspace" sequences +# unless they are foolowed by the same character again. +# This removes underlining as well, so we mustn't use it. +# Cannot use /g because matches progress backwards. + +z.out_ascii: z.in + ${NROFF} ${.ALLSRC} | \ + perl -pe 'while (s/(.)\010(?!\1)//) {}' \ + > ${.TARGET} + +.include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/esc/z.in b/regress/usr.bin/mandoc/roff/esc/z.in new file mode 100644 index 00000000000..7076ebb0bcd --- /dev/null +++ b/regress/usr.bin/mandoc/roff/esc/z.in @@ -0,0 +1,22 @@ +.Dd May 28, 2012 +.Dt ESC-Z 1 +.Os OpenBSD +.Sh NAME +.Nm esc-z +.Nd the roff escape z sequence +.Sh DESCRIPTION +single z with ASCII char: >\zx< +.br +single z with escape char: >\z\(ci< +.br +.ds mystr mytext +single z with defined string (\*[mystr]): >\z\*[mystr]< +.br +single z with font escape: >\z\fBxbold\fP< +.br +single z with nospace escape: >\z\c +new line< +.br +single z with undefined escape: >\z\a< +.br +double z: >\z\zx< diff --git a/regress/usr.bin/mandoc/roff/esc/z.out_ascii b/regress/usr.bin/mandoc/roff/esc/z.out_ascii new file mode 100644 index 00000000000..aa1455b83f5 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/esc/z.out_ascii @@ -0,0 +1,15 @@ +ESC-Z(1) OpenBSD Reference Manual ESC-Z(1) + +NNAAMMEE + eesscc--zz - the roff escape z sequence + +DDEESSCCRRIIPPTTIIOONN + single z with ASCII char: >< + single z with escape char: >< + single z with defined string (mytext): >ytext< + single z with font escape: >bboolldd< + single z with nospace escape: > new line< + single z with undefined escape: >< + double z: >< + +OpenBSD May 28, 2012 OpenBSD |