From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id e1126013 for ; Sat, 24 Jun 2017 10:06:23 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1dOmdg-00070h-Um; Sat, 24 Jun 2017 17:06:22 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1dOmdd-00038d-SQ; Sat, 24 Jun 2017 17:06:17 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1dOmdd-0007C3-Mv; Sat, 24 Jun 2017 17:06:17 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id bc615050; Sat, 24 Jun 2017 17:06:17 +0200 (CEST) Date: Sat, 24 Jun 2017 17:06:17 +0200 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mandoc.bsd.lv Subject: Re: MT and ME macros Message-ID: <20170624150617.GI39761@athene.usta.de> References: <81293.1498196746@cathet.us> <20170623134418.GA89450@athene.usta.de> <61002.1498289497@cathet.us> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61002.1498289497@cathet.us> User-Agent: Mutt/1.6.2 (2016-07-01) Hi Anthony, Anthony J. Bentley wrote on Sat, Jun 24, 2017 at 01:31:37AM -0600: > Take 2: OK schwarze@ with one nit in the mandoc(1) manual page, see inline. Please commit to OpenBSD, and i'll merge to bsd.lv. Thanks, Ingo > Index: share/man/man7/man.7 > =================================================================== > RCS file: /cvs/src/share/man/man7/man.7,v > retrieving revision 1.47 > diff -u -p -r1.47 man.7 > --- share/man/man7/man.7 7 May 2017 21:44:33 -0000 1.47 > +++ share/man/man7/man.7 24 Jun 2017 07:24:38 -0000 > @@ -466,6 +466,20 @@ See also > .Sx \&PP , > and > .Sx \&TP . > +.Ss \&ME > +End a mailto block. > +This is a non-standard GNU extension, included only for compatibility. > +See > +.Sx \&MT . > +.Ss \&MT > +Begin a mailto block. > +This is a non-standard GNU extension, included only for compatibility. > +It has the following syntax: > +.Bd -literal -offset indent > +.Pf \. Sx \&MT Ar address > +link description to be shown > +.Pf \. Sx ME > +.Ed > .Ss \&OP > Optional command-line argument. > This is a non-standard GNU extension, included only for compatibility. > Index: usr.bin/mandoc/man_html.c > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/man_html.c,v > retrieving revision 1.96 > diff -u -p -r1.96 man_html.c > --- usr.bin/mandoc/man_html.c 8 Jun 2017 12:54:40 -0000 1.96 > +++ usr.bin/mandoc/man_html.c 24 Jun 2017 07:24:38 -0000 > @@ -103,6 +103,8 @@ static const struct htmlman __mans[MAN_M > { NULL, NULL }, /* EE */ > { man_UR_pre, NULL }, /* UR */ > { NULL, NULL }, /* UE */ > + { man_UR_pre, NULL }, /* MT */ > + { NULL, NULL }, /* ME */ > }; > static const struct htmlman *const mans = __mans - MAN_TH; > > @@ -227,6 +229,7 @@ print_man_node(MAN_ARGS) > case MAN_P: /* reopen .nf in the body. */ > case MAN_RS: > case MAN_UR: > + case MAN_MT: > fillmode(h, MAN_fi); > break; > default: > @@ -641,11 +644,17 @@ man_RS_pre(MAN_ARGS) > static int > man_UR_pre(MAN_ARGS) > { > + char *cp; > n = n->child; > assert(n->type == ROFFT_HEAD); > if (n->child != NULL) { > assert(n->child->type == ROFFT_TEXT); > - print_otag(h, TAG_A, "cTh", "Lk", n->child->string); > + if (n->tok == MAN_MT) { > + mandoc_asprintf(&cp, "mailto:%s", n->child->string); > + print_otag(h, TAG_A, "cTh", "Mt", cp); > + free(cp); > + } else > + print_otag(h, TAG_A, "cTh", "Lk", n->child->string); > } > > assert(n->next->type == ROFFT_BODY); > Index: usr.bin/mandoc/man_macro.c > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/man_macro.c,v > retrieving revision 1.84 > diff -u -p -r1.84 man_macro.c > --- usr.bin/mandoc/man_macro.c 17 Jun 2017 16:47:29 -0000 1.84 > +++ usr.bin/mandoc/man_macro.c 24 Jun 2017 07:24:38 -0000 > @@ -73,6 +73,8 @@ const struct man_macro __man_macros[MAN_ > { in_line_eoln, MAN_BSCOPE }, /* EE */ > { blk_exp, MAN_BSCOPE }, /* UR */ > { blk_close, MAN_BSCOPE }, /* UE */ > + { blk_exp, MAN_BSCOPE }, /* MT */ > + { blk_close, MAN_BSCOPE }, /* ME */ > }; > const struct man_macro *const man_macros = __man_macros - MAN_TH; > > @@ -214,6 +216,9 @@ blk_close(MACRO_PROT_ARGS) > break; > case MAN_UE: > ntok = MAN_UR; > + break; > + case MAN_ME: > + ntok = MAN_MT; > break; > default: > abort(); > Index: usr.bin/mandoc/man_term.c > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/man_term.c,v > retrieving revision 1.160 > diff -u -p -r1.160 man_term.c > --- usr.bin/mandoc/man_term.c 17 Jun 2017 13:05:47 -0000 1.160 > +++ usr.bin/mandoc/man_term.c 24 Jun 2017 07:24:38 -0000 > @@ -126,6 +126,8 @@ static const struct termact __termacts[M > { pre_literal, NULL, 0 }, /* EE */ > { pre_UR, post_UR, 0 }, /* UR */ > { NULL, NULL, 0 }, /* UE */ > + { pre_UR, post_UR, 0 }, /* MT */ > + { NULL, NULL, 0 }, /* ME */ > }; > static const struct termact *termacts = __termacts - MAN_TH; > > Index: usr.bin/mandoc/man_validate.c > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/man_validate.c,v > retrieving revision 1.101 > diff -u -p -r1.101 man_validate.c > --- usr.bin/mandoc/man_validate.c 17 Jun 2017 22:40:27 -0000 1.101 > +++ usr.bin/mandoc/man_validate.c 24 Jun 2017 07:24:38 -0000 > @@ -87,6 +87,8 @@ static const v_check __man_valids[MAN_MA > NULL, /* EE */ > post_UR, /* UR */ > NULL, /* UE */ > + post_UR, /* MT */ > + NULL, /* ME */ > }; > static const v_check *man_valids = __man_valids - MAN_TH; > > @@ -208,7 +210,7 @@ post_UR(CHKARGS) > > if (n->type == ROFFT_HEAD && n->child == NULL) > mandoc_vmsg(MANDOCERR_UR_NOHEAD, man->parse, > - n->line, n->pos, "UR"); > + n->line, n->pos, roff_name[n->tok]); > check_part(man, n); > } > > Index: usr.bin/mandoc/mandoc.1 > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/mandoc.1,v > retrieving revision 1.125 > diff -u -p -r1.125 mandoc.1 > --- usr.bin/mandoc/mandoc.1 17 Jun 2017 23:06:43 -0000 1.125 > +++ usr.bin/mandoc/mandoc.1 24 Jun 2017 07:24:38 -0000 > @@ -1225,6 +1225,7 @@ A > .Ic \&Bl , > .Ic \&D1 , > .Ic \&Dl , > +.Ic \&MT , > .Ic \&RS , > or > .Ic \&UR > @@ -1360,6 +1361,8 @@ An empty pair of square brackets is show > .It Sy "missing resource identifier, using \(dq\(dq" > .Pq man > The > +.Ic \&MT > +or > .Ic \&UR > macro is invoked without any argument. > An empty pair of angle brackets is shown. > @@ -1712,7 +1715,7 @@ An > .Xr mdoc 7 > block closing macro, a > .Xr man 7 > -.Ic \&RE > +.Ic \&MT , \&RE This line should be +.Ic \&ME , \&RE , > or > .Ic \&UE > macro, an > @@ -1746,7 +1749,7 @@ At the end of the document, an explicit > block, a > .Xr man 7 > next-line scope or > -.Ic \&RS > +.Ic \&MT , \&RS > or > .Ic \&UR > block, an equation, table, or > @@ -1918,6 +1921,7 @@ A macro or request is invoked with too m > .Bl -dash -offset 2n -width 2n -compact > .It > .Ic \&Fo , > +.Ic \&MT , > .Ic \&PD , > .Ic \&RS , > .Ic \&UR , > Index: usr.bin/mandoc/roff.c > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/roff.c,v > retrieving revision 1.187 > diff -u -p -r1.187 roff.c > --- usr.bin/mandoc/roff.c 18 Jun 2017 17:35:40 -0000 1.187 > +++ usr.bin/mandoc/roff.c 24 Jun 2017 07:24:39 -0000 > @@ -328,7 +328,7 @@ const char *__roff_name[MAN_MAX + 1] = { > "RE", "RS", "DT", "UC", > "PD", "AT", "in", > "OP", "EX", "EE", "UR", > - "UE", NULL > + "UE", "MT", "ME", NULL > }; > const char *const *roff_name = __roff_name; > > Index: usr.bin/mandoc/roff.h > =================================================================== > RCS file: /cvs/src/usr.bin/mandoc/roff.h,v > retrieving revision 1.37 > diff -u -p -r1.37 roff.h > --- usr.bin/mandoc/roff.h 17 Jun 2017 22:40:27 -0000 1.37 > +++ usr.bin/mandoc/roff.h 24 Jun 2017 07:24:39 -0000 > @@ -473,6 +473,8 @@ enum roff_tok { > MAN_EE, > MAN_UR, > MAN_UE, > + MAN_MT, > + MAN_ME, > MAN_MAX > }; > -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv