From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id a94cf663; for ; Mon, 2 Feb 2015 19:49:17 -0500 (EST) Date: Mon, 2 Feb 2015 19:49:17 -0500 (EST) Message-Id: <10401839659854099717.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Bring .Pp/.Lp handling inside .Nm blocks closer to groff; as a X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Bring .Pp/.Lp handling inside .Nm blocks closer to groff; as a bonus, get rid of another call to rew_sub(). Modified Files: -------------- mdocml: mdoc_macro.c mdoc_validate.c Revision Data ------------- Index: mdoc_macro.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_macro.c,v retrieving revision 1.169 retrieving revision 1.170 diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.169 -r1.170 --- mdoc_macro.c +++ mdoc_macro.c @@ -1459,10 +1459,17 @@ in_line_argn(MACRO_PROT_ARGS) static void in_line_eoln(MACRO_PROT_ARGS) { - struct mdoc_arg *arg; + struct mdoc_node *n; + struct mdoc_arg *arg; - if (tok == MDOC_Pp) - rew_sub(MDOC_BLOCK, mdoc, MDOC_Nm, line, ppos); + if ((tok == MDOC_Pp || tok == MDOC_Lp) && + ! (mdoc->flags & MDOC_SYNOPSIS)) { + n = mdoc->last; + if (mdoc->next == MDOC_NEXT_SIBLING) + n = n->parent; + if (n->tok == MDOC_Nm) + rew_last(mdoc, mdoc->last->parent); + } mdoc_argv(mdoc, line, tok, &arg, pos, buf); mdoc_elem_alloc(mdoc, line, ppos, tok, arg); Index: mdoc_validate.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v retrieving revision 1.265 retrieving revision 1.266 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.265 -r1.266 --- mdoc_validate.c +++ mdoc_validate.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2010-2014 Ingo Schwarze + * Copyright (c) 2010-2015 Ingo Schwarze * Copyright (c) 2010 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any @@ -1047,15 +1047,23 @@ post_vt(POST_ARGS) static void post_nm(POST_ARGS) { + struct mdoc_node *n; + + n = mdoc->last; + + if (n->last != NULL && + (n->last->tok == MDOC_Pp || + n->last->tok == MDOC_Lp)) + mdoc_node_relink(mdoc, n->last); if (NULL != mdoc->meta.name) return; - mdoc_deroff(&mdoc->meta.name, mdoc->last); + mdoc_deroff(&mdoc->meta.name, n); if (NULL == mdoc->meta.name) mandoc_msg(MANDOCERR_NM_NONAME, mdoc->parse, - mdoc->last->line, mdoc->last->pos, "Nm"); + n->line, n->pos, "Nm"); } static void -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv