From 32784d2c1c250e62b6499f8b4e8d0fcdd98ba61b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 18 Nov 2012 00:05:35 +0000 Subject: [PATCH] Fix four small whitespace issues related to trailing punctuation reported by Nicolas Joly : - add EOS spacing after trailing punctuation after .Cd, .Fc, and .Lb - suppress spacing before trailing punctuation after .Fd Add the remaining issues from the same report to the TODO file. --- TODO | 11 ++++++++++- mdoc_argv.c | 8 ++++---- mdoc_macro.c | 5 +++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 8d80985e..01a92848 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.146 2012/11/16 18:44:32 schwarze Exp $ +* $Id: TODO,v 1.147 2012/11/18 00:05:35 schwarze Exp $ ************************************************************************ ************************************************************************ @@ -200,6 +200,11 @@ of in_line() - put trailing punctuation out of scope. Found in mount_nfs(8) and exports(5), search for "Appendix". +- Trailing punctuation after .%T triggers EOS spacing, at least + outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not + the right solution, it sends mandoc into an endless loop. + reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 @@ -228,6 +233,10 @@ in between, see for example tmux(1). reported by nicm@ 13 Jan 2011 00:18:57 +0000 +- Trailing punctuation after .It should trigger EOS spacing. + reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + Probably, this should be fixed somewhere in termp_it_pre(), not sure. + - .Nx 1.0a should be "NetBSD 1.0A", not "NetBSD 1.0a", see OpenBSD ccdconfig(8). diff --git a/mdoc_argv.c b/mdoc_argv.c index c008e0c9..220260a6 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.85 2012/11/17 00:26:33 schwarze Exp $ */ +/* $Id: mdoc_argv.c,v 1.86 2012/11/18 00:05:35 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012 Ingo Schwarze @@ -161,7 +161,7 @@ static const struct mdocarg mdocargs[MDOC_MAX] = { { ARGSFL_DELIM, NULL }, /* Ad */ { ARGSFL_DELIM, args_An }, /* An */ { ARGSFL_DELIM, NULL }, /* Ar */ - { ARGSFL_NONE, NULL }, /* Cd */ + { ARGSFL_DELIM, NULL }, /* Cd */ { ARGSFL_DELIM, NULL }, /* Cm */ { ARGSFL_DELIM, NULL }, /* Dv */ { ARGSFL_DELIM, NULL }, /* Er */ @@ -241,7 +241,7 @@ static const struct mdocarg mdocargs[MDOC_MAX] = { { ARGSFL_DELIM, NULL }, /* Xc */ { ARGSFL_NONE, NULL }, /* Xo */ { ARGSFL_NONE, NULL }, /* Fo */ - { ARGSFL_NONE, NULL }, /* Fc */ + { ARGSFL_DELIM, NULL }, /* Fc */ { ARGSFL_NONE, NULL }, /* Oo */ { ARGSFL_DELIM, NULL }, /* Oc */ { ARGSFL_NONE, args_Bk }, /* Bk */ @@ -250,7 +250,7 @@ static const struct mdocarg mdocargs[MDOC_MAX] = { { ARGSFL_NONE, NULL }, /* Hf */ { ARGSFL_NONE, NULL }, /* Fr */ { ARGSFL_NONE, NULL }, /* Ud */ - { ARGSFL_NONE, NULL }, /* Lb */ + { ARGSFL_DELIM, NULL }, /* Lb */ { ARGSFL_NONE, NULL }, /* Lp */ { ARGSFL_DELIM, NULL }, /* Lk */ { ARGSFL_DELIM, NULL }, /* Mt */ diff --git a/mdoc_macro.c b/mdoc_macro.c index ae59e979..1cec1ecd 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.119 2012/11/17 00:26:33 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.120 2012/11/18 00:05:35 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012 Ingo Schwarze @@ -612,7 +612,8 @@ dword(struct mdoc *mdoc, int line, */ else if (DELIM_CLOSE == d && mdoc->last->prev && - mdoc->last->prev->tok != MDOC_No) + mdoc->last->prev->tok != MDOC_No && + mdoc->last->parent->tok != MDOC_Fd) mdoc->last->flags |= MDOC_DELIMC; return(1); -- 2.47.1