]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `info-display-manual' pop up the correct frame
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 9 Oct 2019 02:10:41 +0000 (04:10 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 9 Oct 2019 02:10:41 +0000 (04:10 +0200)
* lisp/info.el (info-display-manual): If the buffer is already in
a window, use that window (bug#20020).

lisp/info.el

index 02f3ea580b067f38d9e580509ba6365a658d8bad..fc0d58068a701bcf940956d4b137827a43ad1237 100644 (file)
@@ -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*")))))