4 ;; SUMMARY: Support routines for Info inheritance browsing and error parsing.
5 ;; USAGE: GNU Emacs Lisp Library
6 ;; KEYWORDS: docs, help, hypermedia
11 ;; ORIG-DATE: 7-Dec-89
12 ;; LAST-MOD: 10-May-01 at 12:52:49 by Bob Weiner
14 ;; Copyright (C) 1989-1995, 1997 BeOpen.com
15 ;; See the file BR-COPY for license information.
17 ;; This file is part of the OO-Browser.
21 ;; Use `info-browse' to invoke the Info OO-Browser. Prefix arg prompts for
22 ;; name of Environment file.
26 ;;; ************************************************************************
27 ;;; Other required Elisp libraries
28 ;;; ************************************************************************
30 (mapcar 'require '(info br-start br br-info))
32 ;;; ************************************************************************
34 ;;; ************************************************************************
37 (defun info-browse (&optional env-file no-ui)
38 "Invoke the Info OO-Browser.
39 This allows browsing through Info library and system class hierarchies. With
40 an optional non-nil prefix argument ENV-FILE, prompt for Environment file to
41 use. Alternatively, a string value of ENV-FILE is used as the Environment
42 file name. See also the file \"br-help\"."
44 (let ((same-lang (equal br-lang-prefix info-lang-prefix))
49 ;; Save other language Environment in memory
50 (if br-lang-prefix (br-env-copy nil))
51 (setq br-lang-prefix info-lang-prefix
52 *br-save-wconfig* nil))
53 ;; `same-env' non-nil means the new Env is the previous Env or the most
54 ;; recent previous Env of the same language as the new Env
55 (setq same-env (or (equal info-env-file env-file)
57 (or info-lib-search-dirs info-sys-search-dirs))))
60 ;; If we just switched languages, restore the cached data for the new
62 (if same-lang nil (br-env-copy t))
63 ;; Environment may appear to be the same but its loading may have
64 ;; been interrupted, so ensure all variables are initialized properly.
65 (info-browse-setup env-file)
66 (if (or (null br-paths-htable) (equal br-paths-htable br-empty-htable))
68 (br-env-try-load (or env-file br-env-file) br-env-file))))
71 ;; Create default Environment file specification if needed and none
74 (t (or env-file (file-exists-p info-env-file)
75 (br-env-create info-env-file info-lang-prefix))
76 (or env-file (setq env-file info-env-file))
78 ;; Start browsing a new Environment.
80 (info-browse-setup env-file)
81 (setq load-succeeded (br-env-init env-file same-lang nil))
83 (setq *br-save-wconfig* nil
84 info-env-file br-env-file
85 info-env-name br-env-name
86 info-sys-search-dirs br-sys-search-dirs
87 info-lib-search-dirs br-lib-search-dirs))))
92 (or (and same-lang same-env) (br-refresh))))
94 (t (message "(info-browse): You must build the Environment to browse it.")))))
96 ;; Don't filter Environment classes when listed.
97 (defalias 'info-class-list-filter 'br-class-list-identity)
99 (defun info-class-definition-regexp (class)
100 "Return regexp to uniquely match the definition of CLASS name."
101 (concat info-class-name-before (regexp-quote class)
102 info-class-name-after))
104 ;;; ************************************************************************
105 ;;; Internal functions
106 ;;; ************************************************************************
108 (defun info-find-nd-name ()
111 (skip-chars-forward info-identifier-chars)
113 (skip-chars-backward info-identifier-chars)
114 (skip-chars-forward " \n\r")
115 (br-buffer-substring (point) end))))
117 (defun info-browse-setup (env-file)
118 "Setup language-dependent functions for OO-Browser."
120 (defalias 'br-lang-mode 'Info-mode)
121 (defalias 'br-find-class-name 'info-find-nd-name)
122 (br-setup-constants env-file))
124 (provide 'info-browse)