source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Move printing of the .RS macro into print_offs() such that
@ 2013-05-19 21:07 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-05-19 21:07 UTC (permalink / raw)
  To: source

Log Message:
-----------
Move printing of the .RS macro into print_offs() such that print_offs()
takes care of printing the whole line.  This reduces code duplication -
in particular after the upcoming commit to repair .Bl -offset -
and makes print_offs() more similar to what print_width() does.
No functional change.

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.47
retrieving revision 1.48
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.47 -r1.48
--- mdoc_man.c
+++ mdoc_man.c
@@ -408,6 +408,8 @@ print_offs(const char *v)
 	struct roffsu	  su;
 	size_t		  sz;
 
+	print_line(".RS", MMAN_Bk_susp);
+
 	/* Convert v into a number (of characters). */
 	if (NULL == v || '\0' == *v || 0 == strcmp(v, "left"))
 		sz = 0;
@@ -427,6 +429,7 @@ print_offs(const char *v)
 			 * in terms of different units.
 			 */
 			print_word(v);
+			outflags |= MMAN_nl;
 			return;
 		}
 	} else
@@ -441,6 +444,7 @@ print_offs(const char *v)
 
 	snprintf(buf, sizeof(buf), "%ldn", sz);
 	print_word(buf);
+	outflags |= MMAN_nl;
 }
 
 /*
@@ -825,9 +829,7 @@ pre_bd(DECL_ARGS)
 		print_line(".nf", 0);
 	if (0 == n->norm->Bd.comp && NULL != n->parent->prev)
 		outflags |= MMAN_sp;
-	print_line(".RS", MMAN_Bk_susp);
 	print_offs(n->norm->Bd.offs);
-	outflags |= MMAN_nl;
 	return(1);
 }
 
@@ -981,9 +983,7 @@ static int
 pre_dl(DECL_ARGS)
 {
 
-	print_line(".RS", MMAN_Bk_susp);
 	print_offs("6n");
-	outflags |= MMAN_nl;
 	return(1);
 }
 
--
 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:[~2013-05-19 21:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-19 21:07 mdocml: Move printing of the .RS macro into print_offs() such that 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).