annotate lisp/oobr/info-brows.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 4103f0995bd7
children 4be1180a9e89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: info-brows.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Support routines for Info inheritance browsing and error parsing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: docs, help, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
9 ;; ORG: Motorola Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 7-Dec-89
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
12 ;; LAST-MOD: 20-Sep-95 at 14:33:33 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
14 ;; Copyright (C) 1989-1995 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; See the file BR-COPY for license information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; This file is part of the OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
21 ;; Use 'info-browse' to invoke the Info OO-Browser. Prefix arg prompts for
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; name of Environment file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (mapcar 'require '(info br-start br br-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defun info-browse (&optional env-file no-ui)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "Invoke the Info OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 This allows browsing through Info library and system class hierarchies. With
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 an optional non-nil prefix argument ENV-FILE, prompt for Environment file to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 use. Alternatively, a string value of ENV-FILE is used as the Environment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 file name. See also the file \"br-help\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (let ((same-lang (equal br-lang-prefix info-lang-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (load-succeeded t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 same-env)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (if same-lang
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; Save other language Environment in memory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (if br-lang-prefix (br-env-copy nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (setq br-lang-prefix info-lang-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 *br-save-wconfig* nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (setq same-env (or (equal info-env-file env-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (and (null env-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (or info-lib-search-dirs info-sys-search-dirs))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; Continue browsing an Environment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ((and same-env same-lang))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ((and same-env (not same-lang))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (info-browse-setup) (br-env-copy t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; Create default Environment file specification if needed and none
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (t (or env-file (file-exists-p info-env-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (br-env-create info-env-file info-lang-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (or env-file (setq env-file info-env-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; Start browsing a new Environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (info-browse-setup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (setq load-succeeded (br-env-init env-file same-lang nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (if load-succeeded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (setq *br-save-wconfig* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 info-env-file load-succeeded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 info-sys-search-dirs br-sys-search-dirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 info-lib-search-dirs br-lib-search-dirs))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (cond (load-succeeded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (br-init)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (or no-ui (br-browse)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (no-ui nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (t (message "(info-browse): You must build the Environment to browse it.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; Don't filter Environment classes when listed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (fset 'info-class-list-filter 'identity)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defun info-class-definition-regexp (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 "Return regexp to uniquely match the definition of CLASS name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (concat info-class-name-before (regexp-quote class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 info-class-name-after))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;;; Internal functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (defun info-find-nd-name ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (let ((end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (skip-chars-forward info-identifier-chars)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (skip-chars-backward info-identifier-chars)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (skip-chars-forward " \n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (buffer-substring (point) end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defun info-browse-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 "Setup language-dependent functions for OO-Browser."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (br-setup-functions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; Use this until an info function is implemented for the language.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (fmakunbound 'br-insert-class-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (fset 'br-store-class-info 'info-store-class-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (fset 'br-lang-mode 'Info-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (fset 'br-find-class-name 'info-find-nd-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (br-setup-constants))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (provide 'info-browse)