groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ChangeLog src/roff/nroff/nroff.man src/ro...


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog src/roff/nroff/nroff.man src/ro...
Date: Mon, 19 Nov 2007 20:36:46 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     07/11/19 20:36:46

Modified files:
        .              : ChangeLog 
        src/roff/nroff : nroff.man nroff.sh 

Log message:
        * src/roff/nroff/nroff.sh: Handle GROFF_TYPESETTER environment
        variable.  Problem reported by Michael G Schwern
        <address@hidden>.
        
        * src/roff/nroff/nroff.man: Document it.
        Other minor updates.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1111&r2=1.1112
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/nroff/nroff.man?cvsroot=groff&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/nroff/nroff.sh?cvsroot=groff&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1111
retrieving revision 1.1112
diff -u -b -r1.1111 -r1.1112
--- ChangeLog   19 Nov 2007 09:28:44 -0000      1.1111
+++ ChangeLog   19 Nov 2007 20:36:45 -0000      1.1112
@@ -1,3 +1,12 @@
+2007-11-17  Werner LEMBERG  <address@hidden>
+
+       * src/roff/nroff/nroff.sh: Handle GROFF_TYPESETTER environment
+       variable.  Problem reported by Michael G Schwern
+       <address@hidden>.
+
+       * src/roff/nroff/nroff.man: Document it.
+       Other minor updates.
+
 2007-11-17  Heinz-Jürgen Oertel <address@hidden>
 
        * src/groff/preproc/pic/lex.cpp (table): Add box attributes

Index: src/roff/nroff/nroff.man
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/nroff/nroff.man,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- src/roff/nroff/nroff.man    13 Apr 2005 05:56:32 -0000      1.17
+++ src/roff/nroff/nroff.man    19 Nov 2007 20:36:46 -0000      1.18
@@ -1,5 +1,6 @@
 .ig
-Copyright (C) 1989-2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+Copyright (C) 1989-2001, 2002, 2003, 2005, 2007
+  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,17 +24,16 @@
 @address@hidden \- emulate nroff command with groff
 .
 .SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'address@hidden@nroff 'u
-.ti \niu
-.B @address@hidden
+.
+.\" Redefine OP because no spaces are allowed after an option's argument.
 .de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
+.  ie \\n(.$-1 \
+.    RI "[\fB\\$1\fP" "\\$2" "]"
+.  el \
+.    RB "[" "\\$1" "]"
 ..
-.
+
+.SY @address@hidden
 .OP \-CchipStUv
 .OP \-d cs
 .OP \-M dir
@@ -42,9 +42,16 @@
 .OP \-o list
 .OP \-r cn
 .OP \-T name
-.RI "[\ " "file" "\ .\|.\|.\ ]"
-.br
-.ad \na
+.RI [ file .\|.\|.]
+.
+.SY @address@hidden
+.B \-\-help
+.
+.SY @address@hidden
+.B \-v
+|
+.B \-\-version
+.YS
 .
 .SH DESCRIPTION
 The
@@ -58,14 +65,17 @@
 .BR utf8 ,
 and
 .B cp1047
-are valid arguments for the
-.B -T
-option, selecting the output encoding emitted by
+are devices accepted by
+.BR nroff
+to select the output encoding emitted by
 .BR grotty ,
 groff's TTY output device.
-If an invalid or no
-.BR \-T
-option is given,
+If neither the
+.B GROFF_TYPESETTER
+environment variable nor the
+.B \-T
+command line option (which overrides the environment variable)
+specifies a (valid) device,
 .B @address@hidden
 checks the current locale to select a default output device.
 It first tries the
@@ -123,15 +133,27 @@
 (unsafe) are passed to
 .BR groff . 
 .B \-v
-shows the version number.
+and
+.B \-\-version
+show the version number,
+.B \-\-help
+prints a help message.
 .
 .SH ENVIRONMENT
 .TP
 .SM
+.B GROFF_TYPESETTER
+The default device for
+.BR groff .
+If not set (which is the normal case), it defaults to `ps'.
+.
+.TP
+.SM
 .B GROFF_BIN_PATH
 A colon separated list of directories in which to search for the
 .B groff
 executable before searching in PATH.  If unset, address@hidden@' is used.
+.
 .SH NOTES
 This shell script is basically intended for use with
 .BR man (1),

Index: src/roff/nroff/nroff.sh
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/nroff/nroff.sh,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- src/roff/nroff/nroff.sh     4 Nov 2007 07:07:49 -0000       1.20
+++ src/roff/nroff/nroff.sh     19 Nov 2007 20:36:46 -0000      1.21
@@ -2,7 +2,7 @@
 # Emulate nroff with groff.
 #
 # Copyright (C) 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
-#               2004, 2005
+#               2004, 2005, 2007
 #   Free Software Foundation, Inc.
 #
 # Written by James Clark, maintained by Werner Lemberg.
@@ -26,42 +26,48 @@
 # USA.
 
 prog="$0"
+
 # Default device.
-# First try the "locale charmap" command, because it's most reliable.
+
+# Check the GROFF_TYPESETTER environment variable.
+Tenv=$GROFF_TYPESETTER
+
+# Try the `locale charmap' command first because it is most reliable.
 # On systems where it doesn't exist, look at the environment variables.
 case "`exec 2>/dev/null ; locale charmap`" in
   UTF-8)
-    T=-Tutf8 ;;
+    Tloc=utf8 ;;
   ISO-8859-1 | ISO-8859-15)
-    T=-Tlatin1 ;;
+    Tloc=latin1 ;;
   IBM-1047)
-    T=-Tcp1047 ;;
+    Tloc=cp1047 ;;
   *)
     case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
       *.UTF-8)
-        T=-Tutf8 ;;
+        Tloc=utf8 ;;
       iso_8859_1 | *.ISO-8859-1 | *.ISO8859-1 | \
       iso_8859_15 | *.ISO-8859-15 | *.ISO8859-15)
-        T=-Tlatin1 ;;
+        Tloc=latin1 ;;
       *.IBM-1047)
-        T=-Tcp1047 ;;
+        Tloc=cp1047 ;;
       *)
         case "$LESSCHARSET" in
           utf-8)
-            T=-Tutf8 ;;
+            Tloc=utf8 ;;
           latin1)
-            T=-Tlatin1 ;;
+            Tloc=latin1 ;;
           cp1047)
-            T=-Tcp1047 ;;
+            Tloc=cp1047 ;;
           *)
-            T=-Tascii ;;
+            Tloc=ascii ;;
           esac ;;
      esac ;;
 esac
-opts=
 
 # `for i; do' doesn't work with some versions of sh
 
+Topt=
+opts=
 for i
   do
   case $1 in
@@ -77,11 +83,8 @@
       exit 1 ;;
     -[iptSUC] | -[dMmrno]*)
       opts="$opts $1" ;;
-    -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047)
-      T=$1 ;;
     -T*)
-      # ignore other devices
-      ;;
+      Topt=$1 ;;
     -u*)
       # Solaris 2.2 through at least Solaris 9 `man' invokes
       # `nroff -u0 ... | col -x'.  Ignore the -u0,
@@ -109,6 +112,22 @@
   shift
 done
 
+if test "x$Topt" != x ; then
+  T=$Topt
+else
+  if test "x$Tenv" != x ; then
+    T=-T$Tenv
+  fi
+fi
+
+case $T in
+  -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047)
+    ;;
+  *)
+    # ignore other devices and use locale fallback
+    T=-T$Tloc ;;
+esac
+
 # Set up the `GROFF_BIN_PATH' variable
 # to be exported in the current `GROFF_RUNTIME' environment.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]