On Mon, Jul 06, 2026 at 09:09:57PM +0000, Werner LEMBERG wrote:
>
> [texinfo.tex version 2026-07-04.10]
>
> Consider this example.
>
> ```
> \input texinfo
>
> foo @w{@c
> bar}
>
> @bye
> ```
>
> Compiling with `texi2pdf` aborts with
>
> ```
> Argument of @cxxx has an extra }.
> <inserted text>
> @par
> <to be read again>
> }
> l.4 bar}
> ```
>
> Is this expected?
Yes, that looks as expected. @w takes an argument delimited
by braces, so when its argument is read input is read producing
tokens up to the '}' character. These tokens have "category codes"
according to the settings at the time the @w is encountered - notably,
the end of line after @c produces a space token. @c takes its argument
on the line, which it does by changing the category code of newline so
that it can be used to delimit a macro argument. However, the characters
inside the braces have already been read and produced tokens. This is
why the argument reading for @c continues onto the next line (starting
with "bar"). TeX detects an error at the closing brace as it doesn't
accept macros taking arguments beyond the end of the current braced
group.
This is typical for line commands (like @c) used inside commands
taking arguments inside braces (like @w). It's only braced commands
that can take several paragraphs as an argument (like @footnote or
@caption) which can contain line commands, as far as I remember.