/[emacs]/emacs/lisp/info-look.el
ViewVC logotype

Diff of /emacs/lisp/info-look.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by rms, Wed Oct 13 02:11:05 2004 UTC revision 1.43 by jurta, Sun Nov 7 20:52:51 2004 UTC
# Line 328  If optional argument QUERY is non-nil, q Line 328  If optional argument QUERY is non-nil, q
328           (modes (info-lookup->all-modes topic mode))           (modes (info-lookup->all-modes topic mode))
329           (window (selected-window))           (window (selected-window))
330           found doc-spec node prefix suffix doc-found)           found doc-spec node prefix suffix doc-found)
331      (if (or (not info-lookup-other-window-flag)      (if (not (eq major-mode 'Info-mode))
332              (eq (current-buffer) (get-buffer "*info*")))          (if (not info-lookup-other-window-flag)
333          (info)              (info)
334        (progn            (progn
335          (save-window-excursion (info))              (save-window-excursion (info))
336          ;; Determine whether or not the Info buffer is visible in              ;; Determine whether or not the Info buffer is visible in
337          ;; another frame on the same display.  If it is, simply raise              ;; another frame on the same display.  If it is, simply raise
338          ;; that frame.  Otherwise, display it in another window.              ;; that frame.  Otherwise, display it in another window.
339          (let* ((window (get-buffer-window "*info*" t))              (let* ((window (get-buffer-window "*info*" t))
340                 (info-frame (and window (window-frame window))))                     (info-frame (and window (window-frame window))))
341            (if (and info-frame                (if (and info-frame
342                     (display-multi-frame-p)                         (display-multi-frame-p)
343                     (memq info-frame (frames-on-display-list))                         (memq info-frame (frames-on-display-list))
344                     (not (eq info-frame (selected-frame))))                         (not (eq info-frame (selected-frame))))
345              (select-frame info-frame)                    (select-frame info-frame)
346            (switch-to-buffer-other-window "*info*")))))                  (switch-to-buffer-other-window "*info*"))))))
347      (while (and (not found) modes)      (while (and (not found) modes)
348        (setq doc-spec (info-lookup->doc-spec topic (car modes)))        (setq doc-spec (info-lookup->doc-spec topic (car modes)))
349        (while (and (not found) doc-spec)        (while (and (not found) doc-spec)
# Line 633  Return nil if there is nothing appropria Line 633  Return nil if there is nothing appropria
633   :mode 'c-mode :topic 'symbol   :mode 'c-mode :topic 'symbol
634   :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*"   :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*"
635   :doc-spec '(("(libc)Function Index" nil   :doc-spec '(("(libc)Function Index" nil
636                "^[ \t]+- \\(Function\\|Macro\\): .*\\<" "\\>")                "^[ \t]+-+ \\(Function\\|Macro\\): .*\\<" "\\>")
637               ("(libc)Variable Index" nil               ("(libc)Variable Index" nil
638                "^[ \t]+- \\(Variable\\|Macro\\): .*\\<" "\\>")                "^[ \t]+-+ \\(Variable\\|Macro\\): .*\\<" "\\>")
639               ("(libc)Type Index" nil               ("(libc)Type Index" nil
640                "^[ \t]+- Data Type: \\<" "\\>")                "^[ \t]+-+ Data Type: \\<" "\\>")
641               ("(termcap)Var Index" nil               ("(termcap)Var Index" nil
642                "^[ \t]*`" "'"))                "^[ \t]*`" "'"))
643   :parse-rule 'info-lookup-guess-c-symbol)   :parse-rule 'info-lookup-guess-c-symbol)
# Line 673  Return nil if there is nothing appropria Line 673  Return nil if there is nothing appropria
673                (lambda (item)                (lambda (item)
674                  (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item)                  (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item)
675                      (concat "@" (match-string 1 item))))                      (concat "@" (match-string 1 item))))
676                "`" "'")))                "`" "[' ]")))
677    
678  (info-lookup-maybe-add-help  (info-lookup-maybe-add-help
679   :mode 'm4-mode   :mode 'm4-mode
# Line 690  Return nil if there is nothing appropria Line 690  Return nil if there is nothing appropria
690               ("(autoconf)Autoconf Macro Index"               ("(autoconf)Autoconf Macro Index"
691                (lambda (item)                (lambda (item)
692                  (if (string-match "^A._" item) item (concat "AC_" item)))                  (if (string-match "^A._" item) item (concat "AC_" item)))
693                "^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>")                "^[ \t]+-+ \\(Macro\\|Variable\\): .*\\<" "\\>")
694               ;; M4 Macro Index entries are without "AS_" prefixes, and               ;; M4 Macro Index entries are without "AS_" prefixes, and
695               ;; mostly without "m4_" prefixes.  "dnl" is an exception, not               ;; mostly without "m4_" prefixes.  "dnl" is an exception, not
696               ;; wanting any prefix.  So AS_ is added back to upper-case               ;; wanting any prefix.  So AS_ is added back to upper-case
# Line 705  Return nil if there is nothing appropria Line 705  Return nil if there is nothing appropria
705                           (concat "AS_" item))                           (concat "AS_" item))
706                          (t                          (t
707                           (concat "m4_" item)))))                           (concat "m4_" item)))))
708                "^[ \t]+- Macro: .*\\<" "\\>")                "^[ \t]+-+ Macro: .*\\<" "\\>")
709               ;; Autotest Macro Index entries are without "AT_".               ;; Autotest Macro Index entries are without "AT_".
710               ("(autoconf)Autotest Macro Index" "AT_"               ("(autoconf)Autotest Macro Index" "AT_"
711                "^[ \t]+- Macro: .*\\<" "\\>")                "^[ \t]+-+ Macro: .*\\<" "\\>")
712               ;; This is for older versions (probably pre autoconf 2.5x):               ;; This is for older versions (probably pre autoconf 2.5x):
713               ("(autoconf)Macro Index" "AC_"               ("(autoconf)Macro Index" "AC_"
714                "^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>")                "^[ \t]+-+ \\(Macro\\|Variable\\): .*\\<" "\\>")
715               ;; Automake has index entries for its notes on various autoconf               ;; Automake has index entries for its notes on various autoconf
716               ;; macros (eg. AC_PROG_CC).  Ensure this is after the autoconf               ;; macros (eg. AC_PROG_CC).  Ensure this is after the autoconf
717               ;; index, so as to prefer the autoconf docs.               ;; index, so as to prefer the autoconf docs.
# Line 788  Return nil if there is nothing appropria Line 788  Return nil if there is nothing appropria
788               ;; Variables normally appear in nodes as just `foo'.               ;; Variables normally appear in nodes as just `foo'.
789               ("(emacs)Variable Index" nil "`" "'")               ("(emacs)Variable Index" nil "`" "'")
790               ;; Almost all functions, variables, etc appear in nodes as               ;; Almost all functions, variables, etc appear in nodes as
791               ;; " - Function: foo" etc.  A small number of aliases and               ;; " -- Function: foo" etc.  A small number of aliases and
792               ;; symbols appear only as `foo', and will miss out on exact               ;; symbols appear only as `foo', and will miss out on exact
793               ;; positions.  Allowing `foo' would hit too many false matches               ;; positions.  Allowing `foo' would hit too many false matches
794               ;; for things that should go to Function: etc, and those latter               ;; for things that should go to Function: etc, and those latter
795               ;; are much more important.  Perhaps this could change if some               ;; are much more important.  Perhaps this could change if some
796               ;; sort of fallback match scheme existed.               ;; sort of fallback match scheme existed.
797               ("(elisp)Index"          nil "^ - .*: " "\\( \\|$\\)")))               ("(elisp)Index"          nil "^ -+ .*: " "\\( \\|$\\)")))
798    
799  (info-lookup-maybe-add-help  (info-lookup-maybe-add-help
800   :mode 'lisp-interaction-mode   :mode 'lisp-interaction-mode
# Line 814  Return nil if there is nothing appropria Line 814  Return nil if there is nothing appropria
814   :ignore-case t   :ignore-case t
815   ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm>   ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm>
816   :doc-spec '(("(r5rs)Index" nil   :doc-spec '(("(r5rs)Index" nil
817                "^[ \t]+- [^:]+:[ \t]*" "\\b")))                "^[ \t]+-+ [^:]+:[ \t]*" "\\b")))
818    
819  (info-lookup-maybe-add-help  (info-lookup-maybe-add-help
820   :mode 'octave-mode   :mode 'octave-mode
821   :regexp "[_a-zA-Z0-9]+"   :regexp "[_a-zA-Z0-9]+"
822   :doc-spec '(("(octave)Function Index" nil   :doc-spec '(("(octave)Function Index" nil
823                "^ - [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)                "^ -+ [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)
824               ("(octave)Variable Index" nil "^ - [^:]+:[ ]+" nil)               ("(octave)Variable Index" nil "^ -+ [^:]+:[ ]+" nil)
825               ;; Catch lines of the form "xyz statement"               ;; Catch lines of the form "xyz statement"
826               ("(octave)Concept Index"               ("(octave)Concept Index"
827                (lambda (item)                (lambda (item)
# Line 829  Return nil if there is nothing appropria Line 829  Return nil if there is nothing appropria
829                   ((string-match "^\\([A-Z]+\\) statement\\b" item)                   ((string-match "^\\([A-Z]+\\) statement\\b" item)
830                      (match-string 1 item))                      (match-string 1 item))
831                   (t nil)))                   (t nil)))
832                nil; "^ - [^:]+:[ ]+" don't think this prefix is useful here.                nil; "^ -+ [^:]+:[ ]+" don't think this prefix is useful here.
833                nil)))                nil)))
834    
835  (info-lookup-maybe-add-help  (info-lookup-maybe-add-help
836   :mode 'maxima-mode   :mode 'maxima-mode
837   :ignore-case t   :ignore-case t
838   :regexp "[a-zA-Z_%]+"   :regexp "[a-zA-Z_%]+"
839   :doc-spec '( ("(maxima)Function and Variable Index" nil   :doc-spec '( ("(maxima)Function and Variable Index" nil
840                 "^ - [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)))                 "^ -+ [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)))
841    
842  (info-lookup-maybe-add-help  (info-lookup-maybe-add-help
843   :mode 'inferior-maxima-mode   :mode 'inferior-maxima-mode

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26