source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Have `Bx' accept two arguments, not just one, and join these
Date: Tue, 25 Jan 2011 10:17:18 -0500 (EST)	[thread overview]
Message-ID: <201101251517.p0PFHIGj004363@krisdoz.my.domain> (raw)

Log Message:
-----------
Have `Bx' accept two arguments, not just one, and join these arguments
with "xxBSD-yy"

Modified Files:
--------------
    mdocml:
        TODO
        mdoc_html.c
        mdoc_macro.c
        mdoc_term.c

Revision Data
-------------
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.84
retrieving revision 1.85
diff -LTODO -LTODO -u -p -r1.84 -r1.85
--- TODO
+++ TODO
@@ -228,12 +228,6 @@
 - The space character joining .Dx .Fx .Nx .Ox (are these all?) to its
   argument is non-breaking.  See the cdio(1) HISTORY and many others.
 
-- .Bx uses a dash before its argument, not a space,
-  see for example the chpass(1) and column(1) HISTORY.
-  Besides, the second argument is capitalized, for example,
-    .Bx 4.3 tahoe .
-  produces 4.3BSD-Tahoe.
-
 - In .Bl -tag, if a tag exceeds the right margin and must be continued
   on the next line, it must be indented by -width, not width+1;
   see "rule block|pass" in OpenBSD ifconfig(8).
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.100 -r1.101
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -1461,6 +1461,8 @@ in_line_argn(MACRO_PROT_ARGS)
 	case (MDOC_Ux):
 		maxargs = 0;
 		break;
+	case (MDOC_Bx):
+		/* FALLTHROUGH */
 	case (MDOC_Xr):
 		maxargs = 2;
 		break;
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.144 -r1.145
--- mdoc_html.c
+++ mdoc_html.c
@@ -832,19 +832,27 @@ mdoc_xx_pre(MDOC_ARGS)
 static int
 mdoc_bx_pre(MDOC_ARGS)
 {
-	const struct mdoc_node	*nn;
-	struct htmlpair		 tag;
+	struct htmlpair		tag;
 
 	PAIR_CLASS_INIT(&tag, "unix");
 	print_otag(h, TAG_SPAN, 1, &tag);
 
-	for (nn = n->child; nn; nn = nn->next)
-		print_mdoc_node(m, nn, h);
+	if (NULL != (n = n->child)) {
+		print_text(h, n->string);
+		h->flags |= HTML_NOSPACE;
+		print_text(h, "BSD");
+	} else {
+		print_text(h, "BSD");
+		return(0);
+	}
 
-	if (n->child)
+	if (NULL != (n = n->next)) {
+		h->flags |= HTML_NOSPACE;
+		print_text(h, "-");
 		h->flags |= HTML_NOSPACE;
+		print_text(h, n->string);
+	}
 
-	print_text(h, "BSD");
 	return(0);
 }
 
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.210 -r1.211
--- mdoc_term.c
+++ mdoc_term.c
@@ -73,7 +73,6 @@ static	void	  termp_an_post(DECL_ARGS);
 static	void	  termp_bd_post(DECL_ARGS);
 static	void	  termp_bk_post(DECL_ARGS);
 static	void	  termp_bl_post(DECL_ARGS);
-static	void	  termp_bx_post(DECL_ARGS);
 static	void	  termp_d1_post(DECL_ARGS);
 static	void	  termp_fo_post(DECL_ARGS);
 static	void	  termp_in_post(DECL_ARGS);
@@ -95,6 +94,7 @@ static	int	  termp_bk_pre(DECL_ARGS);
 static	int	  termp_bl_pre(DECL_ARGS);
 static	int	  termp_bold_pre(DECL_ARGS);
 static	int	  termp_bt_pre(DECL_ARGS);
+static	int	  termp_bx_pre(DECL_ARGS);
 static	int	  termp_cd_pre(DECL_ARGS);
 static	int	  termp_d1_pre(DECL_ARGS);
 static	int	  termp_ex_pre(DECL_ARGS);
@@ -187,7 +187,7 @@ static	const struct termact termacts[MDO
 	{ termp_quote_pre, termp_quote_post }, /* Bo */
 	{ termp_quote_pre, termp_quote_post }, /* Bq */
 	{ termp_xx_pre, NULL }, /* Bsx */
-	{ NULL, termp_bx_post }, /* Bx */
+	{ termp_bx_pre, NULL }, /* Bx */
 	{ NULL, NULL }, /* Db */
 	{ NULL, NULL }, /* Dc */
 	{ termp_quote_pre, termp_quote_post }, /* Do */
@@ -1674,13 +1674,27 @@ termp_bd_post(DECL_ARGS)
 
 
 /* ARGSUSED */
-static void
-termp_bx_post(DECL_ARGS)
+static int
+termp_bx_pre(DECL_ARGS)
 {
 
-	if (n->child)
+	if (NULL != (n = n->child)) {
+		term_word(p, n->string);
 		p->flags |= TERMP_NOSPACE;
-	term_word(p, "BSD");
+		term_word(p, "BSD");
+	} else {
+		term_word(p, "BSD");
+		return(0);
+	}
+
+	if (NULL != (n = n->next)) {
+		p->flags |= TERMP_NOSPACE;
+		term_word(p, "-");
+		p->flags |= TERMP_NOSPACE;
+		term_word(p, n->string);
+	}
+
+	return(0);
 }
 
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2011-01-25 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 15:17 kristaps [this message]
2011-01-25 15:28 ` Kristaps Dzonsons

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=201101251517.p0PFHIGj004363@krisdoz.my.domain \
    --to=kristaps@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).