source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: style message about duplicate RCS ids; inspired by mdoclint
@ 2017-06-17 23:07 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-17 23:07 UTC (permalink / raw)
  To: source

Log Message:
-----------
style message about duplicate RCS ids; inspired by mdoclint

Modified Files:
--------------
    mdocml:
        mandoc.1
        mandoc.h
        read.c
        roff.c

Revision Data
-------------
Index: mandoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v
retrieving revision 1.231
retrieving revision 1.232
diff -Lmandoc.h -Lmandoc.h -u -p -r1.231 -r1.232
--- mandoc.h
+++ mandoc.h
@@ -50,6 +50,7 @@ enum	mandocerr {
 	MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */
 	MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */
 	MANDOCERR_RCS_MISSING, /* RCS id missing */
+	MANDOCERR_RCS_REP, /* duplicate RCS id: ... */
 	MANDOCERR_MACRO_USELESS, /* useless macro: macro */
 	MANDOCERR_BX, /* consider using OS macro: macro */
 	MANDOCERR_ER_ORDER, /* errnos out of order: Er ... */
Index: mandoc.1
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v
retrieving revision 1.200
retrieving revision 1.201
diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.200 -r1.201
--- mandoc.1
+++ mandoc.1
@@ -799,6 +799,11 @@ generated by CVS
 or
 .Ic NetBSD
 keyword substitution as conventionally used in these operating systems.
+.It Sy "duplicate RCS id"
+A single manual page contains two copies of the RCS identifier for
+the same operating system.
+Consider deleting the later instance and moving the first one up
+to the top of the page.
 .It Sy "useless macro"
 .Pq mdoc
 A
Index: read.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/read.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -Lread.c -Lread.c -u -p -r1.177 -r1.178
--- read.c
+++ read.c
@@ -92,6 +92,7 @@ static	const char * const	mandocerrs[MAN
 	"Mdocdate missing",
 	"legacy man(7) date format",
 	"RCS id missing",
+	"duplicate RCS id",
 	"useless macro",
 	"consider using OS macro",
 	"errnos out of order",
Index: roff.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/roff.c,v
retrieving revision 1.313
retrieving revision 1.314
diff -Lroff.c -Lroff.c -u -p -r1.313 -r1.314
--- roff.c
+++ roff.c
@@ -1196,8 +1196,12 @@ roff_res(struct roff *r, struct buf *buf
 		}
 		if (cp != NULL &&
 		    isalnum((unsigned char)*cp) == 0 &&
-		    strchr(cp, '$') != NULL)
+		    strchr(cp, '$') != NULL) {
+			if (r->man->meta.rcsids & (1 << os_e))
+				mandoc_msg(MANDOCERR_RCS_REP, r->parse,
+				    ln, stesc + 1 - buf->buf, stesc + 1);
 			r->man->meta.rcsids |= 1 << os_e;
+		}
 
 		/* Handle trailing whitespace. */
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-17 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-17 23:07 mdocml: style message about duplicate RCS ids; inspired by mdoclint schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).