This is such a mess...
Take a look at the error locating lines in the log file produced from the following plain TeX file: The last error message can actually be considered correct, even though it is startling. In addition to the \endlinechar mess, it is disconcerting that ^^xx-like sequences in control sequence names get clobbered into something different in the top error context line but not in the second one. Some shortcuts in tex.web appear to be at fault here. Probably the main problem here is that Knuth chose not to copy control sequence names somewhere else while they are being assembled, but rather do the lookups/hash entries straight from the input buffer, if necessary, transforming the input buffer into something else on the way. Maybe it would be saner to copy the stuff out, either into a separate buffer, or to a designated free area at the end of the buffer area (like \csname does). Maybe it is possible to do this just conditionally when the control sequence name either has ^^ stuff in it, _or_ if it hits a buffer boundary (with the patch I am currently devising). But it maybe would not be expensive to copy always and use a dedicated buffer for the purpose of \cs assembly. Whatever. Still hunting through the TeX code. -- David Kastrup
participants (1)
-
David Kastrup