source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: minor .Bk fixes: * do not print invalid arguments verbatim (no
Date: Sun, 27 Jun 2010 13:53:27 -0400 (EDT)	[thread overview]
Message-ID: <201006271753.o5RHrRs2007490@krisdoz.my.domain> (raw)

Log Message:
-----------
minor .Bk fixes:
* do not print invalid arguments verbatim (no groffs prints them, either)
* do not trigger TERMP_PREKEEP twice
* do not die from invlid arguments (groff won't die, either)
* continue to ignore even valid arguments (just like groff)
ok kristaps@ on the previous version, before removing my last bug ;)

Modified Files:
--------------
    mdocml:
        mdoc_term.c
        mdoc_validate.c

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.100 -r1.101
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -107,7 +107,7 @@ static	int	 pre_ss(PRE_ARGS);
 
 static	v_post	 posts_an[] = { post_an, NULL };
 static	v_post	 posts_at[] = { post_at, NULL };
-static	v_post	 posts_bd[] = { hwarn_eq0, bwarn_ge1, NULL };
+static	v_post	 posts_bd_bk[] = { hwarn_eq0, bwarn_ge1, NULL };
 static	v_post	 posts_bf[] = { hwarn_le1, post_bf, NULL };
 static	v_post	 posts_bl[] = { bwarn_ge1, post_bl, NULL };
 static	v_post	 posts_bool[] = { eerr_eq1, ebool, NULL };
@@ -154,7 +154,7 @@ const	struct valids mdoc_valids[MDOC_MAX
 	{ NULL, posts_notext },			/* Pp */ 
 	{ pres_d1, posts_wline },		/* D1 */
 	{ pres_d1, posts_wline },		/* Dl */
-	{ pres_bd, posts_bd },			/* Bd */
+	{ pres_bd, posts_bd_bk },			/* Bd */
 	{ NULL, NULL },				/* Ed */
 	{ pres_bl, posts_bl },			/* Bl */ 
 	{ NULL, NULL },				/* El */
@@ -245,7 +245,7 @@ const	struct valids mdoc_valids[MDOC_MAX
 	{ NULL, NULL },				/* Fc */ 
 	{ NULL, NULL },				/* Oo */
 	{ NULL, NULL },				/* Oc */
-	{ NULL, posts_wline },			/* Bk */
+	{ NULL, posts_bd_bk },			/* Bk */
 	{ NULL, NULL },				/* Ek */
 	{ NULL, posts_eoln },			/* Bt */
 	{ NULL, NULL },				/* Hf */
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.160 -r1.161
--- mdoc_term.c
+++ mdoc_term.c
@@ -2109,8 +2109,17 @@ static int
 termp_bk_pre(DECL_ARGS)
 {
 
-	p->flags |= TERMP_PREKEEP;
-	return(1);
+	switch (n->type) {
+	case (MDOC_BLOCK):
+		return(1);
+	case (MDOC_HEAD):
+		return(0);
+	case (MDOC_BODY):
+		p->flags |= TERMP_PREKEEP;
+		return(1);
+	default:
+		abort();
+	}
 }
 
 
@@ -2119,7 +2128,8 @@ static void
 termp_bk_post(DECL_ARGS)
 {
 
-	p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
+	if (MDOC_BODY == n->type)
+		p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
 }
 
 /* ARGSUSED */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2010-06-27 17:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006271753.o5RHrRs2007490@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).