From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5QDqMtA018497 for ; Sat, 26 Jun 2010 09:52:22 -0400 (EDT) Received: from smtp-2.sys.kth.se (localhost [127.0.0.1]) by smtp-2.sys.kth.se (Postfix) with ESMTP id AE0F814CE06 for ; Sat, 26 Jun 2010 15:52:16 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([127.0.0.1]) by smtp-2.sys.kth.se (smtp-2.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5wgDuflijj96 for ; Sat, 26 Jun 2010 15:52:01 +0200 (CEST) X-KTH-Auth: kristaps [130.237.221.96] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from [130.237.221.96] (ctime.pdc.kth.se [130.237.221.96]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 4859014C022 for ; Sat, 26 Jun 2010 15:51:59 +0200 (CEST) Message-ID: <4C260850.3080100@bsd.lv> Date: Sat, 26 Jun 2010 16:01:52 +0200 From: Kristaps Dzonsons User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: [WIP] SYNOPSIS indentation References: <20100626134712.GC22002@iris.usta.de> In-Reply-To: <20100626134712.GC22002@iris.usta.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > here is the other patch i hacked up on the plane. > It is still work in progress, there are few bugs in > horizontal spacing still, but it mostly does the job > and certainly shows the spirit. > Again, this is based on OpenBSD-current, and needs to > be rebased on bsd.lv HEAD. > > This is best used together with the .Bk patch just sent, > but does not depend on it. I'm quite pleased with the simplicity of this one. Nice! It needs to be brought up to speed with term_strlen() and term_len(), but that's a four-second operation (I noted the parts in-line). Also, you'll need to modify mdoc.7 and mdoc.3 to note that `Nm' can be two different types of variable. Do make sure this doesn't break any assumptions of MDOC_ELEM in the actioner/validator. I didn't double-check these. Kristaps > + switch (n->type) { > + case (MDOC_BLOCK): > + return(1); > + case (MDOC_HEAD): > + p->flags |= TERMP_NOBREAK | TERMP_HANG; > + offset = n->child ? 6 : strlen(m->name)+1; This'll be term_len(p, 6) and term_strlen(m->name) + term_len(p, 1). > + p->rmargin = p->offset + offset; > + break; > + case (MDOC_BODY): > + p->flags |= TERMP_NOLPAD | TERMP_NOSPACE; > + offset = n->prev->child ? 6 : strlen(m->name)+1; Same as above... > + p->offset += offset; > + return(1); > + default: > + break; > + } > > if (NULL == n->child && NULL == m->name) > return(1); > @@ -1062,11 +1083,33 @@ termp_nm_pre(DECL_ARGS) > term_fontpush(p, TERMFONT_BOLD); > if (NULL == n->child) > term_word(p, m->name); > + > return(1); > } > > > /* ARGSUSED */ > +static void > +termp_nm_post(DECL_ARGS) > +{ > + > + switch (n->type) { > + case (MDOC_HEAD): > + term_flushln(p); > + p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); > + break; > + case (MDOC_BODY): > + term_flushln(p); > + p->flags &= ~TERMP_NOLPAD; > + break; > + default: > + break; > + } > + return; > +} > + > + > +/* ARGSUSED */ > static int > termp_fl_pre(DECL_ARGS) > { > -- > To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv > -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv