source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: minor -mdoc -Tman fixes * right after .Ns, avoid breaking the
@ 2012-07-07 13:37 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2012-07-07 13:37 UTC (permalink / raw)
  To: source

Log Message:
-----------
minor -mdoc -Tman fixes
* right after .Ns, avoid breaking the line in man code
* after .Fl without arguments, do not insert a blank into man code
* before each .Nm in .Sh SYNOPSIS, insert a .br into man code
* skip .Pp arguments, don't copy them to man code

OpenBSD rev. 1.7

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

Revision Data
-------------
Index: mdoc_man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_man.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.9 -r1.10
--- mdoc_man.c
+++ mdoc_man.c
@@ -290,7 +290,7 @@ print_node(DECL_ARGS)
 	 * This makes the page structure be more consistent.
 	 */
 	prev = n->prev ? n->prev : n->parent;
-	if (prev && prev->line < n->line)
+	if (prev && prev->line < n->line && MDOC_Ns != prev->tok)
 		mm->need_nl = 1;
 
 	act = NULL;
@@ -379,6 +379,8 @@ post_enc(DECL_ARGS)
 		return;
 	mm->need_space = 0;
 	print_word(mm, suffix);
+	if (MDOC_Fl == n->tok && 0 == n->nchild)
+		mm->need_space = 0;
 }
 
 /*
@@ -544,6 +546,11 @@ pre_nm(DECL_ARGS)
 
 	if (MDOC_ELEM != n->type && MDOC_HEAD != n->type)
 		return(1);
+	if (MDOC_SYNPRETTY & n->flags) {
+		mm->need_nl = 1;
+		print_word(mm, ".br");
+		mm->need_nl = 1;
+	}
 	print_word(mm, "\\fB");
 	mm->need_space = 0;
 	if (NULL == n->child)
@@ -586,7 +593,7 @@ pre_pp(DECL_ARGS)
 	else
 		print_word(mm, ".PP");
 	mm->need_nl = 1;
-	return(1);
+	return(MDOC_Rs == n->tok);
 }
 
 static int
--
 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-07 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-07 13:37 mdocml: minor -mdoc -Tman fixes * right after .Ns, avoid breaking the 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).