tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Jason McIntyre <jmc@kerhand.co.uk>
Cc: tech@mdocml.bsd.lv
Subject: Re: minor mdoc.7 improvements
Date: Sun, 28 Nov 2010 18:43:05 +0100	[thread overview]
Message-ID: <20101128174305.GB23201@iris.usta.de> (raw)
In-Reply-To: <20101128080507.GA4033@kerhand.co.uk>

Hi Jason,

> my point is that your description of Xo talks only in terms of using
> it for the It macro, but it can be used with many others.

OK, so lets try again.
Explaining it the other way round needs a bit more verbosity,
but i think it is worth spending the space because .Xo is
notoriously a source of confusion.

Yours,
  Ingo


Index: mdoc.7
===================================================================
RCS file: /cvs/src/share/man/man7/mdoc.7,v
retrieving revision 1.56
diff -u -r1.56 mdoc.7
--- mdoc.7	28 Nov 2010 15:45:26 -0000	1.56
+++ mdoc.7	28 Nov 2010 17:31:52 -0000
@@ -2659,9 +2659,60 @@
 Close a scope opened by
 .Sx \&Xo .
 .Ss \&Xo
-Open an extension scope.
-This macro originally existed to extend the 9-argument limit of troff;
-since this limit has been lifted, the macro has been deprecated.
+Extend the header of an
+.Sx \&It
+macro or the body of a partial-implicit block macro
+beyond the end of the input line.
+This macro originally existed to work around the 9-argument limit
+of historic
+.Xr roff 7 .
+.Pp
+Regarding partial-implicit block macros, this has never been very useful
+because it is almost always better to use the corresponding
+partial-explicit block macro when many, long or complex arguments
+are required.
+For example, rewrite awkward code like
+.Bd -literal -offset indent
+\&.Op Fl s Ar modifier Xo
+\&.Op Fl R Ar id
+\&.Xc
+.Ed
+.Pp
+to the clear and fully portable form
+.Bd -literal -offset indent
+\&.Oo
+\&.Fl s Ar modifier
+\&.Op Fl R Ar id
+\&.Oc
+.Ed
+.Pp
+Thus, the only sensible use for
+.Sx \&Xo
+has been in
+.Sx \&It
+lines, for example:
+.Bd -literal -offset indent
+\&.It Xo
+\&.No if Ar list ;
+\&.No then Ar list ;
+\&.Oo elif Ar list ;
+\&.No then Ar list ; Oc
+\&.No ...
+\&.Oo else Ar list ; Oc
+\&.No fi
+\&.Xc
+.Ed
+.Pp
+Since the 9-argument limit has been lifted, it is now possible to use 
+line continuation with a backslash at the end of the line instead;
+but remeber that such code is not portable to historic
+.Nm
+implementations:
+.Bd -literal -offset indent
+\&.It if Ar list ; No then Ar list ; \e
+    Oo elif Ar list ; No then Ar list ; Oc No ... \e
+    Oo else Ar list ; Oc No fi
+.Ed
 .Ss \&Xr
 Link to another manual
 .Pq Qq cross-reference .
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  parent reply	other threads:[~2010-11-28 17:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-27 22:27 Ingo Schwarze
     [not found] ` <20101127224144.GB27550@kerhand.co.uk>
2010-11-28  0:22   ` Ingo Schwarze
     [not found]     ` <20101128080507.GA4033@kerhand.co.uk>
2010-11-28 17:43       ` Ingo Schwarze [this message]
     [not found]         ` <20101129162316.GB4071@kerhand.co.uk>
2010-11-30 20:51           ` Ingo Schwarze

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=20101128174305.GB23201@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=jmc@kerhand.co.uk \
    --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).