diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | doc/groff.texinfo | 7 | ||||
-rw-r--r-- | man/groff_diff.man | 6 | ||||
-rw-r--r-- | src/roff/troff/input.cpp | 5 | ||||
-rw-r--r-- | src/roff/troff/troff.h | 5 | ||||
-rw-r--r-- | src/roff/troff/troff.man | 9 |
7 files changed, 47 insertions, 5 deletions
@@ -1,4 +1,18 @@ -2009-09-18 Werner LEMBERG <wl@gnu.org> +2009-02-21 Colin Watson <cjwatson@debian.org> + Werner Lemberg <wl@gnu.org> + + Add a new `file' warning category. + + * src/roff/troff/troff.h (warning_type): Add WARN_FILE. + * src/roff/troff/input.cpp (DEFAULT_WARNING_MASK): Include + WARN_FILE. + (warning_table): Add `file' category. + (macro_source): Convert error on missing macro file to a + warning. + * NEWS, doc/groff.texinfo (I/O, Warnings), man/groff_diff.man, + src/roff/troff/troff.man: Document new warning category. + +2009-02-18 Werner LEMBERG <wl@gnu.org> * doc/groff.texinfo: Improve documentation of `lsm' request. @@ -20,6 +20,10 @@ o The new `lsm' request specifies a macro to be invoked when leading spaces registers `lsn' and `lss' hold the number of removed leading spaces and the corresponding horizontal space, respectively. +o There is a new warning category `file', enabled by default. The `mso' + request emits warnings in this category when the requested macro file does + not exist. + VERSION 1.20.1 ============== diff --git a/doc/groff.texinfo b/doc/groff.texinfo index bc975184..380d76e6 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -13132,6 +13132,8 @@ for the specified @var{file} in the same directories as macro files for the the @option{-m} command line option. If the file name to be included has the form @file{@var{name}.tmac} and it isn't found, @code{mso} tries to include @file{tmac.@var{name}} and vice versa. +If the file does not exist, a warning of type @samp{file} is emitted. +@xref{Debugging}, for information about warnings. @endDefreq @DefreqList {trf, file} @@ -14182,6 +14184,11 @@ conditions that are errors when they do not occur in ignored text. @itemx 524288 Color related warnings. +@item file +@itemx 1048576 +Missing files. The @code{mso} request gives this warning when the +requested macro file does not exist. This is enabled by default. + @item all All warnings except @samp{di}, @samp{mac} and @samp{reg}. It is intended that this covers all warnings that are useful with traditional diff --git a/man/groff_diff.man b/man/groff_diff.man index dcd70a0d..45c76a0d 100644 --- a/man/groff_diff.man +++ b/man/groff_diff.man @@ -1797,6 +1797,12 @@ tries to include .BI tmac. name instead and vice versa. . +A warning of type +.B file +is generated if +.I file +can't be loaded, and the request is ignored. +. .TP .BI .nop \ anything Execute diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index b3243f5a..98b6e58f 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -59,7 +59,7 @@ extern "C" { #ifndef DEFAULT_WARNING_MASK // warnings that are enabled by default #define DEFAULT_WARNING_MASK \ - (WARN_CHAR|WARN_NUMBER|WARN_BREAK|WARN_SPACE|WARN_FONT) + (WARN_CHAR|WARN_NUMBER|WARN_BREAK|WARN_SPACE|WARN_FONT|WARN_FILE) #endif // initial size of buffer for reading names; expanded as necessary @@ -7367,7 +7367,7 @@ void macro_source() a_delete path; } else - error("can't find macro file `%1'", nm.contents()); + warning(WARN_FILE, "can't find macro file `%1'", nm.contents()); tok.next(); } } @@ -8153,6 +8153,7 @@ static struct { { "reg", WARN_REG }, { "ig", WARN_IG }, { "color", WARN_COLOR }, + { "file", WARN_FILE }, { "all", WARN_TOTAL & ~(WARN_DI | WARN_MAC | WARN_REG) }, { "w", WARN_TOTAL }, { "default", DEFAULT_WARNING_MASK }, diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h index ab5db406..79f40891 100644 --- a/src/roff/troff/troff.h +++ b/src/roff/troff/troff.h @@ -75,11 +75,12 @@ enum warning_type { WARN_SPACE = 0200000, WARN_FONT = 0400000, WARN_IG = 01000000, - WARN_COLOR = 02000000 + WARN_COLOR = 02000000, + WARN_FILE = 04000000 // change WARN_TOTAL if you add more warning types }; -const int WARN_TOTAL = 03777777; +const int WARN_TOTAL = 07777777; int warning(warning_type, const char *, const errarg & = empty_errarg, diff --git a/src/roff/troff/troff.man b/src/roff/troff/troff.man index 6c53f4d5..f59b73b4 100644 --- a/src/roff/troff/troff.man +++ b/src/roff/troff/troff.man @@ -334,6 +334,7 @@ _ 7@128@syntax@17@131072@font 8@256@di@18@262144@ig 9@512@mac@19@524288@color +@@@20@1048576@file .TE . .P @@ -385,6 +386,14 @@ When an unrecognized escape sequence is encountered, the escape character is ignored. . .TP +.BR file "\t1048576" +Indicates a missing file for the +.B mso +request. +. +Enabled by default. +. +.TP .BR font "\t131072" Non-existent fonts. . |