From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-1.sys.kth.se (smtp-1.sys.kth.se [130.237.32.175]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p0B1AbZ3022996 for ; Mon, 10 Jan 2011 20:10:39 -0500 (EST) Received: from smtp-1.sys.kth.se (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id DBC071557D3; Tue, 11 Jan 2011 02:10:31 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-1.sys.kth.se ([127.0.0.1]) by smtp-1.sys.kth.se (smtp-1.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xo6ud5LhJrg9; Tue, 11 Jan 2011 02:10:30 +0100 (CET) X-KTH-Auth: kristaps [85.8.60.237] X-KTH-mail-from: kristaps@bsd.lv Received: from h85-8-60-237.dynamic.se.alltele.net (h85-8-60-237.dynamic.se.alltele.net [85.8.60.237]) by smtp-1.sys.kth.se (Postfix) with ESMTP id CDFA7155190; Tue, 11 Jan 2011 02:10:28 +0100 (CET) Message-ID: <4D2BAE03.7050709@bsd.lv> Date: Tue, 11 Jan 2011 02:10:27 +0100 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv, Jason McIntyre Subject: Leading space in roff = leading newline. Content-Type: multipart/mixed; boundary="------------080008090104070708020600" This is a multi-part message in MIME format. --------------080008090104070708020600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I came across a real gem in gm.1. Apparently leading a line with a space causes a leading newline, as in ++++ The \fBGraphicsMagick\fP utilities recognize the following image formats: \fBName\fP \fBMode\fP \fBDescription\fP o 8BIM *rw- Photoshop resource format o 8BIMTEXT *rw- Photoshop resource format o 8BIMWTEXT *rw- Photoshop resource format o APP1 *rw- Photoshop resource format o ART *r-- PF1: 1st Publisher ---- and so on. It works with mdoc(7) and man(7). Anybody against the following patch? Thanks, Kristaps --------------080008090104070708020600 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" Index: libman.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libman.h,v retrieving revision 1.44 diff -r1.44 libman.h 36a37 > #define MAN_NEWLINE (1 << 6) /* first macro/text in a line */ Index: man.7 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.7,v retrieving revision 1.94 diff -r1.94 man.7 61a62,64 > .Pp > If the first character of a line is whitespace, that line is printed > verbatim, including the end-of-line. Index: man.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v retrieving revision 1.96 diff -r1.96 man.c 47c47 < static struct man_node *man_node_alloc(int, int, --- > static struct man_node *man_node_alloc(struct man *, int, int, 131a132,133 > m->flags |= MAN_NEWLINE; > 232c234,235 < man_node_alloc(int line, int pos, enum man_type type, enum mant tok) --- > man_node_alloc(struct man *m, int line, int pos, > enum man_type type, enum mant tok) 240a244,247 > > if (MAN_NEWLINE & m->flags) > p->flags |= MAN_LINE; > m->flags &= ~MAN_NEWLINE; 250c257 < p = man_node_alloc(line, pos, MAN_ELEM, tok); --- > p = man_node_alloc(m, line, pos, MAN_ELEM, tok); 263c270 < p = man_node_alloc(line, pos, MAN_HEAD, tok); --- > p = man_node_alloc(m, line, pos, MAN_HEAD, tok); 276c283 < p = man_node_alloc(line, pos, MAN_BODY, tok); --- > p = man_node_alloc(m, line, pos, MAN_BODY, tok); 289c296 < p = man_node_alloc(line, pos, MAN_BLOCK, tok); --- > p = man_node_alloc(m, line, pos, MAN_BLOCK, tok); 302c309 < n = man_node_alloc(0, 0, MAN_TBL, MAN_MAX); --- > n = man_node_alloc(m, 0, 0, MAN_TBL, MAN_MAX); 320c327 < n = man_node_alloc(line, pos, MAN_TEXT, MAN_MAX); --- > n = man_node_alloc(m, line, pos, MAN_TEXT, MAN_MAX); Index: man.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.h,v retrieving revision 1.50 diff -r1.50 man.h 99a100 > #define MAN_LINE (1 << 3) /* first macro/text on line */ Index: man_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_html.c,v retrieving revision 1.62 diff -r1.62 man_html.c 199a200,207 > if ('\0' == *n->string) { > print_otag(h, TAG_P, 0, NULL); > return; > } > > if (' ' == *n->string && MAN_LINE & n->flags) > print_otag(h, TAG_BR, 0, NULL); > 200a209 > Index: man_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v retrieving revision 1.95 diff -r1.95 man_term.c 862c862 < if (0 == *n->string) { --- > if ('\0' == *n->string) { 865c865,868 < } --- > } > > if (' ' == *n->string && MAN_LINE & n->flags) > term_newln(p); 880a884 > Index: mdoc.7 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.7,v retrieving revision 1.174 diff -r1.174 mdoc.7 57a58,60 > .Pp > If the first character of a line is whitespace, that line is printed > verbatim, including the end-of-line. Index: mdoc_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v retrieving revision 1.142 diff -r1.142 mdoc_html.c 422a423,424 > if (' ' == *n->string && MDOC_LINE & n->flags) > print_otag(h, TAG_BR, 0, NULL); Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.208 diff -r1.208 mdoc_term.c 317a318,319 > if (' ' == *n->string && MDOC_LINE & n->flags) > term_newln(p); --------------080008090104070708020600-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv