From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id oBPNPsWC032731 for ; Sat, 25 Dec 2010 18:25:55 -0500 (EST) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id oBPNPsDm031131; Sat, 25 Dec 2010 18:25:54 -0500 (EST) Date: Sat, 25 Dec 2010 18:25:54 -0500 (EST) Message-Id: <201012252325.oBPNPsDm031131@krisdoz.my.domain> 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: mdocml: Implement schwarze@'s much more elegant version of my %T/%J fix. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Implement schwarze@'s much more elegant version of my %T/%J fix. Modified Files: -------------- mdocml: mdoc.h mdoc_term.c mdoc_validate.c Revision Data ------------- Index: mdoc_validate.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v retrieving revision 1.148 retrieving revision 1.149 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.148 -r1.149 --- mdoc_validate.c +++ mdoc_validate.c @@ -1649,19 +1649,8 @@ post_rs(POST_ARGS) { struct mdoc_node *nn, *next, *prev; int i, j; - int *tj; -#define RS_JOURNAL (1 << 0) -#define RS_TITLE (1 << 1) - /* Mark whether we're carrying both a %T and %J. */ - - tj = &mdoc->last->norm->Rs.titlejournal; - - if (MDOC_BLOCK == mdoc->last->type) { - if ( ! (RS_JOURNAL & *tj && RS_TITLE & *tj)) - *tj = 0; - return(1); - } else if (MDOC_BODY != mdoc->last->type) + if (MDOC_BODY != mdoc->last->type) return(1); /* @@ -1677,10 +1666,8 @@ post_rs(POST_ARGS) break; if (i < RSORD_MAX) { - if (MDOC__T == rsord[i]) - *tj |= RS_TITLE; - else if (MDOC__J == rsord[i]) - *tj |= RS_JOURNAL; + if (MDOC__J == rsord[i]) + mdoc->last->norm->Rs.child_J = nn; next = nn->next; continue; } Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.203 retrieving revision 1.204 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.203 -r1.204 --- mdoc_term.c +++ mdoc_term.c @@ -2148,8 +2148,8 @@ termp__t_post(DECL_ARGS) * If we're in an `Rs' and there's a journal present, then quote * us instead of underlining us (for disambiguation). */ - if (n->parent && MDOC_Rs == n->parent->tok && - n->parent->norm->Rs.titlejournal) + if (n->parent && MDOC_Rs == n->parent->tok && + n->parent->norm->Rs.child_J) termp_quote_post(p, pair, m, n); termp____post(p, pair, m, n); @@ -2165,7 +2165,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.titlejournal) + n->parent->norm->Rs.child_J) return(termp_quote_pre(p, pair, m, n)); term_fontpush(p, TERMFONT_UNDER); Index: mdoc.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.h,v retrieving revision 1.111 retrieving revision 1.112 diff -Lmdoc.h -Lmdoc.h -u -p -r1.111 -r1.112 --- mdoc.h +++ mdoc.h @@ -354,7 +354,7 @@ struct mdoc_an { }; struct mdoc_rs { - int titlejournal; /* whether %T and %J */ + struct mdoc_node *child_J; /* pointer to %J */ }; /* -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv