On Tue, Feb 19, 2008 at 11:24:13PM +0000, Reuben Thomas wrote: > The .In in groff 1.19 has extended semantics: it behaves differently in > the SYNOPSIS from other sections. This is needed for some man pages, > e.g. libmagic(3).
As far as I can see, libmagic(3) only uses the previous semantics of .In; that is, it only uses it in SYNOPSIS. The main change in 1.19 was to suppress "#include " outside the SYNOPSIS section. > It would be nice if, absent having 1.19 in Debian, this macro could be > backported. I'd be happy to help if the maintainer agrees (declared > interest: I'm upstream in file!). Do you have another test case where it is interesting? I'm happy to backport it if so. Patch attached in case you'd like to test using it. Thanks, -- Colin Watson [EMAIL PROTECTED]
Index: debian/changelog =================================================================== --- debian/changelog (revision 2677) +++ debian/changelog (working copy) @@ -1,3 +1,12 @@ +groff (1.18.1.1-17) UNRELEASED; urgency=low + + * Backport from upstream: + - Make the mdoc .In macro parsed and callable. If not in the synopsis, + represent the C header file enclosed in angle brackets (closes: + #466614). + + -- Colin Watson <[EMAIL PROTECTED]> Wed, 20 Feb 2008 11:50:13 +0000 + groff (1.18.1.1-16) unstable; urgency=low * Install groff_mmse(7) under /usr/share/man/sv/ (LP: #76255). Index: tmac/doc.tmac =================================================================== --- tmac/doc.tmac (revision 2290) +++ tmac/doc.tmac (working copy) @@ -820,22 +820,64 @@ . . .\" NS In user macro -.\" NS #include statement - not callable +.\" NS #include statement in SYNOPSIS +.\" NS <header.h> if not in SYNOPSIS .\" NS .\" NS this function causes a break; it uses the `Fd' font .\" NS +.\" NS modifies: +.\" NS doc-arg-ptr +.\" NS doc-curr-font +.\" NS doc-curr-size +.\" NS doc-indent-synopsis +.\" NS doc-macro-name +.\" NS .\" NS width register `In' set in doc-common . .de In -. ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\ -. doc-do-func-decl -. nop \*[doc-Fd-font]#include <\$1> -. br -. ft \n[doc-curr-font] -. ps \n[doc-curr-size]u +. if !\n[doc-arg-limit] \{\ +. ie \n[.$] \{\ +. ds doc-macro-name In +. doc-parse-args \$@ +. \} +. el \ +. tm Usage: .In include_file ... (#\n[.c]) . \} +. +. if !\n[doc-arg-limit] \ +. return +. +. nr doc-arg-ptr +1 +. doc-print-prefixes +. ie ((\n[doc-arg-limit] >= \n[doc-arg-ptr]) & (\n[doc-type\n[doc-arg-ptr]] == 2)) \{\ +. nr doc-curr-font \n[.f] +. nr doc-curr-size \n[.ps] +. +. ie \n[doc-in-synopsis-section] \{\ +. ie "\*[doc-macro-name]"In" \{\ +. doc-do-func-decl +. nop \*[doc-Fd-font]#include <\*[doc-arg\n[doc-arg-ptr]]> +. ft \n[doc-curr-font] +. ps \n[doc-curr-size]u +. br +. nr doc-arg-ptr +1 +. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \ +. doc-print-recursive +. el \ +. doc-reset-args +. \} +. el \{\ +. ds doc-arg\n[doc-arg-ptr] "<\*[doc-Pa-font]\*[doc-arg\n[doc-arg-ptr]] +. as doc-arg\n[doc-arg-ptr] \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]> +. doc-print-recursive +. \}\} +. el \{\ +. ds doc-arg\n[doc-arg-ptr] "<\*[doc-Pa-font]\*[doc-arg\n[doc-arg-ptr]] +. as doc-arg\n[doc-arg-ptr] \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]> +. doc-print-recursive +. \}\} . el \{\ -. tm Usage: .In include_file -- In is not callable (#\n[.c]) +. tm Usage: .In include_file ... (#\n[.c]) . doc-reset-args . \} .. Index: tmac/groff_mdoc.man =================================================================== --- tmac/groff_mdoc.man (revision 2290) +++ tmac/groff_mdoc.man (working copy) @@ -1385,17 +1385,27 @@ .Pp The .Ql .In -.Li ( #include -statement) -macro is the short form of the above example. +macro, while in the +.Sx SYNOPSIS +section, represents the +.Li #include +statement, and is the short form of the above example. It specifies the C\~header file as being included in a C\~program. -It also causes a line break, and is neither callable nor parsed. +It also causes a line break. .Pp +While not in the +.Sx SYNOPSIS +section, it represents the header file enclosed in angle brackets. +.Pp .Dl Usage: .In Ao header file Ac .Pp .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n +.nr in-synopsis-section 1 .It Li ".In stdio.h" .In stdio.h +.nr in-synopsis-section 0 +.It Li ".In stdio.h" +.In stdio.h .El . .Ss "Function Types" Index: tmac/doc-common =================================================================== --- tmac/doc-common (revision 2290) +++ tmac/doc-common (working copy) @@ -101,7 +101,7 @@ .nr Ft 8n\" ? .nr Fx 1 .nr Ic 10n -.nr In 12n\" ? +.nr In 12n .nr It 8n\" ? .nr Lb 11n .nr Li 16n