Hi all, while working on a custom pretty printer, I was having the need to keep some state variables for the duration of one buffer, and reset them again for the next buffer. With the current hooks a pretty printer has available, this is not possible, since you never know what the first and last lines are. The attached patch adds two new hooks, begin_of_buffer and end_of_buffer, which will be called when typing a buffer or a file (e.g. \typebuffer or \typefile). They are not called for typing a phrase (e.g. \type). Is this patch acceptable for inclusion? Gr. Matthijs