aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--TODO16
-rw-r--r--main.c25
-rw-r--r--mandoc.145
-rw-r--r--mandoc.h6
-rw-r--r--read.c7
5 files changed, 55 insertions, 44 deletions
diff --git a/TODO b/TODO
index ac587990..c192cdcf 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.236 2017/04/27 17:08:04 schwarze Exp $
+* $Id: TODO,v 1.237 2017/05/16 19:06:30 schwarze Exp $
************************************************************************
Many issues are annotated for difficulty as follows:
@@ -61,18 +61,6 @@ are mere guesses, and some may be wrong.
reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
loc *** exist *** algo *** size ** imp *
-- .ta (tab settings)
- #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100
- ircbug(1) gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500
- also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100
- also posix2time(3) Carsten Kunze Mon, 1 Dec 2014 13:03:10 +0100
- loc ** exist *** algo ** size ** imp ***
-
-- .ti (temporary indent)
- found by naddy@ in xloadimage(1) [devel/libvstr] vstr(3)
- found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600
- loc ** exist ** algo ** size * imp ** (parser reorg helps a lot)
-
- .while and .shift
found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200
loc * exist ** algo ** size ** imp **
@@ -560,8 +548,6 @@ are mere guesses, and some may be wrong.
Several areas can be cleaned up to make mandoc even faster. These are
-- improve hashing mechanism for macros (quite important: performance)
-
- the PDF file is HUGE: this can be reduced by using relative offsets
************************************************************************
diff --git a/main.c b/main.c
index 99daeeca..a58b4ccd 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.289 2017/04/18 16:01:20 schwarze Exp $ */
+/* $Id: main.c,v 1.290 2017/05/16 19:06:30 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -968,15 +968,16 @@ static int
woptions(struct curparse *curp, char *arg)
{
char *v, *o;
- const char *toks[7];
+ const char *toks[8];
toks[0] = "stop";
toks[1] = "all";
- toks[2] = "warning";
- toks[3] = "error";
- toks[4] = "unsupp";
- toks[5] = "fatal";
- toks[6] = NULL;
+ toks[2] = "style";
+ toks[3] = "warning";
+ toks[4] = "error";
+ toks[5] = "unsupp";
+ toks[6] = "fatal";
+ toks[7] = NULL;
while (*arg) {
o = arg;
@@ -986,15 +987,18 @@ woptions(struct curparse *curp, char *arg)
break;
case 1:
case 2:
- curp->wlevel = MANDOCLEVEL_WARNING;
+ curp->wlevel = MANDOCLEVEL_STYLE;
break;
case 3:
- curp->wlevel = MANDOCLEVEL_ERROR;
+ curp->wlevel = MANDOCLEVEL_WARNING;
break;
case 4:
- curp->wlevel = MANDOCLEVEL_UNSUPP;
+ curp->wlevel = MANDOCLEVEL_ERROR;
break;
case 5:
+ curp->wlevel = MANDOCLEVEL_UNSUPP;
+ break;
+ case 6:
curp->wlevel = MANDOCLEVEL_BADARG;
break;
default:
@@ -1002,7 +1006,6 @@ woptions(struct curparse *curp, char *arg)
return 0;
}
}
-
return 1;
}
diff --git a/mandoc.1 b/mandoc.1
index 4168c69a..036421d0 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.184 2017/03/27 18:51:36 schwarze Exp $
+.\" $Id: mandoc.1,v 1.185 2017/05/16 19:06:30 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 27 2017 $
+.Dd $Mdocdate: May 16 2017 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -146,13 +146,14 @@ to be reported on the standard error output and to affect the exit status.
The
.Ar level
can be
+.Cm style ,
.Cm warning ,
.Cm error ,
or
.Cm unsupp ;
.Cm all
is an alias for
-.Cm warning .
+.Cm style .
By default,
.Nm
is silent.
@@ -594,27 +595,32 @@ option:
.Pp
.Bl -tag -width Ds -compact
.It 0
-No warnings or errors occurred, or those that did were ignored because
-they were lower than the requested
+No style suggestions, warnings or errors occurred, or those that
+did were ignored because they were lower than the requested
.Ar level .
+.It 1
+At least one style suggestion occurred, but no warning or error, and
+.Fl W Cm style
+was specified.
.It 2
At least one warning occurred, but no error, and
.Fl W Cm warning
+or
+.Fl W Cm style
was specified.
.It 3
At least one parsing error occurred,
but no unsupported feature was encountered, and
.Fl W Cm error
-or
-.Fl W Cm warning
-was specified.
+or a lower
+.Ar level
+was requested.
.It 4
At least one unsupported feature was encountered, and
-.Fl W Cm unsupp ,
-.Fl W Cm error
-or
-.Fl W Cm warning
-was specified.
+.Fl W Cm unsupp
+or a lower
+.Ar level
+was requested.
.It 5
Invalid command line arguments were specified.
No input files have been read.
@@ -714,9 +720,22 @@ rendering can be produced.
Documents causing warnings may render poorly when using other
formatting tools instead of
.Nm .
+.It Cm style
+An input file uses dubious or discouraged style.
+This is not a complaint about the syntax, and probably neither
+formatting nor portability are in danger.
+While great care is taken to avoid false positives on the higher
+message levels, the
+.Cm style
+level tries to reduce the probability that issues go unnoticed,
+so it may occasionally issue bogus suggestions.
+Please use your good judgement to decide whether any particular
+.Cm style
+suggestion really justifies a change to the input file.
.El
.Pp
Messages of the
+.Cm style ,
.Cm warning ,
.Cm error ,
and
diff --git a/mandoc.h b/mandoc.h
index 12c26a18..26ad4f66 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.215 2017/03/06 17:26:04 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.216 2017/05/16 19:06:30 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -28,7 +28,7 @@
*/
enum mandoclevel {
MANDOCLEVEL_OK = 0,
- MANDOCLEVEL_RESERVED,
+ MANDOCLEVEL_STYLE, /* style suggestions */
MANDOCLEVEL_WARNING, /* warnings: syntax, whitespace, etc. */
MANDOCLEVEL_ERROR, /* input has been thrown away */
MANDOCLEVEL_UNSUPP, /* input needs unimplemented features */
@@ -44,6 +44,8 @@ enum mandoclevel {
enum mandocerr {
MANDOCERR_OK,
+ MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
+
MANDOCERR_WARNING, /* ===== start of warnings ===== */
/* related to the prologue */
diff --git a/read.c b/read.c
index af9cf1f4..f9ca9de0 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.164 2017/04/29 12:45:42 schwarze Exp $ */
+/* $Id: read.c,v 1.165 2017/05/16 19:06:30 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -75,7 +75,7 @@ static void mparse_parse_buffer(struct mparse *, struct buf,
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = {
MANDOCERR_OK,
- MANDOCERR_WARNING,
+ MANDOCERR_STYLE,
MANDOCERR_WARNING,
MANDOCERR_ERROR,
MANDOCERR_UNSUPP,
@@ -86,6 +86,7 @@ static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = {
static const char * const mandocerrs[MANDOCERR_MAX] = {
"ok",
+ "generic style suggestion",
"generic warning",
/* related to the prologue */
@@ -241,7 +242,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
static const char * const mandoclevels[MANDOCLEVEL_MAX] = {
"SUCCESS",
- "RESERVED",
+ "STYLE",
"WARNING",
"ERROR",
"UNSUPP",