the problem is in your definition of 'end' and 'bottom'
?? end := end of run bottom := bottom of last page, in this case
the real final thing is \end and \everygoodbye happens just before that (the only calls after it are postponed error messages, which have no consequence for any pdf and the primitive \end which is really needed)
yes, as I seen in \def\stoptext
of course there can be pending conditional branches that needs to be finished; just try \appendtoks\tracingall\to\everygoodbye
true
You can also do something
\startluacode table.insert(input.stop_actions, function() texio.write_nl("I still have no clue why you need it.") end) \stopluacode
ok thank you -- I like lua code --
any other hook in itself will introduce a new situation of 'something done before the real \end'
exactly what I mean:
"any other hook in itself will introduce a new situation of 'something done
before the real \end'"
that potentially can modify current page .
Consider this:
between
final_cleanup; {prepare for death}
and
end_of_TEX: close_files_and_terminate;
insert
{************* MY HACK ************}
almost_death ;{I see state, but it's 'frozen' so any modification will
never influence pdf or dvi , only to log or terminal or external files}
{*******************************************}
in almost_death you can do what ever you want -- you will never modify
(relevant part of ) state
that can influence final pdf or dvi .
==================================================
@ Now this is really it: \TeX\ starts and ends here.
The initial test involving |ready_already| should be deleted if the
\PASCAL\ runtime system is smart enough to detect such a ``mistake.''
@^system dependencies@>
@p begin @!{|start_here|}
history:=fatal_error_stop; {in case we quit during initialization}
t_open_out; {open the terminal for output}
if ready_already=314159 then goto start_of_TEX;
@