I'm using a process_input_buffer callback to look at lines read from LuaLaTeX input before passing them on to TeX, to be processed as »verbatim« text (code and command examples). There are some lines in the input that I don't want to pass to TeX at all. If I return »nil«, then TeX gets the original line (as the documentation says). If I return an empty string, an empty line results in the TeX output, which I don't want. How can I arrange for the callback to throw the line away altogether without passing anything on to TeX?
(One obvious approach would be to read all of the example into a buffer and then simply cut out the undesired stuff before passing the complete buffer on to TeX, en bloc. This doesn't work for me due to other considerations.)
The idea is that in an environment like
\begin{example}
# foo
bar
baz
\end{example}
the »#« line should not be passed to TeX but the other lines should. (In the real world, the »#« line is somewhat more complicated but is being processed on the Lua side of things.)
(In the meantime, I found a workaround such that I'm basically inserting a control-B character in front of the »#« on the Lua side, and declaring ^^B to be the fancyvrb »commentchar«, which causes anything after a ^^B, including the newline, to be ignored. I'd still be interested to see whether there is a simpler method.)