>> (defun next-error-quit-window () >> (when (and (eq current-prefix-arg 0) >> (not (eq next-error-last-buffer (current-buffer)))) >> (let ((window (get-buffer-window next-error-last-buffer))) >> (when (window-live-p window) >> (with-selected-window window >> (quit-restore-window window)))))) >> (add-hook 'next-error-hook 'next-error-quit-window) > > Since next-error-hook is a defcustom, perhaps we can/should include this > function as one of the advertised values in :type? > > Even if we keep the list nil by default. I completely forgot that we have 'next-error-found-function', so implemented it with 'next-error-hook'. I don't remember why we have both. Anyway, here is a patch with corrections from Martin: