discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: discuss@mdocml.bsd.lv
Subject: Re: mandoc vs Xo in It argument
Date: Tue, 25 May 2010 20:27:06 +0200	[thread overview]
Message-ID: <20100525182706.GA7295@iris.usta.de> (raw)
In-Reply-To: <20100525175653.GI8074@bramka.kerhand.co.uk>

Hi Jason, hi Ulrich,

Jason McIntyre wrote on Tue, May 25, 2010 at 06:56:29PM +0100:
> On Tue, May 25, 2010 at 05:58:38PM +0200, Ulrich Spoerlein wrote:

>> while further cleaning up the FreeBSD manpages, I'm now at a point where
>> I have to fix the Xo/Xc fallout. Why exactly is this allowed:
>> 
>> .Bl -tag -width indent -compact
>> .It Xo
>> .Ft void
>> .Xc

Because i implemented plain .It Xo support long ago.  ;-)

>> .It Xo
>> .Fn auth_destroy "AUTH *auth"
>> .Xc
>> .Pp
>> A macro that destroys the authentication information associated with
>> 
>> But not this
>> 
>> .Bl -column "CLSET_RETRY_TIMEOUT" "struct sockaddr_in"
>> .It Dv CLSET_TIMEOUT Ta Xo
>> .Vt "struct timeval" Ta "set total timeout"
>> .Xc
>> .It Dv CLGET_TIMEOUT Ta Xo
>> .Vt "struct timeval" Ta "get total timeout"
>> .Xc
>> .El

Because Kristaps did not yet implement support for .Ta as a
full-blown macro, so you can't extend it yet with .Xo.
But, unless i'm quite mistaken, he is going to,
this will be the next step after the next release,
which is expected to happen very soon.

>> And is there a better way to rewrite this other than putting all the
>> arguments to .It on the same line (which quickly runs over 80 columns).

Hmmm, probably you will not need to rewrite that code at all.
On the other hand, the .Ta in the middle of the .Xo/.Xc does
look a bit ugly.  But i also have some code written that is
nearly finished, improving support for badly nested blocks, like

.Ao ao
.Bo bo
.Ac ac
.Bc bc

and 

.Aq aq Bo bo
.Bc bc

So, when Kristaps is finished with .Ta, let's see whether i can
put the pieces together and get

.It it Xo xo
.Ta ta
.Xc xc

supported too.
If you are lucky, it may take a week or two, if you are less lucky,
perhaps after the c2k10 hackathon, that is mid-July.

>> People really seem to like these three column tables ...

Sure, people are really creative, with .Bl -column in particular.

> i'm not going to answer any questions here, just fuel the fire a bit ;)
> 
> Xo/Xc and -column are both steeped in dark magic.

We are trying hard to make that obscurity go away.
Without .Xo, and since the m2k10 hackathon, mandoc is already
handling .Bl -column more gracefully than groff, i think.

Take block nesting (including .Xo/.Xc) alone, and expect the
remaining dark magic to be gone in about two week's time.

> put them together, and expect everything to break.

Still true, but the clear goal is to change that.

> do yourself a favour: whenever you have something that makes you think
> "that'll make a nice table", just paste it in, and wrap it in a literal
> display. no one will be any the wiser, and the poor bastard who needs to
> add column 4 will be forever grateful to you.

Still true, and .Bd -literal will of course remain a good option
for many cases, but we are trying hard to make .Bl -column
work reliably.

> you could also try formatting your problem list in a way similar to the
> first, simpler, example you gave. but if it works it will be trial and
> error, and not because those macros follow any kind of logic.

The hard part implementing them will be to make them do what you
want, reliably, even in cases that used to break for no obvious reason
in groff, and still remain compatible with existing usage in manuals.
But i suspect that is an achievable goal now, though certainly
non-trivial.

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

  reply	other threads:[~2010-05-25 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 15:58 Ulrich Spörlein
2010-05-25 17:56 ` Jason McIntyre
2010-05-25 18:27   ` Ingo Schwarze [this message]
2010-05-25 18:45     ` Ulrich Spörlein

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=20100525182706.GA7295@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@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).