Stephen, `fit-window-to-buffer' seems broken in a number of regards. I'll eventually put condition-cases around the `enlarge-window' calls. Could you, so far, try whether the attached patch improves things. Thanks, martin.