diff options
author | wlemb <wlemb> | 2000-09-11 20:01:03 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2000-09-11 20:01:03 +0000 |
commit | 2c6f3075dcc8ab71b0c781d27b0ba8de5cd68d79 (patch) | |
tree | 2c3b62264b7e1825a30b5fb1ff37c103b0cc268d | |
parent | e9c74c714d59d9e05ef479e4d36c2a4ff746542f (diff) | |
download | groff-2c6f3075dcc8ab71b0c781d27b0ba8de5cd68d79.tar.gz |
Implementing two new requests .tm1 and .tmc: The former is similar
to .tm but can output leading spaces; its syntax is similar to
defining a string, i.e., a `"' can be used to mark the beginning of
the string to be written to stderr: `.tm1 " test'. The latter is
similar to .tm1 but doesn't write out a final newline character.
* src/roff/troff/input.cc (terminal1, terminal_continue,
do_terminal): New functions.
(init_input_requests): Use them.
* src/roff/troff/troff.man, NEWS, man/groff.man: Updated.
* tmac/groff_mdoc.samples.man: Small fixes.
* tmac/groff_mdoc.man: Fixing typo.
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | doc/groff.texinfo | 4 | ||||
-rw-r--r-- | man/groff.man | 23 | ||||
-rw-r--r-- | src/roff/troff/input.cc | 35 | ||||
-rw-r--r-- | src/roff/troff/troff.man | 15 | ||||
-rw-r--r-- | tmac/groff_mdoc.man | 2 | ||||
-rwxr-xr-x | tmac/groff_mdoc.samples.man | 10 |
8 files changed, 102 insertions, 14 deletions
@@ -1,3 +1,24 @@ +2000-09-11 Werner LEMBERG <wl@gnu.org> + + Implementing two new requests .tm1 and .tmc: The former is similar + to .tm but can output leading spaces; its syntax is similar to + defining a string, i.e., a `"' can be used to mark the beginning of + the string to be written to stderr: `.tm1 " test'. The latter is + similar to .tm1 but doesn't write out a final newline character. + + * src/roff/troff/input.cc (terminal1, terminal_continue, + do_terminal): New functions. + (init_input_requests): Use them. + * src/roff/troff/troff.man, NEWS, man/groff.man: Updated. + +2000-09-09 Werner LEMBERG <wl@gnu.org> + + * tmac/groff_mdoc.samples.man: Small fixes. + +2000-09-08 Werner LEMBERG <wl@gnu.org> + + * tmac/groff_mdoc.man: Fixing typo. + 2000-09-02 Werner LEMBERG <wl@gnu.org> Implementing a .nop request which does nothing. @@ -12,7 +12,7 @@ Troff ----- A new request `nop' (no operation) has been added which is similar to -`if 1'. Now, +`if 1'. For example, .if t \{ Hallo! @@ -24,6 +24,10 @@ can now be written as . nop Hallo! .\} +Two new requests `tm1' and `tmc' have been added to improve writing messages +to the terminal. `tm1' is similar to `tm' but allows leading whitespace. +`tmc' is similar to `tm1' but doesn't emit a final newline. + VERSION 1.16.1 ============== diff --git a/doc/groff.texinfo b/doc/groff.texinfo index 9a2333d8..3056cd1e 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -6318,7 +6318,7 @@ name. This would be called as @example -.vl $Id: groff.texinfo,v 1.43 2000/09/02 12:33:19 wlemb Exp $ +.vl $Id: groff.texinfo,v 1.44 2000/09/11 20:01:03 wlemb Exp $ @end example @xref{Request Arguments}. @@ -7426,6 +7426,8 @@ To activate these statements say groff -rDB=1 file @end example +@c XXX .tm1, .tmc requests + @item @findex ab @cindex aborting diff --git a/man/groff.man b/man/groff.man index 337d66bb..c13f1f7d 100644 --- a/man/groff.man +++ b/man/groff.man @@ -542,7 +542,14 @@ Groff provides a printable representation with the escape sequence. .TP .character \(dq -The double quote is used to enclose arguments in requests and macros. +The double quote is used to enclose arguments in requests and macros. In +the +.request .ds +and +.request .as +requests, a leading double quote in the argument will be stripped off, +making everything else afterwards the string to be defined (enabling leading +whitespace). The escaped double quote .esc \(dq introduces a comment. @@ -1608,6 +1615,20 @@ Print .argument anything on terminal (UNIX standard message output). . +.REQ .tm1 anything +Print +.argument anything +on terminal (UNIX standard message output), allowing leading whitespace if +.argument anything +starts with +.character \(dq +(which will be stripped off). +. +.REQ .tmc anything +Similar to +.request .tm1 +without emitting a final newline. +. .REQ .tr abcd.... Translate .argument a diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc index 1b063119..ab5bf06e 100644 --- a/src/roff/troff/input.cc +++ b/src/roff/troff/input.cc @@ -4760,22 +4760,45 @@ const char *input_char_description(int c) return buf; } -// .tm +// .tm, .tm1, and .tmc -void terminal() +void do_terminal(int newline, int string_like) { if (!tok.newline() && !tok.eof()) { int c; - while ((c = get_copy(NULL)) == ' ' || c == '\t') - ; + for (;;) { + c = get_copy(NULL); + if (string_like && c == '"') { + c = get_copy(NULL); + break; + } + if (c != ' ' && c != '\t') + break; + } for (; c != '\n' && c != EOF; c = get_copy(NULL)) fputs(asciify(c), stderr); } - fputc('\n', stderr); + if (newline) + fputc('\n', stderr); fflush(stderr); tok.next(); } +void terminal() +{ + do_terminal(1, 0); +} + +void terminal1() +{ + do_terminal(1, 1); +} + +void terminal_continue() +{ + do_terminal(0, 1); +} + dictionary stream_dictionary(20); void do_open(int append) @@ -5991,6 +6014,8 @@ void init_input_requests() init_request("ec", set_escape_char); init_request("pc", set_page_character); init_request("tm", terminal); + init_request("tm1", terminal1); + init_request("tmc", terminal_continue); init_request("ex", exit_request); init_request("em", end_macro); init_request("blm", blank_line_macro); diff --git a/src/roff/troff/troff.man b/src/roff/troff/troff.man index 725577b4..15b3e6b3 100644 --- a/src/roff/troff/troff.man +++ b/src/roff/troff/troff.man @@ -1314,6 +1314,21 @@ and less than or equal to .I s2 the increase in width is a linear function of the point size. .TP +.BI .tm1\ string +Similar to the +.B tm +request, +.I string +is read in copy mode and written on the standard error, but an initial +double quote in +.I string +is stripped off to allow initial blanks. +.TP +.BI .tmc\ string +Similar to +.BR tm1 +but without writing a final newline. +.TP .BI .trf\ filename Transparently output the contents of file .IR filename . diff --git a/tmac/groff_mdoc.man b/tmac/groff_mdoc.man index 2112eba4..e89dc018 100644 --- a/tmac/groff_mdoc.man +++ b/tmac/groff_mdoc.man @@ -62,7 +62,7 @@ The macros are described in two groups, the first includes the structural and physical page layout macros. The second contains the manual and general text domain macros which differentiate the -.Nm -\mdoc +.Nm \-mdoc package from other .Xr troff formatting packages. diff --git a/tmac/groff_mdoc.samples.man b/tmac/groff_mdoc.samples.man index cdbbc21c..e35fbaba 100755 --- a/tmac/groff_mdoc.samples.man +++ b/tmac/groff_mdoc.samples.man @@ -528,11 +528,11 @@ A volume title may be arbitrary or one of the following: .\" PS1 UNIX Programmer's Supplementary Documents .Pp .Bl -column SMM -offset indent -compact -.It Li AMD NetBSD Ancestral Manual Documents -.It Li SMM NetBSD System Manager's Manual -.It Li URM NetBSD Reference Manual -.It Li PRM NetBSD Programmer's Manual -.It Li KM NetBSD Kernel Manual +.It Li AMD Ta NetBSD Ancestral Manual Documents +.It Li SMM Ta NetBSD System Manager's Manual +.It Li URM Ta NetBSD Reference Manual +.It Li PRM Ta NetBSD Programmer's Manual +.It Li KM Ta NetBSD Kernel Manual .El .Pp The default volume labeling is |