- (if (or (not info-lookup-other-window-flag)
- (eq (current-buffer) (get-buffer "*info*")))
- (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*")))))
+ (if (not (eq major-mode 'Info-mode))
+ (if (not info-lookup-other-window-flag)
+ (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))
+ (not (eq info-frame (selected-frame))))
+ (select-frame info-frame)
+ (switch-to-buffer-other-window "*info*"))))))