diff options
author | ru <ru@FreeBSD.org> | 2000-12-05 19:06:41 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-12-05 19:06:41 +0000 |
commit | 1f010d72ed9d0824998243537e0dd222b42d9fce (patch) | |
tree | 85ff7fdaa4b2bc9e4ac18caa8f24e9a56a3120a4 /contrib/groff/nroff | |
parent | 074a14ffb2a44fe009f9e084ba3c279dfb001506 (diff) | |
download | FreeBSD-src-1f010d72ed9d0824998243537e0dd222b42d9fce.zip FreeBSD-src-1f010d72ed9d0824998243537e0dd222b42d9fce.tar.gz |
Resolve conflicts after v1.16.1 import.
Diffstat (limited to 'contrib/groff/nroff')
-rw-r--r-- | contrib/groff/nroff/nroff.man | 81 | ||||
-rwxr-xr-x | contrib/groff/nroff/nroff.sh | 135 |
2 files changed, 113 insertions, 103 deletions
diff --git a/contrib/groff/nroff/nroff.man b/contrib/groff/nroff/nroff.man index d8d9816..e33feb9 100644 --- a/contrib/groff/nroff/nroff.man +++ b/contrib/groff/nroff/nroff.man @@ -1,5 +1,5 @@ .ig \"-*- nroff -*- -Copyright (C) 1989-1999 Free Software Foundation, Inc. +Copyright (C) 1989-2000 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -23,37 +23,28 @@ the original English. .SH NAME @g@nroff \- emulate nroff command with groff .SH SYNOPSIS +.nr a \n(.j +.ad l +.nr i \n(.i +.in +\w'\fB@g@nroff 'u +.ti \niu .B @g@nroff -[ -.B \-h -] -[ -.B \-i -] -[ -.BI \-m name -] -[ -.BI \-n num -] -[ -.BI \-o list -] -[ -.BI \-p -] -[ -.BI \-r cn -] -[ -.BI \-t -] -[ -.BI \-T name -] -[ -.I file\|.\|.\|. -] +.de OP +.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]" +.el .RB "[\ " "\\$1" "\ ]" +.. +.OP \-h +.OP \-i +.OP \-m name +.OP \-n num +.OP \-o list +.OP \-p +.OP \-r cn +.OP \-t +.OP \-T name +.RI "[\ " file\|.\|.\|. "\ ]" +.br +.ad \na .SH DESCRIPTION The .B @g@nroff @@ -63,11 +54,12 @@ command using groff. The .B \-T option with an argument other than -.B ascii -and -.B latin1 -and -.B koi8-r +.BR ascii , +.BR latin1 , +.BR koi8-r , +.BR utf8 , +or +.B cp1047 will be ignored. The .B \-h @@ -80,11 +72,9 @@ The .BR \-i , .BR \-n , .BR \-m , -.BR \-p , -.BR \-o , -.B \-r +.B \-o and -.B \-t +.B \-r options have the effect described in .BR @g@troff (@MAN1EXT@). In addition @@ -95,12 +85,21 @@ silently ignores options of or .BR \-s . Options +.BR \-p , +.BR \-t , .B \-S (safer) and .B \-U -(unsafe) are passed to groff. +(unsafe) are passed to +.BR groff . .B \-S is passed by default. +.SH NOTES +This shell script is basically intended for use with +.BR man (1), +so warnings are suppressed. +nroff-style character definitions (in the file tmac.tty-char) are also +loaded to emulate unrepresentable glyphs. .SH "SEE ALSO" .BR groff (@MAN1EXT@), .BR @g@troff (@MAN1EXT@), diff --git a/contrib/groff/nroff/nroff.sh b/contrib/groff/nroff/nroff.sh index 12f3fd1..d658657 100755 --- a/contrib/groff/nroff/nroff.sh +++ b/contrib/groff/nroff/nroff.sh @@ -4,72 +4,83 @@ prog="$0" # Default device. -locale=${LC_CTYPE:-$LANG} -if test `expr "$locale" : ".*\.ISO_8859-1"` -gt 0 -then - T=-Tlatin1 -else -if test `expr "$locale" : ".*\.KOI8-R"` -gt 0 -then - T=-Tkoi8-r -else - T=-Tascii -fi -fi +# First try the "locale charmap" command, because it's most reliable. +# On systems where it doesn't exist, look at the environment variables. +case "`#locale charmap 2>/dev/null`" in + UTF-8) + T=-Tutf8 ;; + ISO-8859-1) + T=-Tlatin1 ;; + IBM-1047) + T=-Tcp1047 ;; + *) + case "${LC_ALL-${LC_CTYPE-${LANG}}}" in + *.UTF-8) + T=-Tutf8 ;; + iso_8859_1 | *.ISO-8859-1 | *.ISO_8859-1) + T=-Tlatin1 ;; + *.IBM-1047) + T=-Tcp1047 ;; + *.KOI8-R) + T=-Tkoi8-r ;; + *) + case "$LESSCHARSET" in + utf-8) + T=-Tutf8 ;; + latin1) + T=-Tlatin1 ;; + cp1047) + T=-Tcp1047 ;; + *) + T=-Tascii ;; + esac ;; + esac ;; +esac opts= safer=-S -for i -do - case $1 in - -h) - opts="$opts -P-h" - ;; - -[eq]|-s*) - # ignore these options - ;; - -[mrnoT]) - echo "$prog: option $1 requires an argument" >&2 - exit 1 - ;; - -[iStp]|-[mrno]*) - opts="$opts $1"; - ;; +# `for i; do' doesn't work with some versions of sh - -Tascii|-Tlatin1|-Tkoi8-r) - T=$1 - ;; - -T*) - # ignore other devices - ;; - -S) - # safer behaviour - safer=-S - ;; - -U) - # unsafe behaviour - safer=-U - ;; - -u*) - # Solaris 2.2 `man' uses -u0; ignore it, - # since `less' and `more' can use the emboldening info. - ;; - --) - shift - break - ;; - -) - break - ;; - -*) - echo "$prog: invalid option $1" >&2 - exit 1 - ;; - *) - break - ;; - esac - shift +for i + do + case $1 in + -h) + opts="$opts -P-h" ;; + -[eq] | -s*) + # ignore these options + ;; + -[mrnoT]) + echo "$prog: option $1 requires an argument" >&2 + exit 1 ;; + -[itp] | -[mrno]*) + opts="$opts $1" ;; + -Tascii | -Tlatin1 | -Tkoi8-r | -Tutf8 | -Tcp1047) + T=$1 ;; + -T*) + # ignore other devices + ;; + -S) + # safer behaviour + safer=-S ;; + -U) + # unsafe behaviour + safer=-U ;; + -u*) + # Solaris 2.2 `man' uses -u0; ignore it, + # since `less' and `more' can use the emboldening info. + ;; + --) + shift + break ;; + -) + break ;; + -*) + echo "$prog: invalid option $1" >&2 + exit 1 ;; + *) + break ;; + esac + shift done # This shell script is intended for use with man, so warnings are |