From 534783c526000a3320f1d4c0a42d26c39fff6bd0 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 9 Oct 2019 04:10:41 +0200 Subject: [PATCH] Make `info-display-manual' pop up the correct frame * lisp/info.el (info-display-manual): If the buffer is already in a window, use that window (bug#20020). --- lisp/info.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/info.el b/lisp/info.el index 02f3ea580b0..fc0d58068a7 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -5338,7 +5338,16 @@ completion alternatives to currently visited manuals." (setq found buffer blist nil)))) (if found - (switch-to-buffer found) + (let ((window (get-buffer-window found t))) + ;; If the buffer is already displayed in a window somewhere, + ;; then select that window (and pop its frame to the top). + (if window + (progn + (raise-frame (window-frame window)) + (select-frame-set-input-focus (window-frame window)) + (select-window window)) + (switch-to-buffer found))) + ;; The buffer doesn't exist; create it. (info-initialize) (info (Info-find-file manual) (generate-new-buffer-name "*info*")))))