bug-texinfo
[Top][All Lists]
Advanced

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

Re: backslashes, macros, indexes, texinfo


From: Gavin Smith
Subject: Re: backslashes, macros, indexes, texinfo
Date: Tue, 11 Aug 2015 11:21:27 +0100

On 10 August 2015 at 21:11, David Kastrup <address@hidden> wrote:

> This would be Documentation/de/out-www/notation/repeats.texi, with the
> construct
>
> @warning{Wenn man @address@hidden innerhalb von @address@hidden
> notiert, ohne den @code{Voice}-Kontext explizit zu beginnen, erscheinen
> zusätzliche (ungewollte) Systeme.  Sie auch @rprogram{Ein zusätzliches System 
> erscheint}.}
>
> With the definitions
>
> @macro warning{TEXT}
> @quotation
> @quotation
> @cartouche
> @b{Note:} \TEXT\
> @end cartouche
> @end quotation
> @end quotation
> @end macro
>
> and (I think)
>
> @macro rprogram{TEXT}
> @vindex \TEXT\
> @ref{\TEXT\,,,usage,Application Usage}
> @end macro
>

@bs has to be defined for this to work, and @documentencoding UTF-8 is
also needed for this to break.

Here's where it goes wrong:

@arg ->Ein zusätzliches System address@hidden

<C3>->@UTFviiiTwoOctets <C3>

@UTFviiiTwoOctets #1#2->@expandafter @UTFviiiDefined @csname u8:address@hidden 
address@hidden
dcsname
#1<-<C3>
#2<-<A4>

@UTFviiiDefined #1->@ifx address@hidden @message address@hidden Unicode char 
@string #1
 not defined for address@hidden @expandafter address@hidden
#1<address@hidden:ä

@u8:ä ->@"a

@"#1->address@hidden "7F #1}
#1<-a

We'd changed the catcode of ^^c3 to 12, away from 13 (in
\setnonasciicharscatcodeglobal), but it is still being expanded.

When looking at the log file, I noticed a funny order of execution.
What was happening, was that the call to the inner macro was being
processed inside \eatspaces. This was bad news: the cat codes were
fixed when the argument to \eatspaces were read, and the cat code
changes for the argument to the inner macro were ineffectual.

This effect can even be seen with the current, official texinfo.tex:

\input texinfo
@setfilename

@macro Mac {ARG}
\ARG\
@end macro

@Mac{\\}

@address@hidden
@bye

In the second invocation, the backslashes are doubled, because the
catcode of \ was fixed as 13 when the argument to @code was read. In
the first, the catcode of \ is changed to 0 so the control sequence \\
is recognized, yielding a single backslash.

I don't have a solution to suggest yet.

Attachment: deutschu8.texi
Description: TeXInfo document


reply via email to

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