discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Thomas Klausner <wiz@NetBSD.org>
To: discuss@mdocml.bsd.lv
Subject: Ft/Fn vs. parentheses weirdness
Date: Wed, 19 Nov 2014 23:36:36 +0100	[thread overview]
Message-ID: <20141119223636.GS12758@danbala.tuwien.ac.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]

Hi!

I wanted to mark up a function like this:

int (*foo)(bar, baz)

using Ft/Fn. I noticed that I can't really do that, and found some
weird behaviour both with groff 1.19.2 and mandoc 1.13.0 (the newest I
have installed).

Can you please take a look at the attached test page and tell me

* if there is a way to do what I want?

* how many bugs I found? :)

For the record, this is what it looks like for me with groff:
# groff -mandoc -T ascii test.3 |less
test.3:24: environment stack underflow
test.3:24: cannot chop empty macro
TEST(3)                 NetBSD Library Functions Manual                TEST(3)

NAME
     test -- test page

SYNOPSIS
     Some weird Fn/Ft test cases

DESCRIPTION
   Case 1
     int
     bar(void)
     Function gets formatted even though inside a Bd literal.

   Case 2
     int (*foo()) bar baz

     Parentheses are in weird places, arguments are not taken as function
     argument.

   Case 3
     int Po(*foo)
     ) bar baz

     Loses Fn completely due to Po/Pc.

   Case 4
     int (*foo)(bar, baz)

     This is what I wanted, but the parentheses are marked up in bold.

NetBSD 7.0                     November 19, 2014                    NetBSD 7.0

and mandoc:


# mandoc test.3 |less
TEST(3)                    Library Functions Manual                    TEST(3)

NAME
     test -- test page

SYNOPSIS
     Some weird Fn/Ft test cases

DESCRIPTION
   Case 1
     int
     bar(void)
     Function gets formatted even though inside a Bd literal.

   Case 2
     int (*foo()) bar(baz)

     Parentheses are in weird places, arguments are not taken as function
     argument.

   Case 3
     int (*foo) bar baz

     Loses Fn completely due to Po/Pc.

   Case 4
     int (*foo)(bar, baz)

     This is what I wanted, but the parentheses are marked up in bold.

NetBSD 7.99.1                  November 19, 2014                 NetBSD 7.99.1


Thanks,
 Thomas

[-- Attachment #2: test.3 --]
[-- Type: text/plain, Size: 543 bytes --]

.Dd November 19, 2014
.Dt TEST 3
.Os
.Sh NAME
.Nm test
.Nd test page
.Sh SYNOPSIS
Some weird Fn/Ft test cases
.Sh DESCRIPTION
.Ss Case 1
.Bd -literal
.Ft int
.Fn bar void
.Ed
Function gets formatted even though inside a Bd literal.
.Ss Case 2
.Ft int
.Fn ( *foo ) bar baz
.Pp
Parentheses are in weird places, arguments are not taken as
function argument.
.Ss Case 3
.Ft int
.Fn Po *foo Pc bar baz
.Pp
Loses Fn completely due to Po/Pc.
.Ss Case 4
.Ft int
.Fn (*foo) bar baz
.Pp
This is what I wanted, but the parentheses are marked up in bold.

             reply	other threads:[~2014-11-19 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 22:36 Thomas Klausner [this message]
2014-11-20  0:36 ` 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=20141119223636.GS12758@danbala.tuwien.ac.at \
    --to=wiz@netbsd.org \
    --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).