0
|
1 ;;!emacs
|
|
2 ;;
|
|
3 ;; FILE: br-start.el
|
|
4 ;; SUMMARY: Select language and invoke OO-Browser.
|
|
5 ;; USAGE: GNU Emacs Lisp Library
|
|
6 ;; KEYWORDS: oop, tools
|
|
7 ;;
|
|
8 ;; AUTHOR: Bob Weiner
|
100
|
9 ;; ORG: InfoDock Associates
|
0
|
10 ;;
|
|
11 ;; ORIG-DATE: 5-Sep-92 at 23:31:03
|
120
|
12 ;; LAST-MOD: 9-Apr-97 at 00:16:58 by Bob Weiner
|
0
|
13 ;;
|
100
|
14 ;; Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
0
|
15 ;; See the file BR-COPY for license information.
|
|
16 ;;
|
|
17 ;; This file is part of the OO-Browser.
|
|
18 ;;
|
|
19 ;; DESCRIPTION:
|
|
20 ;; DESCRIP-END.
|
|
21
|
|
22 ;;; ************************************************************************
|
|
23 ;;; OO-Browser directory setting
|
|
24 ;;; ************************************************************************
|
|
25
|
|
26 ;; Defines (hyperb:path-being-loaded), which is used below.
|
|
27 ;; A Hyperbole directory, such as oobr/hypb, must either already be in
|
|
28 ;; load-path or an explicit load of "hversion" must have been
|
|
29 ;; done already or else the following line will fail to load hversion.
|
|
30 ;; This is all documented in the OO-Browser installation instructions.
|
|
31 (require 'hversion)
|
|
32
|
|
33 ;; Reinitialize br-directory on reload if initialization failed for any reason.
|
|
34 (and (boundp 'br-directory) (null br-directory) (makunbound 'br-directory))
|
|
35
|
|
36 (defvar br-directory (hyperb:path-being-loaded)
|
|
37 "Directory where the OO-Browser executable code is kept.
|
|
38 It must end with a directory separator character.")
|
|
39 (if (stringp br-directory)
|
|
40 (setq br-directory (file-name-directory br-directory))
|
|
41 (error
|
|
42 "(br-start.el): OO-Browser failed to set br-directory. Try setting it manually."))
|
|
43
|
|
44 (if (fboundp 'member)
|
|
45 (fset 'br-member 'member)
|
|
46 (defun br-member (elt list)
|
100
|
47 "Return non-nil if ELT is an element of LIST. Comparison done with `equal'.
|
0
|
48 The value is actually the tail of LIST whose car is ELT."
|
|
49 (while (and list (not (equal (car list) elt)))
|
|
50 (setq list (cdr list)))
|
|
51 list))
|
|
52
|
|
53 ;;; ************************************************************************
|
|
54 ;;; Other required Elisp libraries
|
|
55 ;;; ************************************************************************
|
|
56
|
|
57 ;; Add br-directory to load-path so other OO-Browser libraries can be found.
|
|
58 (or (br-member br-directory load-path)
|
|
59 (setq load-path (cons br-directory load-path)))
|
|
60
|
|
61 (load "br-vers")
|
|
62 (mapcar 'require '(br-init br-site))
|
|
63
|
|
64 ;;; ************************************************************************
|
|
65 ;;; Public functions
|
|
66 ;;; ************************************************************************
|
|
67
|
|
68 ;;; For backwards compatibility.
|
|
69 ;;;###autoload
|
|
70 (fset 'oobr 'oo-browser)
|
|
71
|
|
72 ;;;###autoload
|
|
73 (defun oo-browser (&optional same-env-flag)
|
|
74 "Prompt for an Environment and language over which to run the OO-Browser.
|
|
75 Optional prefix argument SAME-ENV-FLAG means browse the current Environment,
|
120
|
76 if any, without prompting. Otherwise, if called interactively, give the user
|
|
77 a choice whether to re-browse the last Environment or to browse a new one."
|
|
78 (interactive
|
|
79 (list (prog1
|
|
80 (if (and (not current-prefix-arg) br-env-file br-lang-prefix)
|
|
81 (y-or-n-p (format "(OO-Browser): Browse %s again? " br-env-file))
|
|
82 current-prefix-arg)
|
|
83 (message ""))))
|
0
|
84 (if (and same-env-flag br-env-file br-lang-prefix)
|
|
85 (funcall (intern-soft (concat br-lang-prefix "browse")))
|
|
86 (call-interactively 'br-env-browse)))
|
|
87
|
|
88 (provide 'br-start)
|