On 15 August 2015 at 19:13, David Kastrup <[email protected]> wrote:
> ./usage.texi:46: ==> Fatal error occurred, no output PDF file produced!
> Transcript written on usage.log.
> /usr/bin/texi2dvi: pdfetex exited with bad status, quitting.
>
I believe that I broke the patch with a last-second tidy-up that I
thought would be harmless. Here's another patch. The only difference
should be that the line
@let@finish=@relax
is changed to
@def@finish{@finish}%
*** texinfo.tex 2015-08-15 18:45:11.000000000 +0100
--- texinfo.tex-BSMACRO 2015-08-15 20:38:31.000000000 +0100
***************
*** 3,9 ****
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
! \def\texinfoversion{2015-08-03.11}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
--- 3,9 ----
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
! \def\texinfoversion{2015-08-03.11-bsmacro}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
***************
*** 7343,7353 ****
}
\fi
- % Used to remove a category 13 newline, added to the end of the last
- % line read in by \scantokens.
- {\catcode`\^^M=13 \gdef\gobblecr^^M{}}
-
- % Argument is macro body with arguments substituted
\def\scanmacro#1{\begingroup
\newlinechar`\^^M
\let\xeatspaces\eatspaces
--- 7343,7348 ----
***************
*** 7362,7375 ****
% ... and for \example:
\spaceisspace
%
! \ifnum\catcode`\^^M=5
! % The \empty here causes a following catcode 5 newline to be eaten as
! % part of reading whitespace after a control sequence.
! \scantokens{#1\empty}%
! \else
! \catcode`\^^M=13
! \scantokens{#1\gobblecr}%
! \fi
\endgroup}
\def\scanexp#1{%
--- 7357,7371 ----
% ... and for \example:
\spaceisspace
%
! % The \empty here causes a following catcode 5 newline to be eaten as
! % part of reading whitespace after a control sequence. It does not
! % eat a catcode 13 newline. There's no good way to handle the two
! % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
! % would then have different behavior). See the Macro Details node in
! % the manual for the workaround we recommend for macros and
! % line-oriented commands.
! %
! \scantokens{#1\empty}%
\endgroup}
\def\scanexp#1{%
***************
*** 7464,7470 ****
\def\macroargctxt{% used when scanning invocations
\scanctxt
! \catcode`\\=0
}
% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
% for the single characters \ { }. Thus, we end up with the "commands"
--- 7460,7468 ----
\def\macroargctxt{% used when scanning invocations
\scanctxt
! \catcode`\ =\other
! \catcode`\\=\active
! %\catcode`\\=0
}
% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
% for the single characters \ { }. Thus, we end up with the "commands"
***************
*** 7911,7926 ****
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
% \braceorline MAC is used for a one-argument macro MAC. It checks
% whether the next non-whitespace character is a {. It sets the context
% for reading the argument (slightly different in the two cases). Then,
! % to read the argument, in the whole-line case, it then calls the
! % regular \parsearg MAC; in the lbrace case, it just calls MAC itself.
%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
! \ifx\nchar\bgroup\macroargctxt
! \else\macrolineargctxt\expandafter\parsearg
\fi \macnamexxx}
--- 7909,7986 ----
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+ {\catcode`\@=0 \catcode`\\=13
+ @catcode`@_=11
+
+ @tracingmacros=2
+ @errorcontextlines=100
+
+ % Call #1 with a list of tokens #2, with any doubled backslashes in #2
+ % compressed to one.
+ @gdef@passargtomacro#1#2{%
+ @def@the_macro{#1}%
+ @def@pending_backslash{}%
+ @def@finish{@finish}%
+ @def@arg_result{}%
+ @let@next_token=@relax
+ @add_segment#2\@finish\%
+ }
+
+ @gdef@look_ahead{%
+ @futurelet@next_token@look_aheadzzz}
+ @gdef@look_aheadzzz{%
+ @ifx@next_token\%
+ @let@next=@gobble_and_check_finish
+ @else
+ @let@next=@add_segment
+ @fi@next
+ }
+
+ % double backslash found. add a single backslash here.
+ @gdef@gobble_and_check_finish#1{%
+ @add_the_backslash
+ @def@pending_backslash{}%
+ @futurelet@next_token@add_segment
+ }
+
+ @gdef@add_the_backslash{%
+ @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}%
+ }
+
+ @gdef@add_segment#1\{%
+ @ifx@next_token@finish
+ @let@next=@call_the_macro%
+ @else
+ @let@next=@look_ahead
+ %
+ % append to @arg_result
+ % token list registers might be better
+ @expandafter@expandafter@expandafter@gdef
+ @expandafter@expandafter@expandafter@arg_result
+ @expandafter@expandafter@expandafter{%
+ @expandafter@arg_result
+ @pending_backslash#1}%
+ @def@pending_backslash{\}%
+ @fi@next}
+
+ @gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}}
+
+ }
+
% \braceorline MAC is used for a one-argument macro MAC. It checks
% whether the next non-whitespace character is a {. It sets the context
% for reading the argument (slightly different in the two cases). Then,
! % to read the argument, in the whole-line case, it then calls the regular
! % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
! \ifx\nchar\bgroup
! \macroargctxt
! \expandafter\passargtomacro
! \else
! \macrolineargctxt\expandafter\parsearg
\fi \macnamexxx}