> For historical reasons (and for compatibility with AT&T 'troff'), > the end macro exits as soon as it causes a page break and > no remaining data is in the partially collected line.
This isn't the only anomalous behavior at the end of a document. Since day one, troff has occasionally emitted a blank page at the end. I believe this is because a new page is triggered when the previous page is filled rather than when some output needs somewhere to go. A document that exactly fills the last page thus gets an extra page. Before jumping for a special fix for .em, you might like to consider the more general question of how a page gets initiated and/or when a trap gets sprung (upon reaching it or upon passing it?). Then .em might not need so much special pleading. In regard to the narrow issue of .em, what alternate fixes have you considered? For example, instead of exiting, .em might be required to do .rm em. Or the removal could be done automatically when .em is invoked. Under either regime, a user could even arrange for .em to be reinstated to accomplish a second coming--er, ending. Doug