Is it possible to define such two macros \start_recording: and \stop_recording:, so that everything between them can be saved (possibly verbatimly) to \the_recording_tl, and when applying \the_recording_tl one can obtain again those contents in the document?
This is almost the same demand as in this question. But I am expecting something clever with expl3, which is merely mentioned there.
The motivation of this question is that I would like to save the content of some environments (for example the abstract and proofs) and show them later. In an old package, I did this by using fancyvrb's VerbatimOut environment to write them to auxiliary files and read them in later (see, e.g. this answer). However, this approach seems to be quite messy and it has the side effect that contents on the same line with \start_recording: will sometimes lead to errors or lost of data.
scontentspackage: it does (if I understood) exactly what you want – Phelype Oleinik Feb 07 '22 at 00:17expl3is great for programming logic. For a lot of catcode trickery, using traditional LaTeX interfaces is probably more convenient. I don't see why thexparsesolution doesn't work for now. – Alan Xiang Feb 07 '22 at 05:13expl3guide, it really helps a lot for a beginner. – Jinwen Feb 07 '22 at 05:44