source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: fix .Lk for -Tascii and implement it for -Tman OpenBSD rev.
@ 2012-07-08 22:49 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2012-07-08 22:49 UTC (permalink / raw)
  To: source

Log Message:
-----------
fix .Lk for -Tascii and implement it for -Tman
OpenBSD rev. 1.22 and 1.142, respectively

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

Revision Data
-------------
Index: mdoc_man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_man.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.23 -r1.24
--- mdoc_man.c
+++ mdoc_man.c
@@ -70,6 +70,7 @@ static	int	  pre_fo(DECL_ARGS);
 static	int	  pre_ft(DECL_ARGS);
 static	int	  pre_in(DECL_ARGS);
 static	int	  pre_it(DECL_ARGS);
+static	int	  pre_lk(DECL_ARGS);
 static	int	  pre_nm(DECL_ARGS);
 static	int	  pre_ns(DECL_ARGS);
 static	int	  pre_pp(DECL_ARGS);
@@ -199,7 +200,7 @@ static	const struct manact manacts[MDOC_
 	{ NULL, pre_ux, NULL, "currently under development.", NULL }, /* Ud */
 	{ NULL, NULL, post_lb, NULL, NULL }, /* Lb */
 	{ NULL, pre_pp, NULL, NULL, NULL }, /* Lp */
-	{ NULL, NULL, NULL, NULL, NULL }, /* _Lk */
+	{ NULL, pre_lk, NULL, NULL, NULL }, /* Lk */
 	{ NULL, NULL, NULL, NULL, NULL }, /* _Mt */
 	{ cond_body, pre_enc, post_enc, "{", "}" }, /* Brq */
 	{ cond_body, pre_enc, post_enc, "{", "}" }, /* Bro */
@@ -828,6 +829,34 @@ post_lb(DECL_ARGS)
 
 	if (SEC_LIBRARY == n->sec)
 		outflags |= MMAN_br;
+}
+
+static int
+pre_lk(DECL_ARGS)
+{
+	const struct mdoc_node *link, *descr;
+
+	if (NULL == (link = n->child))
+		return(0);
+
+	if (NULL != (descr = link->next)) {
+		print_word("\\fI");
+		outflags &= ~MMAN_spc;
+		while (NULL != descr) {
+			print_word(descr->string);
+			descr = descr->next;
+		}
+		print_word(":");
+		outflags &= ~MMAN_spc;
+		print_word("\\fP");
+	}
+
+	print_word("\\fB");
+	outflags &= ~MMAN_spc;
+	print_word(link->string);
+	outflags &= ~MMAN_spc;
+	print_word("\\fP");
+	return(0);
 }
 
 static int
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.239
retrieving revision 1.240
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.239 -r1.240
--- mdoc_term.c
+++ mdoc_term.c
@@ -1,7 +1,7 @@
 /*	$Id$ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -2159,25 +2159,24 @@ termp_li_pre(DECL_ARGS)
 static int
 termp_lk_pre(DECL_ARGS)
 {
-	const struct mdoc_node *nn, *sv;
+	const struct mdoc_node *link, *descr;
 
-	term_fontpush(p, TERMFONT_UNDER);
-
-	nn = sv = n->child;
-
-	if (NULL == nn || NULL == nn->next)
-		return(1);
-
-	for (nn = nn->next; nn; nn = nn->next) 
-		term_word(p, nn->string);
-
-	term_fontpop(p);
+	if (NULL == (link = n->child))
+		return(0);
 
-	p->flags |= TERMP_NOSPACE;
-	term_word(p, ":");
+	if (NULL != (descr = link->next)) {
+		term_fontpush(p, TERMFONT_UNDER);
+		while (NULL != descr) {
+			term_word(p, descr->string);
+			descr = descr->next;
+		}
+		p->flags |= TERMP_NOSPACE;
+		term_word(p, ":");
+		term_fontpop(p);
+	}
 
 	term_fontpush(p, TERMFONT_BOLD);
-	term_word(p, sv->string);
+	term_word(p, link->string);
 	term_fontpop(p);
 
 	return(0);
--
 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:[~2012-07-08 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-08 22:49 mdocml: fix .Lk for -Tascii and implement it for -Tman OpenBSD rev 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).