annotate lisp/oobr/eif-browse.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: eif-browse.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Eiffel source code browser.
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: oop, tools
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: 12-Dec-89
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
12 ;; LAST-MOD: 20-Sep-95 at 14:24:36 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 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Use 'eif-browse' to invoke the Eiffel browser. Prefix arg prompts for
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 '(br-start br br-eif br-eif-ft))
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 eif-browse (&optional env-file no-ui)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "Invoke the Eiffel OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 This allows browsing through Eiffel library and system class hierarchies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 With an optional prefix arg ENV-FILE equal to t, prompt for Environment file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 to 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 eif-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 eif-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 eif-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 eif-lib-search-dirs eif-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 (eif-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 eif-env-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (br-env-create eif-env-file eif-lang-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (or env-file (setq env-file eif-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 (eif-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 eif-env-file load-succeeded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 eif-sys-search-dirs br-sys-search-dirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 eif-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 "(eif-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 'eif-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 eif-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 eif-class-name-before (regexp-quote class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 eif-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 eif-browse-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 "Setup language-dependent functions for OO-Browser."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (br-setup-functions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (fset 'br-store-class-info 'eif-store-class-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (fset 'br-lang-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (cond ((or (featurep 'eiffel3) (featurep 'eiffel-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 'eiffel-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ((load "eiffel3" 'missing-ok 'nomessage)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (provide 'eiffel-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ((load "eiffel" 'missing-ok 'nomessage)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (provide 'eiffel-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (t 'fundamental-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (br-setup-constants))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (provide 'eif-browse)