source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: texi2mdoc: New sentence, new line.
Date: Tue, 3 Mar 2015 17:37:54 -0500 (EST)	[thread overview]
Message-ID: <318161571760735769.enqueue@fantadrom.bsd.lv> (raw)

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

                 reply	other threads:[~2015-03-03 22:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=318161571760735769.enqueue@fantadrom.bsd.lv \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).