annotate lisp/oobr/br-start.el @ 7:c153ca296910

Added tag r19-15b4 for changeset 27bc7f280385
author cvs
date Mon, 13 Aug 2007 08:47:16 +0200
parents 376386a54a3c
children 4103f0995bd7
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: br-start.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Select language and invoke OO-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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Motorola Inc.
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: 5-Sep-92 at 23:31:03
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 25-Oct-95 at 01:38:41 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; Copyright (C) 1992-19945 Free Software Foundation, Inc.
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 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; OO-Browser directory setting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; Defines (hyperb:path-being-loaded), which is used below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; A Hyperbole directory, such as oobr/hypb, must either already be in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; load-path or an explicit load of "hversion" must have been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; done already or else the following line will fail to load hversion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; This is all documented in the OO-Browser installation instructions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (require 'hversion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; Reinitialize br-directory on reload if initialization failed for any reason.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (and (boundp 'br-directory) (null br-directory) (makunbound 'br-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (defvar br-directory (hyperb:path-being-loaded)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 "Directory where the OO-Browser executable code is kept.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 It must end with a directory separator character.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (if (stringp br-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (setq br-directory (file-name-directory br-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "(br-start.el): OO-Browser failed to set br-directory. Try setting it manually."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (if (fboundp 'member)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (fset 'br-member 'member)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (defun br-member (elt list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 "Return non-nil if ELT is an element of LIST. Comparison done with 'equal'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 The value is actually the tail of LIST whose car is ELT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (while (and list (not (equal (car list) elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (setq list (cdr list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; Add br-directory to load-path so other OO-Browser libraries can be found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (or (br-member br-directory load-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (setq load-path (cons br-directory load-path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (load "br-vers")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (mapcar 'require '(br-init br-site))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;; For backwards compatibility.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (fset 'oobr 'oo-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defun oo-browser (&optional same-env-flag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 "Prompt for an Environment and language over which to run the OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Optional prefix argument SAME-ENV-FLAG means browse the current Environment,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 if any, without prompting."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (if (and same-env-flag br-env-file br-lang-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (funcall (intern-soft (concat br-lang-prefix "browse")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (call-interactively 'br-env-browse)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (provide 'br-start)