Subject: Re: bug#38164: quit-restore-window doesn't restore point in man

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 04 Apr 2021 19:13:01 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> Juri Linkov <[email-masked]> writes:
>
>> -            (quit-restore-window
>> -             (get-buffer-window Man-buffer t) 'kill)
>> +            (progn
>> +              (quit-restore-window
>> +               (get-buffer-window Man-buffer t) 'kill)
>> +              (select-window (old-selected-window)))
>
> The discussion then dealt mostly with general quit-restore-windows
> issues, but I think this patch should be applied, since it fixes an
> annoying problem in Man.  So I've now pushed it to Emacs 28.

This gives rise to the following regression:

0. emacs -Q
1. (setq Man-notify-method 'aggressive) C-x C-e
2. M-x man RET mythical RET

This used to pop up and very quickly hide a window (but that's a
separate issue), and then the echo area displayed:

  Can't find the mythical manpage

Whereas now the phantom window remains displayed much longer, the echo
area displays:

  error in process sentinel:
  Wrong type argument: window-live-p, #<window 8>

and the *Messages* buffer also contains:

  error in process sentinel:
  Man-bgproc-sentinel: Wrong type argument: window-live-p, #<window 8>

Ideally a non-existent manpage would result only in the "can't find"
message, without any inadvertent Lisp errors or window dances.

Thanks,

-- 
Basil