From a73fad6a61b6e04c1e14dee9dd99ae3883441dca Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 30 Dec 2013 00:20:18 +0000 Subject: [PATCH] Do not trigger end-of-sentence spacing by trailing punctuation at the end of partial implicit macros. Prodded by jmc@. Actually, this is a revert of rev. 1.39 Sat May 15 09:20:01 2010 UTC, which in turn is mdocml.bsd.lv rev. 1.64 Fri May 14 14:09:13 2010 UTC by kristaps@, with this original commit message: "Block-implicit macros now up-propogate end-of-sentence spacing. NOTE: GROFF IS NOT SMART ENOUGH TO DO THIS." Please speak after me: Then why the hell should we? We already weakened this in rev. 1.55 Fri Jul 16 00:34:33 2010 UTC, but that weakening was insufficient. Let's take it out completely. Admittedly, there are two places in base where what Kristaps did made the output nicer, in calloc(3) and in fish(6). But both are atypical. There are 18 other places where this revert makes the output nicer, the typical case being: "Mail status is shown as ``No Mail.'' if there is no mail." You do *not* want the EOS spacing after ``No Mail.'' in that sentence. --- usr.bin/mandoc/mdoc_macro.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index caca6a4e914..191b8bfc783 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.82 2013/12/24 20:45:21 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.83 2013/12/30 00:20:18 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013 Ingo Schwarze @@ -1345,25 +1345,6 @@ blk_part_imp(MACRO_PROT_ARGS) body = mdoc->last; } - for (n = body->child; n && n->next; n = n->next) - /* Do nothing. */ ; - - /* - * End of sentence spacing: if the last node is a text node and - * has a trailing period, then mark it as being end-of-sentence. - */ - - if (n && MDOC_TEXT == n->type && n->string) - if (mandoc_eos(n->string, strlen(n->string), 1)) - n->flags |= MDOC_EOS; - - /* Up-propagate the end-of-space flag. */ - - if (n && (MDOC_EOS & n->flags)) { - body->flags |= MDOC_EOS; - body->parent->flags |= MDOC_EOS; - } - /* * If there is an open sub-block requiring explicit close-out, * postpone closing out the current block -- 2.20.1