tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Steffen Nurpmeso <sdaoden@yandex.com>
Cc: tech@mdocml.bsd.lv
Subject: Re: Corner case: mandoc doesn't require \& where it should
Date: Thu, 20 Nov 2014 03:21:34 +0100	[thread overview]
Message-ID: <20141120022134.GM28366@iris.usta.de> (raw)
In-Reply-To: <20141111215516.zZzO7O4M%sdaoden@yandex.com>

Hi Steffen,

Steffen Nurpmeso wrote on Tue, Nov 11, 2014 at 10:55:16PM +0100:

>   .Op Fl t Ar Sh | Ss
> 
> with mandoc you get
> 
>   mdocmx [-v] [-t Sh | Ss]
> 
> but with groff it is
> 
>   mdocmx [-v] [-t file ...
> 
> which is not nice but luckily it also echoes 
> 
>   Usage: .Sh not callable by other macros (#26)
> 
> which points out something correct since it really should be
> 
>   .Op Fl t Ar \&Sh | \&Ss
> 
> Really unfortunate is imho that -Tlint doesn't catch this.

This is harder than it may seem, the rules which macros are
parsed and callable have changed in the past (in particular
groff relaxed them), i'm not aware that what should happen
when the rules are violated was ever written down, and even
though the implementation of all this is not particularly
complicated, it is non-trivial by its shere size, both in
mandoc and groff.

For now, i have added a todo entry:

- warn about attempts to call non-callable macros
  Steffen Nurpmeso  Tue, 11 Nov 2014 22:55:16 +0100
  Note that formatting is inconsistent in groff.
  .Fn Po prints "Po()", .Ar Sh prints "file ..." and no "Sh".
  Relatively hard because the relevant code is scattered
  all over mdoc_macro.c and all subtly different.
  loc **  exist **  algo **  size **  imp **

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

      reply	other threads:[~2014-11-20  2:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 21:55 Steffen Nurpmeso
2014-11-20  2:21 ` Ingo Schwarze [this message]

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=20141120022134.GM28366@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=sdaoden@yandex.com \
    --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).