annotate lisp/oobr/br-start.el @ 164:4e0740e5aab2

Added tag r20-3b8 for changeset 0132846995bd
author cvs
date Mon, 13 Aug 2007 09:43:39 +0200
parents cca96a509cfe
children
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
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
9 ;; ORG: InfoDock Associates
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: 5-Sep-92 at 23:31:03
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
12 ;; LAST-MOD: 9-Apr-97 at 00:16:58 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
14 ;; Copyright (C) 1992, 1993, 1994, 1997 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 ;; 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)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
47 "Return non-nil if ELT is an element of LIST. Comparison done with `equal'.
0
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,
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
76 if any, without prompting. Otherwise, if called interactively, give the user
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
77 a choice whether to re-browse the last Environment or to browse a new one."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
78 (interactive
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
79 (list (prog1
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
80 (if (and (not current-prefix-arg) br-env-file br-lang-prefix)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
81 (y-or-n-p (format "(OO-Browser): Browse %s again? " br-env-file))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
82 current-prefix-arg)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 100
diff changeset
83 (message ""))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (if (and same-env-flag br-env-file br-lang-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (funcall (intern-soft (concat br-lang-prefix "browse")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (call-interactively 'br-env-browse)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (provide 'br-start)