summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--doc/groff.texinfo14
-rw-r--r--man/groff_tmac.man17
-rw-r--r--src/roff/troff/node.cc35
4 files changed, 65 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 63a69f92..d4cf7218 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2002-10-23 Werner LEMBERG <wl@gnu.org>
+
+ * src/roff/troff/node.cc (troff_output_file::fill_color,
+ troff_output_file::glyph_color): Set current color before testing
+ color_flag.
+ (troff_output_file::put_char_width, troff_output_file::put_char,
+ troff_output_file::draw): Don't call flush_tbuf and/or do_motion
+ before glyph_color.
+ (troff_output_file::file_color, troff_output_file::glyph_color):
+ Call do_motion.
+ (word_space_node::tprint, space_node::tprint, hmotion_node::tprint,
+ vmotion_node::tprint): Move first, then call fill_color.
+
+2002-10-20 Werner LEMBERG <wl@gnu.org>
+
+ * doc/groff.texinfo, man/groff_tmac.man: Document that it is not
+ possible to use multiple main macro packages.
+
2002-10-19 Werner LEMBERG <wl@gnu.org>
* src/devices/grops/ps.cc (cmyk_flag): New global variable.
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 9e5f20b3..724d1712 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -1909,6 +1909,20 @@ to changing the appearance of section headers.
This chapter documents the main macro packages that come with
@code{groff}.
+Different main macro packages can't be used at the same time; for example
+
+@Example
+groff -m man foo.man -m ms bar.doc
+@endExample
+
+@noindent
+doesn't work. Note that option arguments are processed before non-option
+arguments; the above (failing) sample is thus reordered to
+
+@Example
+groff -m man -m ms foo.man bar.doc
+@endExample
+
@menu
* man::
* mdoc::
diff --git a/man/groff_tmac.man b/man/groff_tmac.man
index c0d34212..f8b34523 100644
--- a/man/groff_tmac.man
+++ b/man/groff_tmac.man
@@ -15,7 +15,7 @@ groff_tmac.5
File position: <groff-source>/man/groff_tmac.man
-Last update: 21 Aug 2002
+Last update: 20 Oct 2002
This file is part of groff, the GNU roff type-setting system.
@@ -314,6 +314,21 @@ directories.
provides all classical macro packages, some more full packages, and
some secondary packages for special purposes.
.
+Note that it is not possible to use multiple primary macro packages at the
+same time; saying e.g.\&
+.
+.IP
+.Shell_cmd "groff \-m man \-m ms foo"
+.
+.P
+or
+.
+.IP
+.Shell_cmd "groff \-m man foo \-m ms bar"
+.
+.P
+will fail.
+.
.
.\" --------------------------------------------------------------------
.SS "Man\~Pages"
diff --git a/src/roff/troff/node.cc b/src/roff/troff/node.cc
index 58a3cd8e..25519777 100644
--- a/src/roff/troff/node.cc
+++ b/src/roff/troff/node.cc
@@ -990,8 +990,6 @@ void troff_output_file::put_char_width(charinfo *ci, tfont *tf,
}
char c = ci->get_ascii_code();
if (c == '\0') {
- flush_tbuf();
- do_motion();
glyph_color(gcol);
fill_color(fcol);
check_charinfo(tf, ci);
@@ -1024,8 +1022,6 @@ void troff_output_file::put_char_width(charinfo *ci, tfont *tf,
hpos = output_hpos;
return;
}
- flush_tbuf();
- do_motion();
glyph_color(gcol);
fill_color(fcol);
check_charinfo(tf, ci);
@@ -1067,7 +1063,6 @@ void troff_output_file::put_char(charinfo *ci, tfont *tf,
set_font(tf);
char c = ci->get_ascii_code();
if (c == '\0') {
- do_motion();
glyph_color(gcol);
fill_color(fcol);
if (ci->numbered()) {
@@ -1098,7 +1093,6 @@ void troff_output_file::put_char(charinfo *ci, tfont *tf,
output_hpos = hpos;
}
else {
- do_motion();
glyph_color(gcol);
fill_color(fcol);
put('c');
@@ -1165,9 +1159,13 @@ void troff_output_file::set_font(tfont *tf)
void troff_output_file::fill_color(color *col)
{
- if (!col || current_fill_color == col || !color_flag)
- return;
flush_tbuf();
+ do_motion();
+ if (!col || current_fill_color == col)
+ return;
+ current_fill_color = col;
+ if (!color_flag)
+ return;
put("DF");
unsigned int components[4];
color_scheme cs;
@@ -1208,14 +1206,18 @@ void troff_output_file::fill_color(color *col)
break;
}
put('\n');
- current_fill_color = col;
}
void troff_output_file::glyph_color(color *col)
{
- if (!col || current_glyph_color == col || !color_flag)
- return;
flush_tbuf();
+ // grotty doesn't like a color command if the vertical position is zero.
+ do_motion();
+ if (!col || current_glyph_color == col)
+ return;
+ current_glyph_color = col;
+ if (!color_flag)
+ return;
put("m");
unsigned int components[4];
color_scheme cs;
@@ -1256,7 +1258,6 @@ void troff_output_file::glyph_color(color *col)
break;
}
put('\n');
- current_glyph_color = col;
}
// determine_line_limits - works out the smallest box which will contain
@@ -1350,8 +1351,6 @@ void troff_output_file::draw(char code, hvpair *point, int npoints,
font_size fsize, color *gcol, color *fcol)
{
int i;
- flush_tbuf();
- do_motion();
glyph_color(gcol);
fill_color(fcol);
if (is_on()) {
@@ -4019,9 +4018,9 @@ int word_space_node::set_unformat_flag()
void word_space_node::tprint(troff_output_file *out)
{
- out->fill_color(col);
out->word_marker();
out->right(n);
+ out->fill_color(col);
}
int word_space_node::merge_space(hunits h, hunits sw, hunits ssw)
@@ -4375,20 +4374,20 @@ void node::zero_width_tprint(troff_output_file *out)
void space_node::tprint(troff_output_file *out)
{
- out->fill_color(col);
out->right(n);
+ out->fill_color(col);
}
void hmotion_node::tprint(troff_output_file *out)
{
- out->fill_color(col);
out->right(n);
+ out->fill_color(col);
}
void vmotion_node::tprint(troff_output_file *out)
{
- out->fill_color(col);
out->down(n);
+ out->fill_color(col);
}
void kern_pair_node::tprint(troff_output_file *out)