summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/man.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 1a82b120629..5ee60cae9f3 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -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