summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner LEMBERG <wl@gnu.org>2004-05-06 11:47:21 +0000
committerWerner LEMBERG <wl@gnu.org>2004-05-06 11:47:21 +0000
commit2101c7d8e1a25bab27f09a35ade1f24024708761 (patch)
tree8ea186d4454dfead5bbe58240542cde535d466d4
parent799c277dcd8899f61555e6b9d1b57eca884444e2 (diff)
downloadgroff-git-2101c7d8e1a25bab27f09a35ade1f24024708761.tar.gz
* NEWS, man/groff_diff.man, man/groff.man, doc/groff.texinfo:
Document `.U' register. * src/roff/troff/env.cpp (environment::mark_last_line) [WIDOW_CONTROL]: Fix scope of `p' for new C++ compilers. New read-only register `.U'; it returns 1 in safer mode and 0 otherwise. * src/roff/troff/input.cpp (init_input_requests): Implement `.U' register.
-rw-r--r--ChangeLog16
-rw-r--r--NEWS3
-rw-r--r--doc/groff.texinfo9
-rw-r--r--man/groff.man7
-rw-r--r--man/groff_diff.man12
-rw-r--r--src/roff/troff/env.cpp3
-rw-r--r--src/roff/troff/input.cpp1
7 files changed, 45 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 01c7a5832..20fbc7ff1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-05-04 Werner LEMBERG <wl@gnu.org>
+
+ * NEWS, man/groff_diff.man, man/groff.man, doc/groff.texinfo:
+ Document `.U' register.
+
+ * src/roff/troff/env.cpp (environment::mark_last_line)
+ [WIDOW_CONTROL]: Fix scope of `p' for new C++ compilers.
+
+2004-05-04 Larry Kollar <kollar@alltel.net>
+
+ New read-only register `.U'; it returns 1 in safer mode and 0
+ otherwise.
+
+ * src/roff/troff/input.cpp (init_input_requests): Implement `.U'
+ register.
+
2004-05-03 Werner LEMBERG <wl@gnu.org>
* install-sh, mkinstalldirs: New versions; taken from texinfo CVS.
diff --git a/NEWS b/NEWS
index 3a033c082..ffc8d98fa 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ Troff
o Two new read-only, string-valued registers `.m' and `.M' return the
name of the current drawing and background color, respectively.
+o New read-only register `.U' which is set to 1 if in safer mode and set
+ to 0 if in unsafe mode.
+
o An input encoding file for latin-5 (a.k.a. ISO 8859-9) has been added.
Example use:
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index bad38eea9..a115d4c8a 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -5909,6 +5909,15 @@ This string-valued register returns the current input file name.
@vindex .H
Horizontal resolution in basic units.
+@item \n[.U]
+@cindex safer mode
+@cindex mode, safer
+@cindex unsafe mode
+@cindex mode, unsafe
+If @code{gtroff} is called with the @option{-U} command line option, the
+number register @code{.U} is set to@tie{}1, and zero otherwise.
+@xref{Groff Options}.
+
@item \n[.V]
@cindex vertical resolution register (@code{.V})
@cindex resolution, vertical, register (@code{.V})
diff --git a/man/groff.man b/man/groff.man
index 57adb3d6b..74f262295 100644
--- a/man/groff.man
+++ b/man/groff.man
@@ -2,7 +2,7 @@
.ig
groff.man
-Last update: 07 Jan 2004
+Last update: 04 May 2004
This file is part of groff, the GNU roff type-setting system.
@@ -3262,7 +3262,10 @@ The value of the parameters set by the second argument of the
request.
.
.REG .u
-Equal to 1 bin fill mode and 0 in nofill mode.
+Equal to 1 in fill mode and 0 in nofill mode.
+.
+.REG .U
+Equal to 1 in safer mode and 0 in unsafe mode.
.
.REG .v
Current vertical line spacing.
diff --git a/man/groff_diff.man b/man/groff_diff.man
index a9a176a21..9254df1a3 100644
--- a/man/groff_diff.man
+++ b/man/groff_diff.man
@@ -3,7 +3,7 @@
.ig
groff_diff.man
-Last update : 07 Jan 2004
+Last update : 04 May 2004
This file is part of groff, the GNU roff type-setting system.
It is the source of the man-page groff_diff(7).
@@ -2795,6 +2795,12 @@ Useful in conjunction with the
register.
.
.TP
+.B \[rs]n[.U]
+Set to 1 if in safer mode and to 0 if in unsafe mode (as given with the
+.B \-U
+command line option).
+.
+.TP
.B \[rs]n[.vpt]
1\~if vertical position traps are enabled, 0\~otherwise.
.
@@ -2932,7 +2938,7 @@ is the current year minus 1900.
predefines a single (read/write) string-based register,
.BR \[rs]*(.T ,
which contains the argument given to the
-.B -T
+.B \-T
command line option, namely the current output device (for example,
.I latin1
or
@@ -2942,7 +2948,7 @@ Note that this is not the same as the (read-only) number register
which is defined to be\~1 if
.B troff
is called with the
-.B -T
+.B \-T
command line option, and zero otherwise.
.
This behaviour is different to UNIX troff.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6ed139705..b02340657 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -173,7 +173,8 @@ void environment::mark_last_line()
{
if (!widow_control || !pending_lines)
return;
- for (pending_output_line *p = pending_lines; p->next; p = p->next)
+ pending_output_line *p;
+ for (p = pending_lines; p->next; p = p->next)
;
if (!p->no_fill)
p->last_line = 1;
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 10037a031..6dbaad203 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7336,6 +7336,7 @@ void init_input_requests()
number_reg_dictionary.define(".g", new constant_reg("1"));
number_reg_dictionary.define(".H", new constant_int_reg(&hresolution));
number_reg_dictionary.define(".R", new constant_reg("10000"));
+ number_reg_dictionary.define(".U", new constant_int_reg(&safer_flag));
number_reg_dictionary.define(".V", new constant_int_reg(&vresolution));
number_reg_dictionary.define(".warn", new constant_int_reg(&warning_mask));
extern const char *major_version;