From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o8RMQ2Xl024193 for ; Mon, 27 Sep 2010 18:26:03 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1P0M93-0003WW-Gd; Tue, 28 Sep 2010 00:26:01 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1P0M93-0006hI-Fp for tech@mdocml.bsd.lv; Tue, 28 Sep 2010 00:26:01 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1P0M93-0000n2-Es for tech@mdocml.bsd.lv; Tue, 28 Sep 2010 00:26:01 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1P0M93-0001Qs-7L for tech@mdocml.bsd.lv; Tue, 28 Sep 2010 00:26:01 +0200 Date: Tue, 28 Sep 2010 00:26:01 +0200 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: mdocml version 1.10.6 available Message-ID: <20100927222600.GA5616@iris.usta.de> References: <4CA0912F.5040103@bsd.lv> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CA0912F.5040103@bsd.lv> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Kristaps, Kristaps Dzonsons wrote on Mon, Sep 27, 2010 at 02:42:23PM +0200: > I'm pleased to announce mdocml 1.10.6, now at http://mdocml.bsd.lv/. > This is mainly for the new mandoc calling conventions and improved > pod2man preamble support. ... and you snoke in a few nice last-minute bug fixes, shortening the TODO list. :-) This is now merged to OpenBSD as well. While merging, i fixed a minor regression: Two successive blank lines must both be printed, even (horrors!) ouside literal mode. Both old and new groff agree on that. I fixed that by interpreting blank lines as .sp (instead of .Pp) in mdoc.c, function mdoc_ptext(), and dropping .Pp before .sp in exactly the same way as .Pp before .Pp. For reference, here are the rules for handling explicit line breaks: .br breaks the line, unless we are at the beginning of a line .Pp adds a blank line, but collapses with a following - but not with a preceding! - blank line .sp adds a blank line and doesn't collapse A blank line is always the same as .sp. Consequently, using the notation 0 = break the line, no blank line 1 = one blank line 2 = two blank lines we get the following combinations: single br = 0 single Pp = 1 single sp = 1 double br = 0 br Pp = Pp = 1 Pp br = Pp = 1 br sp = sp = 1 sp br = sp = 1 double Pp = Pp (collapse) = 1 Pp sp = sp (collapse) = 1 sp Pp = 2 double sp = 2 Crazy as it is, this is now indeed implemented correctly in mandoc. So, here is the diff from OpenBSD that i would like to merge to bsd.lv: * mdoc.c, first chunk: blank line = .sp, see above * mdoc.c, second chunk: Revert unneeded and wrong part of the .br\} fix. The parsing is completed in roff.c, the .br\} never propagates to the macro libraries, and when a backslash follows a real macro, that macro must *not* be recognized. This was never merged to OpenBSD; sorry for forgetting to report earlier... * mdoc_term.c: Two prototypes are better than one? * mdoc_validate.c: Drop .Pp before .sp; see above. * term_ps.c: fix off by one found by jsg@ with parfait, see OpenBSD term_ps.d rev. 1.12 OK? Yours, Ingo Index: mdoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v retrieving revision 1.164 diff -u -p -r1.164 mdoc.c --- mdoc.c 29 Aug 2010 11:29:51 -0000 1.164 +++ mdoc.c 27 Sep 2010 21:37:24 -0000 @@ -691,11 +691,11 @@ mdoc_ptext(struct mdoc *m, int line, cha return(0); /* - * Insert a `Pp' in the case of a blank line. Technically, + * Insert a `sp' in the case of a blank line. Technically, * blank lines aren't allowed, but enough manuals assume this * behaviour that we want to work around it. */ - if ( ! mdoc_elem_alloc(m, line, offs, MDOC_Pp, NULL)) + if ( ! mdoc_elem_alloc(m, line, offs, MDOC_sp, NULL)) return(0); m->next = MDOC_NEXT_SIBLING; @@ -758,14 +758,11 @@ mdoc_pmacro(struct mdoc *m, int ln, char /* * Copy the first word into a nil-terminated buffer. - * Stop copying when a tab, space, backslash, or eoln is encountered. + * Stop copying when a tab, space, or eoln is encountered. */ j = 0; - while (j < 4 && '\0' != buf[i] && - ' ' != buf[i] && - '\t' != buf[i] && - '\\' != buf[i]) + while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i]) mac[j++] = buf[i++]; mac[j] = '\0'; Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.190 diff -u -p -r1.190 mdoc_term.c --- mdoc_term.c 27 Sep 2010 11:21:39 -0000 1.190 +++ mdoc_term.c 27 Sep 2010 21:37:27 -0000 @@ -81,7 +81,6 @@ static void termp_lb_post(DECL_ARGS); static void termp_nm_post(DECL_ARGS); static void termp_pf_post(DECL_ARGS); static void termp_quote_post(DECL_ARGS); -static void termp_quote_post(DECL_ARGS); static void termp_sh_post(DECL_ARGS); static void termp_ss_post(DECL_ARGS); Index: mdoc_validate.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v retrieving revision 1.118 diff -u -p -r1.118 mdoc_validate.c --- mdoc_validate.c 27 Sep 2010 11:25:03 -0000 1.118 +++ mdoc_validate.c 27 Sep 2010 21:37:30 -0000 @@ -265,7 +265,7 @@ const struct valids mdoc_valids[MDOC_MAX { NULL, NULL }, /* Dx */ { NULL, posts_text }, /* %Q */ { NULL, posts_notext }, /* br */ - { NULL, posts_sp }, /* sp */ + { pres_pp, posts_sp }, /* sp */ { NULL, posts_text1 }, /* %U */ { NULL, NULL }, /* Ta */ }; Index: term_ps.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v retrieving revision 1.44 diff -u -p -r1.44 term_ps.c --- term_ps.c 4 Sep 2010 20:18:53 -0000 1.44 +++ term_ps.c 27 Sep 2010 21:37:30 -0000 @@ -908,7 +908,7 @@ ps_pletter(struct termp *p, int c) f = (int)p->engine.ps.lastf; - if (c <= 32 || (c - 32 > MAXCHAR)) { + if (c <= 32 || (c - 32 >= MAXCHAR)) { ps_putchar(p, ' '); p->engine.ps.pscol += (size_t)fonts[f].gly[0].wx; return; -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv