(outline-minor-mode): Use define-minor-mode.
[bpt/emacs.git] / lisp / info-look.el
index df4cfad..e39adb3 100644 (file)
@@ -3,8 +3,7 @@
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
-;; Author: Ralph Schleicher <rs@purple.UL.BaWue.DE>
-;; Maintainers: FSF (unless Schleicher can be found)
+;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org>
 ;; Keywords: help languages
 
 ;; This file is part of GNU Emacs.
@@ -333,8 +332,18 @@ If optional argument QUERY is non-nil, query for the help mode."
     (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)
@@ -361,7 +370,7 @@ If optional argument QUERY is non-nil, query for the help mode."
                      (re-search-forward
                       (concat prefix (regexp-quote item) suffix))
                      (goto-char (match-beginning 0))
-                     (and window-system info-lookup-highlight-face
+                     (and (display-color-p) info-lookup-highlight-face
                           ;; Search again for ITEM so that the first
                           ;; occurence of ITEM will be highlighted.
                           (re-search-forward (regexp-quote item))
@@ -761,7 +770,8 @@ Return nil if there is nothing appropriate in the buffer near point."
 (info-lookup-maybe-add-help
  :mode 'octave-mode
  :regexp "[_a-zA-Z0-9]+"
- :doc-spec '(("(octave)Function Index" nil "^ - [^:]+:[ ]+" nil)
+ :doc-spec '(("(octave)Function Index" nil 
+             "^ - [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)
             ("(octave)Variable Index" nil "^ - [^:]+:[ ]+" nil)
             ;; Catch lines of the form "xyz statement"
             ("(octave)Concept Index"