]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak how Man selects the previous window on failure
authorJuri Linkov <juri@linkov.net>
Mon, 21 Sep 2020 13:05:55 +0000 (15:05 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Sep 2020 13:06:00 +0000 (15:06 +0200)
* lisp/man.el (Man-bgproc-sentinel): Ensure that we select the
correct previous window (bug#38164).

lisp/man.el

index 1a82b12062976336efcadf8f038e37d23dc45801..5ee60cae9f3d60dd05d646a6c3b07e2ea3999c1c 100644 (file)
@@ -1508,8 +1508,11 @@ manpage command."
 
       (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