bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a macro bug(?)


From: Dumas Patrice
Subject: a macro bug(?)
Date: Mon, 1 Sep 2003 12:04:40 +0200
User-agent: Mutt/1.4.1i

Hi,

This is a rather complicated bug report, because the issue happens only with
a complicated code.

I define the following container macro. It defined a first level macro which 
also defines another (second level) macro, and after that the first level 
macro calls the second level macro.
The objective of that curious construct is to append text to the second level
macro each time the container is called.

@c ===========================
@macro container
container
@unmacro firstlevel
@macro firstlevel {arg}
firstlevel body \\arg\\

@unmacro secondlevel
@macro secondlevel
\\arg\\
secondlevel body
@end macro
@end macro

@address@hidden
@end macro
@c ==========================

The second level macro is initially defined:
@c =========================
@macro secondlevel
initial secondlevel
@end macro
@c =========================

Then the container is called, but then secondlevel out of container is
unknown and another call of container shows an error of secondlevel unknown:

@c ==========================
@container

secondlevel out of container is unknown !
@secondlevel

@container
@c ==========================

Here is the makeinfo error message:

address@hidden tmp]$ /opt/data/src/texinfo-4.6/makeinfo/makeinfo --force -E 
bug_macros.macros bug_macros.texi
bug_macros.texi:31: Unknown command `secondlevel'.
bug_macros.texi:31: Misplaced {.
bug_macros.texi:31: Misplaced }.
bug_macros.texi:45: Unknown command `secondlevel'.
bug_macros.texi:45: Misplaced {.
bug_macros.texi:45: Misplaced }.
address@hidden tmp]$

The test file is attached.
I used the -E switch to generate a file with macros expanded and here is an
excerpt showing the issue:
===============================================================
container

firstlevel body initial secondlevel



secondlevel out of container is unknown !
@secondlevel{}
secondlevel body

container

firstlevel body @secondlevel{}
===============================================================


If I remove or comment out the line
\\arg\\
in the secondlevel macro definition, there is no error message and 
everything goes fine (but I don't get what I want...).

I am not really sure whether it is a bug or a feature, but I think that
kind of construct should be possible. Indeed, I found that bug because I 
wanted to use macros to define new @-commands for glossary.

Pat

Attachment: bug_macros.texi
Description: TeXInfo document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]