Am 13.05.2011 um 12:57 schrieb Paul Isambert:

> LaTeX doesn't rely on pdfTeX anyway, so it shouldn't allow filenames with spaces and the behavior in LuaTeX shouldn't be troublesome.

Maybe that's indeed the simplest solution:

\def\document{
 \endgroup
 \IfJobnameContainsSpaces
  \errmessage{Don't to this}
 \endinput\fi
 ...
}