discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Ft/Fn vs. parentheses weirdness
@ 2014-11-19 22:36 Thomas Klausner
  2014-11-20  0:36 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Klausner @ 2014-11-19 22:36 UTC (permalink / raw)
  To: discuss

[-- 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-20  0:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 22:36 Ft/Fn vs. parentheses weirdness Thomas Klausner
2014-11-20  0:36 ` Ingo Schwarze

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).