From 005bcc6b1d086c580bddac2fb6d976b3388902be Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 28 Jul 2011 14:17:11 +0000 Subject: An implementation of `tr'. This routes allocations of TEXT nodes through libroff, which does the appropriate translations of `tr'. This is SLOW: it uses the backend of `ds' and `de', which is a simple linear list. However, unlike `ds' and `de', it iterates over EACH CHARACTER of the entire file looking for replacements. --- roff.7 | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'roff.7') diff --git a/roff.7 b/roff.7 index 41837a1d..1dc8c06b 100644 --- a/roff.7 +++ b/roff.7 @@ -1,4 +1,4 @@ -.\" $Id: roff.7,v 1.29 2011/05/24 15:22:14 kristaps Exp $ +.\" $Id: roff.7,v 1.30 2011/07/28 14:17:11 kristaps Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons .\" Copyright (c) 2010 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 24 2011 $ +.Dd $Mdocdate: July 28 2011 $ .Dt ROFF 7 .Os .Sh NAME @@ -584,10 +584,21 @@ This line-scoped request can take an arbitrary number of arguments. Currently, it is ignored including its arguments. .Ss \&tr Output character translation. -This request is intended to have one argument, -consisting of an even number of characters. -Currently, it is ignored including its arguments, -and the number of arguments is not checked. +Its syntax is as follows: +.Pp +.D1 Pf \. Cm \&tr Ar [ab]+ +.Pp +Pairs of +.Ar ab +characters are replaced +.Ar ( a +for +.Ar b ) . +Replacement (or origin) characters may also be character escapes; thus, +.Pp +.Dl tr \e(xx\e(yy +.Pp +replaces all invocations of \e(xx with \e(yy. .Ss \&T& Re-start a table layout, retaining the options of the prior table invocation. -- cgit v1.2.3-56-ge451