tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: mdocml: Churn-ish check-in getting mdoc_parseln() and man_parseln() to
Date: Sun, 27 Jun 2010 18:07:53 +0200	[thread overview]
Message-ID: <20100627160753.GG19398@iris.usta.de> (raw)
In-Reply-To: <4C2775AB.5050909@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Sun, Jun 27, 2010 at 06:00:43PM +0200:
> Ingo Schwarze wrote:

>> This must not be const.

> Registers should be written only by libroff

Not true.
In roff, registers can be set (.nr) and read (\n).
Reading can either embed the result in the output stream
or use it in a condition.
Thus, it is easily possible to inspect registers,
and it turns out .Sh DOES change the register.

> (they're roff constructs).

Sure, but alas, in the mdoc(7) language, layering is weak.

> It's up to libmdoc and libman if they want to cue the front-ends by
> looking at both their internal state and the registers.

That's not sufficient.
Conditions depending on the nS register can be used to find out
on the roff level whether we are in SYNOPSIS, so libmdoc must cue
libroff, too.  Granted, we don't implement conditions inspecting
registers so far, but we are heading that way.

I have already seen real manuals using real non-trivial conditions
inspecting registers in the wild, so we should pay attention keeping
register content accurate at all times.

> This will be apparent by the next commit that implements the cue
> for SYNOPSIS formatting.

Looking forward to it...

[...]
>> The nice thing about my patch is that the backend and the frontend
>> can use identical roff_reg_(get|set)* functions, so some functions
>> can be shared between mdoc_validate and mdoc_term.

> True, but I don't want the front-ends looking at raw registers.

Indeed, you have a point here.

> In general, the compilers should tell the front-ends exactly what to do
> with flags and cached data: I want dumb front-ends in terms of semantics.

That sound sane as well.

Yours,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2010-06-27 16:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201006261536.o5QFacau021968@krisdoz.my.domain>
2010-06-26 20:09 ` Ingo Schwarze
2010-06-27 16:00   ` Kristaps Dzonsons
2010-06-27 16:07     ` Ingo Schwarze [this message]
2010-06-27 16:27       ` Kristaps Dzonsons
2010-06-27 16:15     ` Kristaps Dzonsons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100627160753.GG19398@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).