I'm now reading the source code of LaTeX.
In the definition of verbatim environment (\@verbatim, exactly), there is something like
\everypar \expandafter{\the\everypar \unpenalty}
What does this \expandafter do?
I only know that \expandafter can delay expansion like
\expandafter\def\csname test-cmd\endcsname
But what will happen if the token after \expandafter is a }?
\everyparis a token list register, so you need to delay the expansion of the brace in order to append material to it. You find detailed explanations here (about\everypar) and here (about\expandafter{). – campa Aug 23 '17 at 06:57}? – stone-zeng Aug 23 '17 at 09:31\foois usually assigned by\foo{some token list}. The opening brace so to say "starts" the assignment mechanism. Here we want to append something to the token list, so we need to freeze the assignment mechanism until the token list is expanded. The closing brace is of course necessary in order to mark the end of the assignment. – campa Aug 23 '17 at 09:55\everypar=\bgroup Hello\egroupwill raise an error. Is it a mechanism on TeX level? – stone-zeng Aug 23 '17 at 10:06@name) The closing brace must be explicit. – campa Aug 23 '17 at 13:46