Another approach to limiting a buffer's size is to define a minor mode
that does such by adjoining a trim-function to after-change-functions.
This does not require any process-output hooks; indeed it should work
for buffers in most any major mode.
-Bill Dubuque