[not subscribed, please Cc, thanks.]

> Hi,

Haai,

"Ingo Schwarze" <[email protected]> wrote:
> just FYI:
>
> [email protected] wrote on Tue, Dec 17, 2019 at 08:10:10PM +0100:
>> jmc@ wrote:
>
>>> Dq produces "", so use either Dq or "".
>
>> Medoes it for consistency with cases like:
>>
>> .Vt "struct blaat" Va scaahp Ns Ic ";"
>>
>> where the quotes are part of the invocation syntax.
>
> Not really.
>
> The arguments of .Vt almost never need quoting, not even if there
> are other macros before or after it on the same input line.

*shrugs* To me, there is a real difference between "struct blaat" and
"struct" "blaat" (the latter would imply two separate types), but
obviously YMDV :)

In fact, it's an old peeve of mine that even when quoting the arguments,
the underlining in the output is not applied to the spaces.

> The usual way to quote punctuation is by prepending a zero-width
> space, so if you really wanted to talk about a command called ";",
> you would write: .Ic \&;

Me'll give that some thought, although me'll already argue that ";" is
(to me) a little more readable.

> But such a command would be weirdly named indeed, and appending
> an internal command to a variable name would make no sense either.

Well, what do you suggest? Just include C syntax elements as plain text?

> If "scaahp" is a global variable, the best way to mention it is
> simply
>
>  .Vt struct blaat scaahp ;

Except that scaahp is not a type, not a syntax element, but a variable:
we have Va for that.

> as documented in the mdoc(7) manual:
>
> https://man.openbsd.org/mdoc.7#Vt_2

Interesting. It would appear that both and Va and Vt have the capacity
for conflating type and variable names.

Unless me's seriously mistaken: the whole point of mdoc(7) is to not do
that kind of thing anymore.

> Note that the trailing semicolon is just punctuation, so it is
> actually important to *not* escape or quote it.

You suggest depending on the overlap between C and roff to handle the
semicolon properly? Or is memissing something?
 
> The forms
>
>  .Va struct blaat scaahp ;
>  .Vt struct blaat Va scaahp ;
>
> are also acceptable albeit less common.
> No quoting or escaping either way...

Strange, this would really seem to fly in the face of the idea behind
mdoc(7).

> Quoting with "" *is* needed in cases where it matters that two words
> are kept together in a single macro argument even though there is
> a space character between them in the source:
>
>  .Sh SYNOPSIS
>  .Ft double
>  .Fn sin "double x"
>
> But that certainly isn't needed for .Vt. Relatively few macros
> care, most prominently .Fa and .Fn.

Yet they might care one day. What if someone'd decide to make variable
type names appear in a different way from the variable names themselves?

Me'd hate the poor sod having to fix lots of manual pages *just* to get
a trivial change in the pretty-printing to work correctly.

It would make sense to presume that, when mdoc(7) was still new, the
implications of moving away from the "as long as it looks good on my
terminal" approach hadn't completely sunk in yet. But as it'll be 2020
in a matter of days, we really ought to either honor its basic ideas, or
come up with something better.  

The latter could take the form of a generic C pretty-printer that can be
called as a roff macro, and produces roff output.

> Yours,
> Ingo

Baai,

        --zeurkous.

-- 
Friggin' Machines!

Reply via email to