source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: do not break the line between Bsx/Bx/Fx/Nx/Ox/Dx and its
Date: Fri, 9 Jun 2017 20:29:04 -0500 (EST)	[thread overview]
Message-ID: <645158064119189776.enqueue@fantadrom.bsd.lv> (raw)

Log Message:
-----------
do not break the line between Bsx/Bx/Fx/Nx/Ox/Dx and its arguments

Modified Files:
--------------
    mdocml:
        mdoc_man.c

Revision Data
-------------
Index: mdoc_man.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_man.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.119 -r1.120
--- mdoc_man.c
+++ mdoc_man.c
@@ -196,8 +196,8 @@ static	const struct manact __manacts[MDO
 	{ NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */
 	{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bo */
 	{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Bsx */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Bx */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bsx */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bx */
 	{ NULL, pre_skip, NULL, NULL, NULL }, /* Db */
 	{ NULL, NULL, NULL, NULL, NULL }, /* Dc */
 	{ cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */
@@ -206,12 +206,12 @@ static	const struct manact __manacts[MDO
 	{ NULL, NULL, NULL, NULL, NULL }, /* Ef */
 	{ NULL, pre_em, post_font, NULL, NULL }, /* Em */
 	{ cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Fx */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Fx */
 	{ NULL, pre_sy, post_font, NULL, NULL }, /* Ms */
 	{ NULL, pre_no, NULL, NULL, NULL }, /* No */
 	{ NULL, pre_ns, NULL, NULL, NULL }, /* Ns */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Nx */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Ox */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Nx */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Ox */
 	{ NULL, NULL, NULL, NULL, NULL }, /* Pc */
 	{ NULL, NULL, post_pf, NULL, NULL }, /* Pf */
 	{ cond_body, pre_enc, post_enc, "(", ")" }, /* Po */
@@ -252,7 +252,7 @@ static	const struct manact __manacts[MDO
 	{ NULL, NULL, post_percent, NULL, NULL }, /* %C */
 	{ NULL, pre_skip, NULL, NULL, NULL }, /* Es */
 	{ cond_body, pre_en, post_en, NULL, NULL }, /* En */
-	{ NULL, NULL, NULL, NULL, NULL }, /* Dx */
+	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Dx */
 	{ NULL, NULL, post_percent, NULL, NULL }, /* %Q */
 	{ NULL, NULL, post_percent, NULL, NULL }, /* %U */
 	{ NULL, NULL, NULL, NULL, NULL }, /* Ta */
@@ -990,11 +990,11 @@ post_bf(DECL_ARGS)
 static int
 pre_bk(DECL_ARGS)
 {
-
 	switch (n->type) {
 	case ROFFT_BLOCK:
 		return 1;
 	case ROFFT_BODY:
+	case ROFFT_ELEM:
 		outflags |= MMAN_Bk;
 		return 1;
 	default:
@@ -1005,9 +1005,18 @@ pre_bk(DECL_ARGS)
 static void
 post_bk(DECL_ARGS)
 {
-
-	if (n->type == ROFFT_BODY)
+	switch (n->type) {
+	case ROFFT_ELEM:
+		while ((n = n->parent) != NULL)
+			 if (n->tok == MDOC_Bk)
+				return;
+		/* FALLTHROUGH */
+	case ROFFT_BODY:
 		outflags &= ~MMAN_Bk;
+		break;
+	default:
+		break;
+	}
 }
 
 static int
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2017-06-10  1:29 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=645158064119189776.enqueue@fantadrom.bsd.lv \
    --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).