comparison lisp/oobr/eif-browse.el @ 0:376386a54a3c r19-14

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