changeset 30348:2dc989936987

(info-lookup): If *info* is shown in another frame on the same display, select that frame, instead of switching to the Info buffer in another window of the selected frame.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 20 Jul 2000 20:35:27 +0000
parents a8a6780670ad
children 84ec7df649a9
files lisp/info-look.el
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info-look.el	Thu Jul 20 20:35:05 2000 +0000
+++ b/lisp/info-look.el	Thu Jul 20 20:35:27 2000 +0000
@@ -332,8 +332,18 @@
     (if (or (not info-lookup-other-window-flag)
 	    (eq (current-buffer) (get-buffer "*info*")))
 	(info)
-      (save-window-excursion (info))
-      (switch-to-buffer-other-window "*info*"))
+      (progn
+	(save-window-excursion (info))
+	;; Determine whether or not the Info buffer is visible in
+	;; another frame on the same display.  If it is, simply raise
+	;; that frame.  Otherwise, display it in another window.
+	(let* ((window (get-buffer-window "*info*" t))
+	       (info-frame (and window (window-frame window))))
+	  (if (and info-frame
+		   (display-multi-frame-p)
+		   (memq info-frame (frames-on-display-list)))
+	    (select-frame info-frame)
+	  (switch-to-buffer-other-window "*info*")))))
     (while (and (not found) modes)
       (setq doc-spec (info-lookup->doc-spec topic (car modes)))
       (while (and (not found) doc-spec)