discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Evan Silberman <evan@jklol.net>
To: discuss@mandoc.bsd.lv
Subject: befuddled by .Xo/.Xc
Date: Tue, 24 Sep 2024 17:18:28 -0700	[thread overview]
Message-ID: <2UKLZW0DL8BSM.2IIO9W4HSUSRR@silby.fyi> (raw)
In-Reply-To: <2EQQ8UJHXJLYT.2H2AM42MNPSXB@silby.fyi>

Hi all,

I just sent the below to tech@openbsd with a patch (snipped).

Evan Silberman <evan@jklol.net> wrote:
> .Xo/.Xc outside an .It header or a block-partial-implicit macro body seems to
> be a no-op on present mandoc and is not a documented use-case. ascii and
> html output are identical before and after.
> 
> If I'm wrong about the above in some way I will appreciate correction,
> as I am working on an mdoc(7) parser in another setting, and naturally
> mandoc(1) is my reference implementation and the OpenBSD manuals are my
> reference corpus.

I am crossposting here because I'm realizing that I don't actually
understand mdoc(7)'s documentation of what .Xo/.Xc are meant to do
outside the limited case of the .It header, and it seems more
appropriate to ask here.

mdoc(7) reads:

> Extend … the body of a partial-implicit block macro beyond the end of
> the input line.

My interpretation of this sentence was that these two snippets of markup
should be equivalent:
   
   .Dq hello, world

   .Dq hello, Xo
   world
   .Xc

It can easily be verified that this isn't true.

I can find no instances of .Xo outside of .It in OpenBSD's installed
manuals that really explain this usage to me. There are the cases where
.Xo (on a line by itself)/.Xc just wrap some other stuff, that as far as
I could tell were a no-op. The only other examples are from ksh.1, which
differ only in that .Xo comes at the end of a control line with some
other stuff in it. It seems to be a no-op there too. And it still
doesn't clearly demonstrate a particular association with a
block-partial-implicit macro.

   .Sm off
   .Ao Ar var Ac Xo
   .Aq Ar op
   .No = Aq Ar expr
   .Xc
   .Sm on

Finally, .Xo/.Xc is used in a couple mdoc regress tests for (it appears)
artificial reasons, to enclose an empty Fl macro with a block that
doesn't print anything special.

I searched for .Xo in the discuss@ archives and was not particularly
enlightened, beyond some evidence that .Xo/.Xc had some special
attention paid to it during mandoc's early days.

So, I am left with the question: what, if anything, is .Xo/.Xc meant to
do outside of an .It header? In mandoc, does it still actually do what
it's meant to do?

And either way, can a reasonably-accurate mdoc(7) parser just treat it
as a no-op?

thanks,
Evan Silberman
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


           reply	other threads:[~2024-09-25  0:18 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <2EQQ8UJHXJLYT.2H2AM42MNPSXB@silby.fyi>]

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=2UKLZW0DL8BSM.2IIO9W4HSUSRR@silby.fyi \
    --to=evan@jklol.net \
    --cc=discuss@mandoc.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).