From 026fcc9f0bcdb3ef7c2a64feae925b2fcd9c6d16 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 25 Jan 2011 10:37:49 +0000 Subject: If %B is specified, quote %T. Noted by schwarze@ in the TODO. --- TODO | 7 +------ mdoc.h | 4 ++-- mdoc_term.c | 6 +++--- mdoc_validate.c | 6 +++--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/TODO b/TODO index 607afc9c..3b1425fb 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.83 2011/01/24 01:34:56 schwarze Exp $ +* $Id: TODO,v 1.84 2011/01/25 10:37:49 kristaps Exp $ ************************************************************************ ************************************************************************ @@ -265,11 +265,6 @@ .Xc The input text is appended after the specified line. -- When we have both .%T and .%B in .Rs, .%T uses "", not underline, see - for example arp(4); admittedly, arp(4) is abusing both .%T and .%B, - but when dealing with anthologies, sensible use of of both in the - same .Rs can occur. - - Header lines of excessive length: Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c and document it in mdoc(7) and man(7) COMPATIBILITY diff --git a/mdoc.h b/mdoc.h index 9c22c336..746639dc 100644 --- a/mdoc.h +++ b/mdoc.h @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.114 2011/01/01 12:18:37 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.115 2011/01/25 10:37:49 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -355,7 +355,7 @@ struct mdoc_an { }; struct mdoc_rs { - struct mdoc_node *child_J; /* pointer to %J */ + int quote_T; /* whether to quote %T */ }; /* diff --git a/mdoc_term.c b/mdoc_term.c index d0eab85a..91954258 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.209 2011/01/12 10:43:22 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.210 2011/01/25 10:37:49 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -2169,7 +2169,7 @@ termp__t_post(DECL_ARGS) * us instead of underlining us (for disambiguation). */ if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.child_J) + n->parent->norm->Rs.quote_T) termp_quote_post(p, pair, m, n); termp____post(p, pair, m, n); @@ -2185,7 +2185,7 @@ termp__t_pre(DECL_ARGS) * us instead of underlining us (for disambiguation). */ if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.child_J) + n->parent->norm->Rs.quote_T) return(termp_quote_pre(p, pair, m, n)); term_fontpush(p, TERMFONT_UNDER); diff --git a/mdoc_validate.c b/mdoc_validate.c index 7bdb1c7f..1f43817c 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.152 2011/01/22 14:00:52 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.153 2011/01/25 10:37:49 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -1665,8 +1665,8 @@ post_rs(POST_ARGS) break; if (i < RSORD_MAX) { - if (MDOC__J == rsord[i]) - mdoc->last->norm->Rs.child_J = nn; + if (MDOC__J == rsord[i] || MDOC__B == rsord[i]) + mdoc->last->norm->Rs.quote_T++; next = nn->next; continue; } -- cgit v1.2.3