After reading (and searching through) TeXbyTopic.pdf I have the impression that practical use of \noexpand falls into one of the following three cases,
Inside
\edefor\xdef, including the cases where macros are defined so that they are used in the context of\edef, such as\def\protect{\noexpand\protect\noexpand}Inside
\writeand\message, including the case of movable texts in LaTeX- In the special construction
\if\noexpand#1\relax
Are there any other practical uses of \noexpand? Are there any practical use of \noexpand that is not in the expansion-only context, except for #3 listed above? I am new to plain and hope to understand plain better (especailly, the expansion-only context) by understanding various usages of \noexpand.
a\scantokens{b}cvs.a\scantokens{b\noexpand}c– Henri Menke Apr 08 '19 at 10:43\noexpandfor tricking TeX's reading apparatus into state S when having things re-tokenized by\scantokensand thus prevent the coming into being of a trailing space token. This is what is shown in the comment of Henri Menke. You can also use\noexpandfor neutralizing the circumstance that TeX takes ends of files for something that is similar to outer tokens. You might be interested in the discussion How does TeX handle EOF which took place in the usenet-newsgroup comp.text.tex in March 2008. – Ulrich Diez Apr 08 '19 at 11:29\noexpandhere. But you can as well use\relax:a\scantokens{b}c vs. a\scantokens{b\relax}c. Just something that puts TeX's reading apparatus into stats S (skipping blanks) so that the endline-character which gets inserted when\scantokens' re-tokenization-part is carried out won't get tokenized as a space-token. ;-) With\input/\@@inputand\scantokensand the like you can use\noexpandfor neutralizing the circumstance that TeX takes ends of files for something that is similar to an\outer-token. – Ulrich Diez Apr 08 '19 at 11:34\noexpandgenerally is useful for temporarily suppressing the\outer-property of macros that are defined in terms of\outer:\outer\def\bar{baz}and\expandafter\def\expandafter\foo\expandafter{\noexpand\bar}versus\outer\def\bar{baz}and\def\foo{\bar}. – Ulrich Diez Apr 08 '19 at 15:53\noexpandfor neutralizing the outerness of ends of files is obsolete. Please pardon me for not noticing this earlier. – Ulrich Diez Apr 08 '19 at 16:08