* lisp/man.el (Man-bgproc-sentinel): Ensure that we select the
correct previous window (bug#38164).
(when delete-buff
(if (window-live-p (get-buffer-window Man-buffer t))
- (quit-restore-window
- (get-buffer-window Man-buffer t) 'kill)
+ (progn
+ (quit-restore-window
+ (get-buffer-window Man-buffer t) 'kill)
+ ;; Ensure that we end up in the correct window.
+ (select-window (old-selected-window)))
(kill-buffer Man-buffer)))
(when message