From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 24d31077; for ; Tue, 3 Mar 2015 17:37:54 -0500 (EST) Date: Tue, 3 Mar 2015 17:37:54 -0500 (EST) Message-Id: <318161571760735769.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: texi2mdoc: New sentence, new line. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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