source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* texi2mdoc: New sentence, new line.
@ 2015-03-03 22:37 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2015-03-03 22:37 UTC (permalink / raw)
  To: source

Log Message:
-----------
New sentence, new line.

Modified Files:
--------------
    texi2mdoc:
        util.c

Revision Data
-------------
Index: util.c
===================================================================
RCS file: /home/cvs/mdocml/texi2mdoc/util.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lutil.c -Lutil.c -u -p -r1.24 -r1.25
--- util.c
+++ util.c
@@ -569,10 +569,16 @@ static void
 parseword(struct texi *p, size_t *pos, char extra)
 {
 
+	/*
+	 * Some line control: if we (non-macro, non-literal) already
+	 * have more than 72 characters written to the screen, then
+	 * output a newline before getting started.
+	 */
 	if (p->seenws && 0 == p->outmacro && 
 		 p->outcol > 72 && 0 == p->literal)
 		texiputchar(p, '\n');
-	/* FIXME: abstract this: we use it elsewhere. */
+
+	/* Usual padding in the case of seen whitespace. */
 	if (p->seenws && p->outcol && 0 == p->literal)
 		texiputchar(p, ' ');
 
@@ -601,6 +607,15 @@ parseword(struct texi *p, size_t *pos, c
 			texiputchar(p, BUF(p)[*pos]);
 		advance(p, pos);
 	}
+
+	/* 
+	 * New sentence, new line:if we (non-macro, non-literal) see a
+	 * period at the end of the last printed word, then open a
+	 * newline.
+	 */
+	if (0 == p->literal && 0 == p->outmacro && 
+		*pos < BUFSZ(p) && '.' == BUF(p)[*pos - 1])
+		texiputchar(p, '\n');
 }
 
 /*
--
 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:[~2015-03-03 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 22:37 texi2mdoc: New sentence, new line kristaps

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).