Index: doc/texinfo.tex =================================================================== --- doc/texinfo.tex (revision 6518) +++ doc/texinfo.tex (working copy) @@ -3,7 +3,7 @@ % 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} +\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, @@ -7460,7 +7460,9 @@ \def\macroargctxt{% used when scanning invocations \scanctxt - \catcode`\\=0 + \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" @@ -7907,16 +7909,75 @@ \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + address@hidden \catcode`\\=13 address@hidden@_=11 + +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. address@hidden@passargtomacro#1#2{% + @address@hidden + @address@hidden + @address@hidden@finish}% + @address@hidden + @address@hidden@relax + @address@hidden +} + address@hidden@look_ahead{% + @address@hidden@look_aheadzzz} address@hidden@look_aheadzzz{% + @address@hidden + @address@hidden@gobble_and_check_finish + @else + @address@hidden@add_segment + @address@hidden +} + +% double backslash found. add a single backslash here. address@hidden@gobble_and_check_finish#1{% + @add_the_backslash + @address@hidden + @address@hidden@add_segment +} + address@hidden@add_the_backslash{% + @address@hidden@address@hidden@address@hidden +} + address@hidden@add_segment#1\{% address@hidden@address@hidden + @address@hidden@call_the_macro% address@hidden + @address@hidden@look_ahead + % + % append to @arg_result + % token list registers might be better + @address@hidden@address@hidden + @address@hidden@address@hidden + @address@hidden@expandafter{% + @address@hidden + @pending_backslash#1}% + @address@hidden address@hidden@next} + address@hidden@address@hidden@address@hidden@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 just calls MAC itself. +% 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 - \else\macrolineargctxt\expandafter\parsearg + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\expandafter\parsearg \fi \macnamexxx}