annotate lisp/oobr/br.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 376386a54a3c
children 131b0175ea99
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.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Browse object-oriented code.
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: matching, 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
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
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: 12-Dec-89
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
12 ;; LAST-MOD: 21-Feb-97 at 16:45:11 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
14 ;; Copyright (C) 1989-1996 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 ;;; Other required Elisp libraries
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 (require 'br-lib)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defvar br-c-tags-flag t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 "*Non-nil means add C constructs when building C-based language Environments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defvar br-directory nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 "Directory in which OO-Browser executable and help files are kept.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (defconst br-feature-signature-regexp "[:|,]"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 "Regular expression that matches a feature signature but not a class name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defvar br-inherited-features-flag t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "*If non-nil (the default), feature/element listings include all inherited features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 If nil, only those features lexically included within a class are shown.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (defvar br-inhibit-version nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "*Personal setting which if non-nil, skips version/credit information upon startup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 The default should be left as nil, since new users may find this helpful.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defvar br-invert-ancestors nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 "*Personal setting which if non-nil makes ancestors appear as do other inheritance listings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 That is, parents appear above children, rather than the default, which is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 reverse.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (defvar br-keep-viewed-classes nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 "*Personal setting which if non-nil means leave all viewed classes around for later selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Non-nil deletes last viewed class when a new one is displayed. Note this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 does not affect classes displayed for editing, all such classes are left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 around.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (defconst br-min-width-window 25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 "*Minimum width of a browser class list window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 This together with the frame width determines the number of such windows.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
64 ;; -f treats upper and lower case the same in sorting, also makes `a' sort
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
65 ;; list before `[a]', so default classes appear at the end of the list,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; typically.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;; -u leaves only unique elements in the sorted list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defvar br-sort-options "-fu"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "*String of options to send to the operating system `sort' command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Use nil for none. This is used by the OO-Browser (br-order) command only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 under Emacs 18.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;;; Public macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (if (fboundp 'window-highest-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defun br-non-listing-window-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "Is the selected window a non-OO-Browser listing window?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; Top of window is not at top of frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (not (window-highest-p (selected-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defun br-non-listing-window-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 "Is the selected window a non-OO-Browser listing window?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; Top of window is not at top of frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (/= (nth 1 (window-edges)) br-top-of-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (if (fboundp 'window-highest-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (defun br-listing-window-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 "Is the selected window an OO-Browser listing window?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (window-highest-p (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defun br-listing-window-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "Is the selected window an OO-Browser listing window?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; Top of window is at top of frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (= (nth 1 (window-edges)) br-top-of-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (defun br-browse ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 "Internally invoke the OO-Browser, for browsing class hierarchies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 Use \\[br-help] and \\[br-help-ms] for help on browser usage."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;; If not already in the browser, save window config.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (if (br-in-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (setq *br-prev-wconfig* (current-window-configuration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 br-in-browser (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; If were previously in the browser, restore its saved window config,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;; otherwise, set up from scratch.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (if *br-save-wconfig*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (set-window-configuration *br-save-wconfig*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (br-window-setup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (if br-inhibit-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (br-top-classes t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (br-version)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
117 (message "Press {h} for help; use {C-c #} to see version and credits again.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ;; Display all classes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (br-top-classes t)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
120 (message "Press {h} for help; use {C-c #} to see version and credits again.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; Wait for 60 seconds or until a single key sequence is given.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (sit-for 60)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (message ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (br-help))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (run-hooks 'br-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (intern (concat "br-" br-lang-prefix "mode-hook")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (defun br-add-class-file (&optional class-path lib-table-p save-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "Add a file of classes to the current Environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 Interactively or when optional CLASS-PATH is nil, CLASS-PATH defaults to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 current buffer file pathname. If optional LIB-TABLE-P is non-nil, add to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 Library Environment, otherwise add to System Environment. If optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 SAVE-FILE is t, the Environment is then stored to the filename given by
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
135 `br-env-file'. If SAVE-FILE is non-nil and not t, its string value is used
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 as the file to which to save the Environment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (list (read-file-name (concat "Class file name to add"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (concat " (default \""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (file-name-nondirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "\")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ": ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 nil buffer-file-name t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (y-or-n-p "Add to Library, rather than System tables? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (y-or-n-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (concat "Save tables after addition to " br-env-file "? "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (or class-path (setq class-path buffer-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (if (not (if class-path (file-readable-p class-path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (error "(br-add-class-file): %s is not readable" class-path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (let* ((paths-parents-cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (let ((br-view-file-function 'br-insert-file-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (br-get-classes-from-source class-path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (classes (car paths-parents-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (parents (cdr paths-parents-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (paths-key class-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (path-htable (br-get-htable (if lib-table-p "lib-paths" "sys-paths")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (par-htable (br-get-htable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (if lib-table-p "lib-parents" "sys-parents")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (child-htable (br-get-children-htable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (br-add-to-paths-htable class paths-key path-htable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (lambda (parent-cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (hash-add (car parent-cons) (cdr parent-cons) par-htable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 parents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (br-env-set-htables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (let ((child) (par-list) children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (lambda (parent-cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (setq child (cdr parent-cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 par-list (car parent-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (lambda (parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq children (hash-get parent child-htable))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (or (br-member child children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (hash-add (cons child children) parent child-htable))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 par-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 parents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (cond ((eq save-file nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ((eq save-file t) (br-env-save))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ((br-env-save save-file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (defun br-ancestors (&optional arg features-flag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 "Display ancestor tree whose root is the current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 With optional prefix ARG, display all ancestor trees whose roots are in the
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
194 current listing. If ARG = -1 or `br-invert-ancestors' is t, the current
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 class ancestry tree is inverted. That is, it shows branches going down
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 towards the root class, so that parents appear above children. If ARG < -1 or
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
197 `br-invert-ancestors' is t and ARG > 1, then the ancestry trees of all
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 classes in the current listing are inverted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 Optional second argument, FEATURES-FLAG non-nil means display features under
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 each ancestor class."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (or arg (setq arg 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (if br-invert-ancestors (setq arg (- arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (let* ((class-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (if (and (/= arg 1) (/= arg -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (br-this-level-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (list (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (parents (delq nil (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (lambda (c) (br-get-parents c)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 class-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (cond ((or parents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (and features-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (if (/= 1 (length class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 t ;; Assume some class will have features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;; This class must have features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (br-list-features (car class-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (if (and (/= arg 1) (/= arg -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (message "Computing %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (if features-flag "features" "ancestors")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (if features-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (br-next-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (let ((child-level (br-buffer-level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (br-next-listing-window -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (br-next-buffer (concat "p" child-level))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (cond ((>= arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (br-ancestor-trees-inverted class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (br-ancestor-trees class-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (if (and (/= arg 1) (/= arg -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (message "Computing %s...Done"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (if features-flag "features" "ancestors")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (message "No %s." (if features-flag "features" "ancestors"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (beep)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (defun br-at (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 "Display current class location in the inheritance graph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 The class is displayed among both its ancestors and descendants.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 With optional prefix ARG, display location for all classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (let* ((parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (parent-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (br-this-level-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (list (setq parent (br-find-class-name))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (message "Computing class locations...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (br-narrow-to-class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (br-next-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (br-descendant-trees (br-ancestor-roots parent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (message "Computing class locations...Done")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (re-search-forward (concat "\\(^\\|[ \t]+\\)" parent "$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (goto-char (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (recenter '(4))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (defun br-categories (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 "Display categories directly associated with the current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 This does not include any categories which the class inherits.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 With optional prefix ARG, display categories of all classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (let ((has-categories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 class-list categories class-and-categories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (setq class-list (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (message "Computing class categories...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (br-this-level-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (list (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 categories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (setq class-and-categories (br-list-categories class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 has-categories (or has-categories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 class-and-categories))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (cons class class-and-categories)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (cond ((not class-list)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
291 (message "(OO-Browser): Apply `br-categories' to a class.") (beep))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ((not has-categories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (message "No class categories.") (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (br-next-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (let (buffer-read-only done-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (lambda (class-and-categories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (setq class (car class-and-categories))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (if (not (br-set-cons done-set class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (insert class " ...\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ;; Class successfully added to set, so it has not been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ;; listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (insert class "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (br-insert-features (cdr class-and-categories) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 categories))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (message "Computing class categories...Done")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (defun br-children (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 "Display children of current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 With optional prefix ARG, display children of all the classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (let ((class-list (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (message "Computing children...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (br-this-level-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (list (br-find-class-name)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (has-children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 children children-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (setq children-list (delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (lambda (parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (setq children
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (br-get-children parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 has-children
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (or has-children children))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (cons parent children)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (cond ((not children-list)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
335 (message "(OO-Browser): Apply `br-children' to a class.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ((not has-children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (message "No children.") (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (br-next-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (let (buffer-read-only done-set parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (lambda (parent-children-cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (setq parent (car parent-children-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (if (not (br-set-cons done-set parent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (insert parent " ...\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 ;; Class successfully added to set, so it has not been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 ;; listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (insert parent "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (br-insert-classes (cdr parent-children-cons) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 children-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (if arg (message "Computing children...Done"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (defun br-class-stats (&optional prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 "Display statistics summary for current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 Optional prefix arg PROMPT means prompt for class name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (let ((class-name (if prompt (br-complete-class-name) (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (if class-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (message "Class %s: Parents: %d; Children: %d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 class-name (length (br-get-parents class-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (length (br-get-children class-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (error "No class name at point."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (defun br-cmd-help (key &optional full)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 "Show first line of doc for OO-Browser KEY in minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 With optional FULL, display full documentation for command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (interactive "kOO-Browser key binding: \nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (let* ((cmd (let ((cmd (if (eq major-mode 'br-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (lookup-key br-mode-map key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (key-binding key))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (if (not (integerp cmd)) cmd)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (doc (and cmd (documentation cmd)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (end-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (if doc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (or full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (setq end-line (string-match "[\n]" doc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 doc (substitute-command-keys (substring doc 0 end-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (setq doc (format "No documentation for {%s} %s" key (or cmd ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (if (and cmd doc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (if full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (other-window -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (describe-function cmd))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (message doc)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (defun br-count ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 "Count number of entries visible in current listing buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 Print text result in minibuffer when called interactively."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (let ((cnt (count-lines (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (message "%s contains %d entries." (buffer-name) cnt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 cnt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (defun br-copyright ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 "Display browser copyright information in viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (br-file-to-viewer "BR-COPY"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (defun br-delete (&optional prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 "Delete class from current Environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 Does not alter descendency relations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 Optional prefix arg PROMPT means prompt for class name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (let ((class (if prompt (br-complete-class-name) (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (and class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (y-or-n-p (concat "Delete class " class " from Environment? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (progn (br-real-delete-class class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ;; Delete class name at point in listing window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (or prompt (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (progn (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (delete-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (point) (progn (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (message "Class " class " deleted.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (defun br-descendants (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 "Display descendant tree whose root is the current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 With optional prefix ARG, display all descendant trees whose roots are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 the classes in the current listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (let ((parent-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (br-this-level-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (list (br-find-class-name)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (cond ((delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (function (lambda (parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (br-get-children parent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 parent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (if arg (message "Computing descendants..."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (br-next-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (br-descendant-trees parent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (if arg (message "Computing descendants...Done"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (message "No descendants.") (beep)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (defun br-edit-entry (&optional prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 "Edits source for any browser listing entry, such as a class or a feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 Optional prefix arg PROMPT means prompt for entry name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (let ((entry) (sig))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (if prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (cond ((and (setq entry (br-complete-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (string-match br-feature-signature-regexp entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (if (setq sig (car (br-feature-signature-and-file entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (br-feature nil nil sig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (error "(br-feature-signature-and-file): Couldn't find match for: '%s'" entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (entry ;; class name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (br-edit nil entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (t (error "(br-complete-entry): Exited without selecting a match")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (cond ((br-find-feature-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (br-feature))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 ((and (setq entry (br-find-class-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (br-class-in-table-p entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (br-edit nil entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (t (error "(OO-Browser): No entry for current line in current Environment"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (defun br-edit (&optional prompt class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 "Edit a class in the viewer window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 Select viewer window. With optional prefix arg PROMPT, prompt for class
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
472 name. Optional CLASS is the one to edit. Return t if class is displayed or
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
473 sent to an external viewer, else nil."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (or br-editor-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (br-in-view-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (setq *br-prev-listing-window* (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (br-view prompt t class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (defun br-edit-ext (editor-cmd file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 "Invoke a non-standard EDITOR-CMD on FILE.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
482 See also `br-editor-cmd'."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (interactive "fFile to edit: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (or editor-cmd (setq editor-cmd br-editor-cmd))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (if (not (stringp editor-cmd)) ;; must be a Lisp function that takes a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 ;; single, file arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (funcall editor-cmd file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (setq delete-exited-processes t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (let ((proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (name (concat br-ed-name br-ed-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (setq br-ed-num (1+ br-ed-num)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 proc (br-edit-ext-start editor-cmd name file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (if proc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (process-kill-without-query proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (message "(OO-Browser): Could not start external edit process: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 editor-cmd)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (defun br-editor-kill ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 "Kill all current external editor sub-processes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (if (br-kill-process-group br-ed-name br-ed-num "external editors")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (setq br-ed-num 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (defun br-entry-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 "Display attributes of the current entry in the viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (if (fboundp 'br-insert-class-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (let ((class-name (br-find-class-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (if class-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (progn
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
513 (message "Building `%s' class info..." class-name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
514 (sit-for 2)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (br-store-class-info class-name)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
516 (message "Building `%s' class info...Done" class-name)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (br-funcall-in-view-window
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
518 (concat br-buffer-prefix-info "Info*")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 'br-insert-class-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (error "Move point to a class name line.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (message "No class information function for this language.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (defun br-exit-level (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 "Return to prefix ARGth previous inheritance level listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 The command is ignored with ARG < 1."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (setq arg (or arg 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (let ((prev-wind-buf-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (if (null *br-level-hist*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (and (> arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (message "No previous level to which to exit.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (while (and (> arg 0) *br-level-hist*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (br-next-buffer (br-listing-window-num) br-buffer-prefix-blank)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (setq prev-wind-buf-line (car *br-level-hist*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 *br-level-hist* (cdr *br-level-hist*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 arg (1- arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (select-window (car prev-wind-buf-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (switch-to-buffer (car (cdr prev-wind-buf-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 ;; Position window lines exactly as before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (recenter (car (cdr (cdr prev-wind-buf-line)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (defun br-feature (&optional arg view-only ftr-sig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 "Edit a feature in the viewer window. Select viewer window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 With optional prefix ARG, prompt for feature name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 Optional VIEW-ONLY non-nil means view rather than edit feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 Optional FTR-SIG is signature of feature to edit."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (or ftr-sig
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (setq ftr-sig (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (br-feature-complete 'must-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 ;; Get current feature signature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (br-feature-get-signature))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (if (null ftr-sig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (error "(br-feature): No definition for this entry")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (if (br-feature-found-p (br-feature-file ftr-sig) ftr-sig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (if view-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (progn (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (br-to-from-viewer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (if (file-writable-p (buffer-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (setq buffer-read-only nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 ;; Feature not found. Return to original window and signal an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (br-to-from-viewer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (error "(br-feature): Can't find definition of: '%s'" ftr-sig))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (defun br-features (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 "Display features/elements of the current class (prefix ARG = 1) or of the current listing if ARG is other than 0 or 1.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
572 With ARG = 0, the value of the variable, `br-inherited-features-flag', is
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 toggled and no other action is taken.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
575 If `br-inherited-features-flag' is t, all features of each class are shown.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 If nil, only lexically included features are shown and if the features of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 single class are requested and none are defined, the class definition is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 displayed so that its feature declarations may be browsed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (cond ((and (integerp arg) (= arg 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (setq br-inherited-features-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (not br-inherited-features-flag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (message "Inherited features/elements will %sbe shown."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (if br-inherited-features-flag "" "not ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (br-inherited-features-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (br-inherited-features arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (t (br-lexical-features arg))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (defun br-find (element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 "Interactively complete class or ELEMENT name and jump to its definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 Return ELEMENT or signal an error."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (interactive (list (br-complete-entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (if (and element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (if (not (br-in-view-window-p)) (br-to-from-viewer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (if (string-match br-feature-signature-regexp element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (br-find-feature element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (br-find-class element))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 element
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
600 (error "(OO-Browser): `%s' definition not found." element)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (defun br-help (&optional file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 "Display browser operation help information in viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (or file (setq file "br-help"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (br-file-to-viewer file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (br-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (use-local-map nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 (message ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (defun br-help-ms ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 "Display browser mouse usage help information in viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (br-help "br-help-ms"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (defun br-implementors (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 "Display hierarchy of classes that define current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 Ignore inherited elements. With optional prefix ARG, display implementors of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 all elements in the current listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 (let
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ((child-level (br-buffer-level))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (ftr-list (if arg (br-set-of-strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 (sort (br-this-level-features) 'string-lessp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 ;; Need this check to avoid trying to find implementors of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ;; a class which happens to have an attached element tag,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ;; e.g. in an implementors listing buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 (if (looking-at br-feature-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (list (br-find-feature-entry)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (if (or (null ftr-list) (null (car ftr-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (error
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
637 "(OO-Browser): `br-implementors' must be applied to a feature.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (message "Computing implementors...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (br-next-listing-window -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (br-next-buffer (concat "p" child-level))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (let ((buffer-read-only) (implementor-tags) (classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (lambda (ftr-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (setq implementor-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (br-feature-implementors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (br-feature-name ftr-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 'string-lessp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 classes (mapcar 'br-feature-tag-class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 implementor-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (insert ftr-entry "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (setq start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (br-insert-classes classes 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (br-feature-put-signatures implementor-tags))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 ftr-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (goto-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (message "Computing implementors...Done"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (defun br-inherited-features (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 "Display class features, including those from ancestors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 With optional prefix ARG, display features of all classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (let ((br-ancestor-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (lambda (class repeated-class indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (if repeated-class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (br-insert-features (br-list-features class indent) indent))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (br-ancestors arg t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 (defun br-kill ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 "Kill buffer in viewer window and redisplay help text."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (br-do-in-view-window '(progn (kill-buffer nil) (br-help))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (defun br-lexical-features (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 "Display class features lexically defined within current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 With numeric prefix ARG, display features of all classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 If the features of a single class are requested and there are no feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 definitions for the class, display the class definition so that its feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 declarations may be browsed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (let ((has-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 class-list features class-and-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (setq class-list (cond ((and (integerp arg) (/= arg 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (message "Computing class features...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (br-this-level-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (list (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (setq class-and-features (br-list-features class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 has-features (or has-features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 class-and-features))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (cons class class-and-features)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (cond ((not class-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (beep)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
710 (message "(OO-Browser): Apply `br-features' to a class."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 ((not has-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (if (and (= (length class-list) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (br-class-path (car class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (if (br-view nil nil (car class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 "No feature definitions, browse declarations instead."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (message "No class features.") (beep)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (br-next-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (let (buffer-read-only done-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (lambda (class-and-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (setq class (car class-and-features))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (if (not (br-set-cons done-set class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (insert class " ...\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 ;; Class successfully added to set, so it has not been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 ;; listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (insert class "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (br-insert-features (cdr class-and-features) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (message "Computing class features...Done")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (goto-char (point-min)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (defun br-lib-rebuild ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 "Rescan Library components of the current Environment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (if (call-interactively 'br-build-lib-htable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (br-top-classes t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (defun br-lib-top-classes (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 "Display list of top level Library classes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 With prefix ARG, display all Library classes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (and (or (not (interactive-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (br-in-top-buffer-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (y-or-n-p "Exit to top-level class listing buffer? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (br-show-top-classes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (function (lambda () (br-all-classes "lib")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (message "Listing of all Library classes"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (br-show-top-classes 'br-get-lib-top-classes 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (message "Listing of top-level Library classes")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (setq *br-level-hist* nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (defun br-match (&optional expr arg again matched)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 "Show all class names in current Environment that contain optional EXPR.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 Nil value of EXPR means prompt for a value. With optional prefix ARG, EXPR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 is treated as a string. By default, it is treated as a regular expresion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 AGAIN non-nil shows the number of classes MATCHED from the last search,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 allowing repeated narrowing of the search set. Empty EXPR when AGAIN is nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 matches to all classes in the Environment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (interactive (list nil current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (or expr (setq expr (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (concat (if again (format "(%s matches) " matched))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 "Find Environment class string matches"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 "Find Environment class regular expression matches")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
772 (if again " (RET to end): " ": ")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (if (and again (equal expr ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (let* ((match-expr (if arg (regexp-quote expr) expr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (classes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (lambda (cl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (if (string-match match-expr cl) cl)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (if again
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (sort (br-this-level-classes) 'string-lessp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (br-all-classes))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (setq classes (br-class-list-filter classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (if classes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (progn (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (br-feature-clear-signatures)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (br-insert-classes classes 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (br-match nil arg t (br-count)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (message "No matches for \"%s\"." expr)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (defun br-match-entries (&optional expr arg again matched)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 "Show all entries in current listing that contain optional EXPR.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 Nil value of EXPR means prompt for a value. With optional prefix ARG, EXPR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 is treated as a string. By default, it is treated as a regular expresion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 AGAIN non-nil means show the number of entries MATCHED from last search,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 allowing repeated narrowing of the search set. Empty EXPR when AGAIN is nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 matches to all entries in the listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (interactive (list nil current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (or expr (setq expr (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (concat (if again (format "(%s matches) " matched))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 "Find string matches in listing"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 "Find regular expression matches in listing")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
808 (if again " (RET to end): " ": ")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (if (and again (equal expr ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (let* ((match-expr (if arg (regexp-quote expr) expr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (buffer-read-only))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (if (not (re-search-forward match-expr nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (progn (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (message "No matches for \"%s\"." expr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (delete-non-matching-lines match-expr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (br-match-entries nil arg t (br-count))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (defun br-next-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 "Move point vertically down prefix ARG number of lines in listing buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (let ((end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (setq end (= (forward-line arg) arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (and (looking-at "^$") (forward-line -1) (setq end t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 (and end (message "No next entry.") (beep))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (defun br-order (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 "Order current browser listing window entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 With prefix ARG other than 1 (the default), don't remove leading space from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 entry lines before ordering. Negative ARG means order in descending Ascii
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 sequence, otherwise order in ascending sequence."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (setq arg (or arg 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (message "Ordering entries...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (let ((buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 sort-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 (and (= arg 1) (progn (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (while (re-search-forward "^[ \t]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 (replace-match ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (if (string-match "^19\\." emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 ;; Emacs 19: This slower than calling an external sort but it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 ;; maintains the element tags in a listing, allowing further browsing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 ;; from this buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (sort-lines (< arg 0) (point-min) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 ;; Move [default] classes to the end of the sorted list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (if (re-search-forward "^[ \t]*\\[" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (let (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (setq start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (re-search-backward "^[ \t]*\\[" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (append-to-buffer (current-buffer) start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (delete-region start end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 ;; Emacs 18: We can't maintain the buffer tags, so we just use a fast
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 ;; external sort.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (setq sort-args (list (point-min) (point-max) "sort" t t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 sort-args (if (< arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (if (stringp br-sort-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (nconc sort-args (list "-r" br-sort-options))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (nconc sort-args (list "-r")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (if (stringp br-sort-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (nconc sort-args (list br-sort-options))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 sort-args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (apply 'call-process-region sort-args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (message "Ordering entries...Done"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (defun br-parents (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 "Display parents of current class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 With optional prefix ARG, display parents of all the classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 (let ((class-list (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (message "Computing parents...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (br-this-level-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (list (br-find-class-name)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (has-parents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 parents parents-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (setq parents-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (delq nil (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (setq parents (br-get-parents class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 has-parents (or has-parents parents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (cons class parents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 (cond ((not parents-list)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
897 (message "(OO-Browser): Apply `br-parents' to a class.") (beep))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 ((not has-parents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 (message "No parents.") (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (let ((child-level (br-buffer-level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (br-next-listing-window -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (br-next-buffer (concat "p" child-level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 (let (buffer-read-only done-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 (lambda (class-parents-cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (setq class (car class-parents-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (if (not (br-set-cons done-set class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (insert class " ...\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 ;; Class successfully added to set, so it has not been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 ;; listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 (insert class "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (br-insert-classes (cdr class-parents-cons) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 parents-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 (if arg (message "Computing parents...Done"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 (defun br-prev-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 "Move point vertically up prefix ARG number of lines in listing buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (setq arg (- arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 (and (= (forward-line arg) arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 (message "No previous entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 (beep)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 (defun br-protocols (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 "Display protocols to which the current class conforms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 This does not include any protocols which the class inherits from its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 ancestors but it does include protocols which conform to other protocols.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 With optional prefix ARG, display protocols of all classes in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 (let ((has-protocols)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 class-list protocols class-and-protocols)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (setq class-list (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 (message "Computing class protocols...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 (br-this-level-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 (list (br-find-class-name)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 (if (and (= (length class-list) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 (br-protocol-entry-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 ;; If on a protocol entry, display its definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (br-view-protocol (car class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 ;; Otherwise, list protocols for all elements of class-list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (setq protocols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (delq nil (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (setq class-and-protocols (br-list-protocols class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 has-protocols (or has-protocols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 class-and-protocols))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (cons class class-and-protocols)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 class-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (cond ((not class-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (beep)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
959 (message "(OO-Browser): Apply `br-protocols' to a class."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 ((not has-protocols)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (message "No class protocols.") (beep))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (br-add-level-hist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (br-next-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (let (buffer-read-only done-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (lambda (class-and-protocols)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (setq class (car class-and-protocols))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (if (not (br-set-cons done-set class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (insert class " ...\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 ;; Class successfully added to set, so it has not been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 ;; listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (insert class "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (br-insert-features (cdr class-and-protocols) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 protocols))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (message "Computing class protocols...Done")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (goto-char (point-min)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (defun br-quit (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 "Quit browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 With optional prefix ARG, delete window configurations and listing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 buffers associated with the browser."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (if (not (br-in-browser))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (br-interrupt arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (if (null arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (setq *br-save-wconfig* (current-window-configuration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (if (featurep 'br-tree) (br-tree-kill))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (br-viewer-kill)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 ;; Too dangerous to include (br-editor-kill) here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 ;; The user can invoke it manually if desired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (and *br-prev-wconfig* (set-window-configuration *br-prev-wconfig*))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (br-interrupt arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (defun br-refresh ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 "Restore OO-Browser to its state upon startup."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (br-window-setup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (br-top-classes t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (br-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (setq br-in-browser (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 (defun br-report-bug ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 "Send a message to the OO-Browser discussion list."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (if (br-in-browser) (br-to-view-window))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1009 (hmail:compose "oo-browser@infodock.com" '(hypb:configuration)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (defun br-sys-rebuild ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 "Rescan System components of the current Environment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (if (call-interactively 'br-build-sys-htable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (br-top-classes t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 (defun br-sys-top-classes (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 "Display list of top level System classes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 With prefix ARG, display all System classes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 (and (or (not (interactive-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (br-in-top-buffer-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 (y-or-n-p "Exit to top-level class listing buffer? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (br-show-top-classes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (function (lambda () (br-all-classes "sys")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (message "Listing of all System classes"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (br-show-top-classes 'br-get-sys-top-classes 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (message "Listing of top-level System classes")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 (setq *br-level-hist* nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (defun br-to-from-viewer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 "Move point to viewer window or back to last recorded listing window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (if (br-in-view-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 (progn (if *br-prev-listing-window*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (select-window *br-prev-listing-window*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 (other-window 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 (setq *br-prev-listing-window* nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (br-to-view-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (defun br-toggle-c-tags ()
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1046 "Toggle the value of the `br-c-tags-flag' flag."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 (setq br-c-tags-flag (not br-c-tags-flag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (message "C constructs will %sbe added to C-based language Environments."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 (if br-c-tags-flag "" "not ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (defun br-toggle-keep-viewed ()
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1053 "Toggle the value of the `br-keep-viewed-classes' flag."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (setq br-keep-viewed-classes (not br-keep-viewed-classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (message "Viewed classes will no%s be kept after use."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (if br-keep-viewed-classes "w" "t")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (defun br-top-classes (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 "Display list of top level classes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 With prefix ARG, display all Environment classes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (and (or (not (interactive-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (br-in-top-buffer-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 (y-or-n-p "Exit to top-level class listing buffer? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 (cond (arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (br-show-top-classes 'br-all-classes 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 (message "Listing of all Environment classes"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (br-show-top-classes 'br-get-top-classes 'uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (message "Listing of top-level classes")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 (setq *br-level-hist* nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (defun br-unique ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 "Eliminate adjacent duplicate entry names from the current listing window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 If two adjacent entries look the same one is eliminated, even if they refer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 to different class elements."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 (let ((buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (again t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 first second)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (setq first (br-feature-current))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 (while again
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 (setq again (= (forward-line 1) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 second (br-feature-current))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 (if (not (string-equal first second))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (setq first second)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (delete-region (point) (progn (forward-line 1) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 ;; back up to first line again
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (goto-char (point-min))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (defun br-version ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 "Display browser version number and credits."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (br-funcall-in-view-window
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1099 (concat br-buffer-prefix-info "Help*")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 (function (lambda ()
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1101 (insert-file-contents (br-pathname "BR-VERSION"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1102 (hypb:display-file-with-logo)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 (if (re-search-forward "<VERSION>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 (replace-match br-version t t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (center-line)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1106 (set-buffer-modified-p nil)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (defun br-view-entry (&optional prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 "Displays source for any browser listing entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 Optional prefix arg PROMPT means prompt for entry name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (let ((entry) (sig))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (if prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (cond ((and (setq entry (br-complete-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (string-match br-feature-signature-regexp entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 (if (setq sig (car (br-feature-signature-and-file entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (br-feature nil 'view sig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 (error "(br-feature-signature-and-file): Couldn't find match for: '%s'" entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (entry ;; class name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (br-view nil nil entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 (t (error "(br-complete-entry): Exited without selecting a match")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 (cond ((br-find-feature-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (br-feature nil 'view))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 ((and (setq entry (br-find-class-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 (br-class-in-table-p entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 (br-view nil nil entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (t (error "(OO-Browser): Entry may be referenced but not defined in the Environment."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 (defun br-view (&optional prompt writable class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 "Displays class file in viewer window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 Optional prefix arg PROMPT means prompt for class name. Non-nil WRITABLE means
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 allow editing, otherwise display in read-only mode. Non-nil CLASS is class to
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1133 display. Return t if class is displayed or sent to an external viewer, else nil."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (or class (setq class (if prompt (br-complete-class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 (br-find-class-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (cond ((null class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 (message "(OO-Browser): Select a class to view.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 ((not (br-class-defined-p class)) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 ((and hyperb:window-system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 (cond ((and br-editor-cmd writable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (br-edit-ext br-editor-cmd (br-class-path class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 (br-viewer-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 (br-view-ext br-viewer-cmd (br-class-path class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 ;; Support custom Lisp-based edit/view cmds on any display type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 ((and br-editor-cmd writable (not (stringp br-editor-cmd)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (br-edit-ext br-editor-cmd (br-class-path class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 ((and br-viewer-cmd (not (stringp br-viewer-cmd)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 (br-view-ext br-viewer-cmd (br-class-path class))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (t (let ((owind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (if (and (not br-keep-viewed-classes) buffer-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (null (buffer-modified-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (if (br-find-class class (not writable))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 (progn (br-major-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 (if writable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (if (file-writable-p (buffer-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 (setq buffer-read-only nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (select-window owind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (or writable (select-window owind)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (defun br-view-ext (viewer-cmd file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 "Invoke a non-standard VIEWER-CMD on FILE.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1174 See also `br-viewer-cmd'."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (interactive "fFile to view: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (or viewer-cmd (setq viewer-cmd br-viewer-cmd))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (if (not (stringp viewer-cmd)) ;; must be a Lisp function that takes a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 ;; single, file arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (funcall viewer-cmd file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (setq delete-exited-processes t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 (let ((proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (name (concat br-vw-name br-vw-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (setq br-vw-num (1+ br-vw-num)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 proc (br-view-ext-start viewer-cmd name file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (if proc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 (process-kill-without-query proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (message "(OO-Browser): Could not start external view process: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 viewer-cmd)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (defun br-view-full-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 "Delete all windows in the selected frame except for the viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (setq *br-save-wconfig* (current-window-configuration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 (let ((buf (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (br-interrupt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (delete-other-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (switch-to-buffer buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (let* ((cmd (concat br-lang-prefix "browse"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (key (car (where-is-internal (intern-soft cmd)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (message "Recall OO-Browser with: {%s}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (if key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (key-description key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (concat (key-description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 (or (car (where-is-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 'execute-extended-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 "\M-x"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 " " cmd)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 (defun br-viewer-kill ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 "Kill all current external viewer sub-processes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (if (br-kill-process-group br-vw-name br-vw-num "external viewers")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 (setq br-vw-num 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (defun br-viewer-scroll-down (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 "Scroll viewer window downward ARG lines or a windowful if no ARG."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (let ((owind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 (scroll-down arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 (select-window owind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 (defun br-viewer-scroll-up (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 "Scroll viewer window upward ARG lines or a windowful if no ARG."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 (let ((owind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (scroll-up arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (select-window owind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (defun br-where (&optional prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 "Display in minibuffer and return full path of a browser listing entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 Optional prefix arg PROMPT means prompt for entry name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 (let ((entry) (path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 (if prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (cond ((and (setq entry (br-complete-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (string-match br-feature-signature-regexp entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 (setq path (cdr (br-feature-signature-and-file entry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (entry ;; class name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (setq path (br-class-defined-p entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (t (error "(br-complete-entry): Exited without selecting a match")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 (cond ((setq entry (br-find-feature-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (setq path (cdr (br-feature-signature-and-file entry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 ((setq entry (br-find-class-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 (or (setq path (br-class-path entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 (error "(OO-Browser): No path for this class in current Environment")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 (t (error "(OO-Browser): No entry for current line in current Environment"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 (and path (message (concat entry ": " "\"" path "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 (defun br-write-buffer (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 "Write narrowed portion of current browser buffer to a file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (interactive "FFile to write buffer to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (write-region (point-min) (point-max) file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 ;;; Private functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (defun br-add-level-hist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 ;; Even though this next line looks useless, it cures a problem with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 ;; window buffer correspondences when the OO-Browser is started, so don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 ;; remove it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (set-buffer (window-buffer (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (setq *br-level-hist*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (cons (list (selected-window) (buffer-name) (br-wind-line-at-point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 *br-level-hist*)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (defun br-ancestor-roots (class-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 "Return list of CLASS-LIST's unique ancestors which do not inherit from any other class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 This list may include elements from CLASS-LIST itself."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (let ((rtn) (parents) func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (setq func (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 (lambda (class-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (if (not (setq parents (br-get-parents class)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (setq rtn (cons class rtn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (funcall func parents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 class-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 (funcall func class-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (br-set-of-strings (sort rtn 'string-lessp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 (defun br-ancestor-trees-inverted (class-list &optional depth offset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 "Insert ancestor trees starting with classes from CLASS-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 Ancestor trees are inverted, i.e. parents appear below children, not above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 Indent each class in CLASS-LIST by optional DEPTH spaces (default is 0 in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 order to ensure proper initialization). Offset each child level by optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 OFFSET spaces from its parent (which must be greater than zero, default 2)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 (or offset (setq offset 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 (or depth (setq depth 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 (if (= depth 0) (setq br-tmp-class-set nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (let ((prev-expansion-str " ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 parents expand-subtree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 (setq expand-subtree (br-set-cons br-tmp-class-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 parents (if expand-subtree (br-get-parents class)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (indent-to depth)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (insert class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (and (not expand-subtree) (br-has-children-p class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (insert prev-expansion-str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (if br-ancestor-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (funcall br-ancestor-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 class (not expand-subtree) (+ depth offset)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (if parents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (br-ancestor-trees-inverted parents (+ depth offset) offset))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (if (= depth 0) (setq br-tmp-class-set nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 (defun br-ancestor-trees (class-list &optional depth offset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 "Insert ancestor trees starting with classes from CLASS-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 Ancestor trees are not inverted, parents appear above children as in other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 browser listing windows. Indent each class in CLASS-LIST by optional DEPTH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 spaces (default is 0 in order to ensure proper initialization). Offset each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 child level by optional OFFSET spaces from its parent (which must be greater
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 than zero, default 2)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 (or offset (setq offset 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 (or depth (setq depth 0 br-tmp-depth 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 (if (= depth 0) (setq br-tmp-class-set nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (let ((prev-expansion-str " ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 parents expand-subtree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (setq expand-subtree (br-set-cons br-tmp-class-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 parents (if expand-subtree (br-get-parents class)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 (if parents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 (progn (setq br-tmp-depth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (max (+ depth offset) br-tmp-depth))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (br-ancestor-trees
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 parents (+ depth offset) offset)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (indent-to (- br-tmp-depth depth))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 (insert class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 (and (not expand-subtree) (br-has-parents-p class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 (insert prev-expansion-str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 (if br-ancestor-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 (funcall br-ancestor-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 class (not expand-subtree) (+ depth offset)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (if (= depth 0) (setq br-tmp-depth 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 (if (= depth 0) (setq br-tmp-class-set nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 (defun br-browser-buffer-p (&optional buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 "Returns t iff optional BUFFER or current buffer is an OO-Browser specific buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 (equal 0 (string-match (concat br-buffer-prefix-inher
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 "\\|" br-buffer-prefix-categ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 "\\|" br-buffer-prefix-blank
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1358 "\\|" (regexp-quote br-buffer-prefix-info))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 (buffer-name buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (defun br-buffer-level ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 "Returns current listing buffer level as a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (let* ((name (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (pos (string-match "-[p]*[0-9]+$" name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (and pos (substring name (1+ pos)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (defun br-class-level ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 "Returns current class hierarchy level as an integer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 1 is the top level."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 (let* ((name (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 (pos (string-match "[0-9]" name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (and pos (string-to-int (substring name pos)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 (defun br-listing-window-num ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 "Return listing window number, lefmost is 1, non-listing window = 0."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (let ((wind (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (ctr 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (while (not (eq wind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (setq ctr (1+ ctr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 ctr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (defun br-cleanup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 "Cleanup and free browser Environment data structures."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (setq br-lang-prefix nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 br-sys-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 br-lib-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 br-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 br-sys-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 br-lib-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 br-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 br-children-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 br-lib-prev-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 br-sys-prev-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (defun br-clear ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 "Re-initialize all browser listing buffer displays.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 Leave point in browser top-level class listing buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (let ((n (max 1 (/ (frame-width) br-min-width-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (br-next-buffer 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 (while (> n 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 (br-next-buffer nil br-buffer-prefix-blank))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (other-window 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (defun br-descendant-trees (class-list &optional indent offset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 "Insert descendant trees starting with classes from CLASS-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 Indent each class in CLASS-LIST by optional INDENT spaces (default is 0 in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 order to ensure proper initialization). Offset each child level by optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 OFFSET spaces from its parent (which must be greater than zero, default 2)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 (or indent (setq indent 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (or offset (setq offset 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (if (= indent 0) (setq br-tmp-class-set nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (let ((prev-expansion-str " ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 children expand-subtree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (lambda (class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (setq expand-subtree (br-set-cons br-tmp-class-set class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 children (if expand-subtree (br-get-children class)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (indent-to indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (insert class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (and (not expand-subtree) (br-has-children-p class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 (insert prev-expansion-str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 (if children
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 (br-descendant-trees children (+ indent offset) offset))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (if (= indent 0) (setq br-tmp-class-set nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 (defun br-display-buffer (suffix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 "Displays browser buffer ending in SUFFIX in current window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 (let ((buf (get-buffer (concat br-buffer-prefix suffix))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 (if buf (progn (set-window-buffer (selected-window) buf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (defun br-do-in-view-window (form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 "Evaluate FORM in viewer window and then return to current window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 (let ((wind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 (eval form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 (select-window wind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 (defun br-edit-ext-start (editor-cmd name file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 "Start an external viewer given by EDITOR-CMD using NAME applied to FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 ;; Conditionalized code is necessary because of silly (start-process) calling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 ;; protocol.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 (cond (br-ed9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 br-ed5 br-ed6 br-ed7 br-ed8 br-ed9 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 (br-ed8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 br-ed5 br-ed6 br-ed7 br-ed8 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (br-ed7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 br-ed5 br-ed6 br-ed7 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 (br-ed6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 br-ed5 br-ed6 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 (br-ed5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 br-ed5 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 (br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 br-ed4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 (br-ed3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 (start-process name name editor-cmd br-ed1 br-ed2 br-ed3 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (br-ed2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 (start-process name name editor-cmd br-ed1 br-ed2 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (br-ed1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (start-process name name editor-cmd br-ed1 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (start-process name name editor-cmd file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (defun br-funcall-in-view-window (buffer function &optional no-erase)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 "Clear out BUFFER and display return value from invocation of FUNCTION in viewer window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 Move point to beginning of buffer and then return to current window. BUFFER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 may be a buffer name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 With optional NO-ERASE, buffer is not erased before function is called."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (let ((wind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (progn (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (set-window-buffer (selected-window) (get-buffer-create buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 (if no-erase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (erase-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (funcall function))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 (select-window wind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 (defun br-file-to-viewer (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 "Display FILENAME from OO-Browser source directory in browser viewer window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 FILENAME should not contain any path information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (br-funcall-in-view-window
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1504 (concat br-buffer-prefix-info "Help*")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 (function (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 (insert-file-contents (br-pathname filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (set-buffer-modified-p nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (defun br-in-browser ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 "Return selected frame if the OO-Browser is active in it, else return nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (cond ((not (eq br-in-browser (selected-frame))) nil)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1512 ((or (one-window-p 'nomini)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1513 (and (fboundp 'window-list)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1514 (< (length (window-list)) 3)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (setq br-in-browser nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (t br-in-browser)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (defun br-in-top-buffer-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 "Return t if point is in the top class listing buffer, else nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (string-equal (br-buffer-level) "1"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (defun br-in-view-window-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 "Is point in a viewer window?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 (br-non-listing-window-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (defun br-init ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 "Initialization common to all OO-Browser invocations."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (br-feature-tags-init))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (defun br-insert-classes (class-list &optional indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 "Insert CLASS-LIST in current buffer indented INDENT columns."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (lambda (class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (and indent (indent-to indent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (and class-name (insert class-name "\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 class-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (defun br-interrupt (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (if (null arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 (lambda (buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (if (or (eq major-mode 'br-mode) (br-browser-buffer-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (bury-buffer nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 (buffer-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (setq *br-save-wconfig* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 *br-prev-wconfig* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 *br-prev-listing-window* nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 (lambda (buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (if (or (eq major-mode 'br-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (br-browser-buffer-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (progn (br-feature-clear-signatures)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (kill-buffer (current-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 (buffer-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 (br-cleanup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (setq br-in-browser nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 (defun br-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 "The major mode used by OO-Browser listing windows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 See the file \"br-help\" for browser usage information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 It provides the following keys: \\{br-mode-map}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (use-local-map br-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (setq major-mode 'br-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 (setq mode-name "OO-Browse")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (set-syntax-table text-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 (setq local-abbrev-table text-mode-abbrev-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (setq case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (run-hooks 'br-class-list-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (run-hooks 'br-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (defun br-narrow-to-class ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (cond ((= (point-min) (point-max)) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 ((br-find-class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 (narrow-to-region (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 (t (error
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1584 "(OO-Browser): `br-narrow-to-class', current entry is not a class"))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (defun br-narrow-to-feature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 "Narrow buffer to current feature entry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 (if (br-feature-at-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 (narrow-to-region (match-beginning 0) (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (error
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1591 "(OO-Browser): `br-narrow-to-feature' no current feature.")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 (defun br-feature-at-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 "Returns t iff point is on a feature listing line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 (looking-at (concat "[ \t]*" br-feature-entry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 (defun br-next-buffer (&optional special alt-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 "Returns next sequential browser buffer or special one if optional SPECIAL is non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 Non-nil ALT-PREFIX is used as prefix in buffer name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 (let* ((suffix (or special (1+ (or (br-class-level) 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 (buf (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 (concat (or alt-prefix br-buffer-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 (if (integerp suffix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (int-to-string suffix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 suffix)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 (if buf (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 (or special (br-next-listing-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 (set-window-buffer (selected-window) buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 ;; Clear out any feature tags that may have been associated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 ;; with this buffer, so we don't mistakenly reference them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (br-feature-clear-signatures))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 (setq mode-line-format (list " %17b --" '(-3 . "%p") "-%-"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (br-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 (br-set-mode-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 (set-buffer-modified-p nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 (defun br-next-listing-window (&optional prev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 "Move to next browser listing window (non-viewer window).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 Optional PREV means to previous window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 (let ((owind (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 (while (progn (other-window (if prev -1 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (if (br-non-listing-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 (not (eq (selected-window) owind)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 (defun br-pathname (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 "Return full pathname for FILENAME in browser Elisp directory."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 (if br-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 (expand-file-name filename br-directory)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1635 (error "The `br-directory' variable must be set to a string value.")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 (defun br-protocol-entry-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 "Return non-nil if point is within a protocol listing entry line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 (and (string-equal br-lang-prefix "objc-")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (looking-at "[ \t]*@ <[^\>]*>"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 (defun br-resize (min-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 "Resize browser listing windows to have MIN-WIDTH."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (let* ((window-min-width 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 (oldn (1- (length (br-window-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (n (max 1 (/ (frame-width) min-width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (numw n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (diff (- numw oldn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 (width (/ (frame-width) numw))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (obuf (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 (br-to-first-list-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (cond ((= diff 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 (br-resize-windows numw width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 ((> diff 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 (setq n oldn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 (while (> n 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (shrink-window-horizontally (max 0 (- (window-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 min-width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 (br-next-listing-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 (setq n diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 (while (> n 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 (split-window-horizontally (max window-min-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (- (window-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 min-width))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 (setq n oldn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 (while (< n numw)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 (setq n (1+ n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 (br-next-listing-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 (br-next-buffer n br-buffer-prefix-blank))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 (br-to-first-list-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (br-resize-windows numw width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 (t ;; (< diff 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 (while (> n 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 (br-next-listing-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (setq n (- diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 (while (> n 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 (delete-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 (br-to-first-list-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 (br-resize-windows numw width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 (setq br-min-width-window min-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 (let ((owind (get-buffer-window obuf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 (if owind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 (select-window owind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 (br-next-listing-window)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 (defun br-resize-narrow ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 "Resize listing windows so are narrower by 10 characters."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 (if (<= window-min-width (- br-min-width-window 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (br-resize (max window-min-width (- br-min-width-window 10)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 (beep)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 (defun br-resize-widen ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 "Resize listing windows so are wider by 10 characters."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 (if (and (>= (frame-width) (+ br-min-width-window 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 (> (length (br-window-list)) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 (br-resize (min (frame-width) (+ br-min-width-window 10)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 (beep)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 (defun br-resize-windows (n width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 (while (> n 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 (shrink-window-horizontally (- (window-width) width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 (br-next-listing-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 (defun br-set-mode-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 "Set mode line string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 (setq mode-line-buffer-identification (list (buffer-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (set-buffer-modified-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 (defun br-show-top-classes (func &optional uniq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 "Display list of top level classes generated by calling FUNC.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 Optional UNIQ means sort and eliminate duplicates."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 (message "Ordering classes...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (let ((classes (funcall func)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 (setq classes (br-class-list-filter classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (br-clear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 (let (buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 (br-insert-classes classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 (if uniq
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (if (stringp br-sort-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 (call-process-region (point-min) (point-max) "sort" t t nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 br-sort-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (call-process-region (point-min) (point-max) "sort" t t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (if (and (stringp br-sort-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (string-match "u" br-sort-options))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 ;; Then sort made the list of elements unique, so do nothing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (call-process-region (point-min) (point-max) "uniq" t t))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (message "Ordering classes...Done"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (defun br-this-level-classes (&optional keep-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 "Return list of the classes in the current listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 Optional KEEP-INDENT non-nil means keep indentation preceding class name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (let ((classes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (while (and (not (looking-at "^[ \t]*$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 (if (looking-at (format "^[ \t]*%s "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 br-feature-type-regexp)) ;; a feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 t ;; skip this entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 ;; assume is a class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 (setq classes (cons (br-find-class-name keep-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 classes)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 (= (forward-line 1) 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 (nreverse (delq nil classes))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 (defun br-this-level-entries ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 "Return list of all entries in the current listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (let ((entries))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 (while (and (not (looking-at "^[ \t]*$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 (if (looking-at (format "^[ \t]*%s "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 br-feature-type-regexp)) ;; a feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 (setq entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 (cons (br-find-feature-entry) entries))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 ;; assume is a class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 (setq entries (cons (br-find-class-name) entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 (= (forward-line 1) 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 (nreverse (delq nil entries))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 (defun br-this-level-features ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 "Return list of features in the current listing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 (let ((feature-regexp (concat "[ \t]*" br-feature-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 (features))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 (while (progn (if (looking-at feature-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (setq features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 (cons (br-find-feature-entry) features)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 (= (forward-line 1) 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 (nreverse (delq nil features))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 (defun br-to-first-list-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 (br-to-view-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 (br-next-listing-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 (defun br-to-tree ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 "If point is within ... move to inher/ancestry expansion for the current class."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 (if (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 (skip-chars-backward ".")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (looking-at "\\.\\.\\."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 (progn (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 (let ((class-expr (concat "^[ \t]*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 (br-find-class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 "$")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 (if (re-search-backward class-expr nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 (progn (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 (recenter '(4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 t))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 (defun br-to-view-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 "Move to viewer window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 (if (br-in-view-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (setq *br-prev-listing-window* (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 (while (and (not (br-in-view-window-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 (progn (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 (not (eq (selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 *br-prev-listing-window*)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (defun br-window-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 (and (fboundp 'modify-frame-parameters)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 (cdr (assq 'unsplittable (frame-parameters)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (modify-frame-parameters (selected-frame) '((unsplittable))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 (delete-other-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 ;; Set top of frame line in case it is not 0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 (or (fboundp 'window-highest-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (setq br-top-of-frame (nth 1 (window-edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 (split-window-vertically nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (let* ((n (max 1 (/ (frame-width) br-min-width-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (width (/ (frame-width) n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (br-next-buffer 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 (while (> n 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 (setq n (1- n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 (split-window-horizontally width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 (br-next-buffer nil br-buffer-prefix-blank))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 (defun br-view-ext-start (viewer-cmd name file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 "Start an external viewer given by VIEWER-CMD using NAME applied to FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 ;; Conditionalized code is necessary because of silly (start-process) calling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 ;; protocol.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 (cond (br-vw9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 br-vw5 br-vw6 br-vw7 br-vw8 br-vw9 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 (br-vw8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 br-vw5 br-vw6 br-vw7 br-vw8 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 (br-vw7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 br-vw5 br-vw6 br-vw7 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 (br-vw6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 br-vw5 br-vw6 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 (br-vw5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 br-vw5 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 (br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 br-vw4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 (br-vw3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 (start-process name name viewer-cmd br-vw1 br-vw2 br-vw3 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 (br-vw2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (start-process name name viewer-cmd br-vw1 br-vw2 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 (br-vw1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (start-process name name viewer-cmd br-vw1 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (start-process name name viewer-cmd file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 ;;; Private variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 (defvar br-ancestor-function nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 "If non-nil, a function of 3 arguments called after each ancestor class is inserted into an ancestry listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 First argument is the class just inserted, second argument is a flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 indicating whether class has previously been displayed within the listing and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 third argument is the number of spaces to indent each feature entry for this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 class.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 (defvar br-top-of-frame 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 "Frame line number of windows at top of the OO-Browser frame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (defvar br-ed-num 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 (defvar br-ed-name "extEd")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 (defvar br-vw-num 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (defvar br-vw-name "extVw")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 (defvar br-in-browser nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 "Equal to the frame displaying the OO-Browser when in use, else nil.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (defvar br-lib-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 "List of directories below which OO source files and other library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 directories are found. A library is a stable group of OO classes. Do not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 set this variable directly. Each OO language library which invokes
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1892 `br-browse' should set it.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (defvar br-sys-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 "List of directories below which OO source files and other system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 directories are found. A system is a group of OO classes that are likely to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 change. Do not set this variable directly. Each OO language library which
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1898 invokes `br-browse' should set it.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (defvar *br-level-hist* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 "Internal history of visited listing windows and buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (defvar *br-prev-listing-window* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 "Saves listing window used prior to viewer window entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 Allows return to previous listing window when done with the viewer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 (defvar *br-prev-wconfig* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 "Saves window configuration prior to browser entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (defvar *br-save-wconfig* nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 "Saves window configuration between invocations of the browser.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 (defconst br-buffer-prefix-categ "Categ-Lvl-")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (defconst br-buffer-prefix-inher "Inher-Lvl-")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 (defconst br-buffer-prefix-blank "Blank-")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1916 (defconst br-buffer-prefix-info "*OO-Browser ")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 (defvar br-buffer-prefix br-buffer-prefix-inher
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 "Browser buffer name prefix.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 (defvar br-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 "Keymap containing OO-Browser commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 (if br-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (setq br-mode-map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 (suppress-keymap br-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (define-key br-mode-map "@" 'br-at)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 (define-key br-mode-map "1" 'br-view-full-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 (define-key br-mode-map "\C-c^" 'br-add-class-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (define-key br-mode-map "a" 'br-ancestors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 (define-key br-mode-map "b" 'br-buffer-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (define-key br-mode-map "\C-c\C-b" 'br-report-bug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 (define-key br-mode-map "c" 'br-children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 (define-key br-mode-map "C" 'br-categories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 (define-key br-mode-map "\M-c" 'br-class-stats)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 (define-key br-mode-map "\C-c\C-c" 'br-env-create)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 (define-key br-mode-map "d" 'br-descendants)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 (define-key br-mode-map "\C-c\C-d" 'br-delete)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1939 ;; {M-d} is used down below for `br-tree'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 (define-key br-mode-map "e" 'br-edit-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (define-key br-mode-map "\M-e" 'br-env-stats)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (define-key br-mode-map "\C-c\C-e" 'br-env-rebuild)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (define-key br-mode-map "f" 'br-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (define-key br-mode-map "F" 'br-feature-signature)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1945 ;; {M-f} is used down below for `br-tree-features-toggle'
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1946 ;; {M-g} is used down below for `br-tree-graph'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (define-key br-mode-map "?" 'br-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 (define-key br-mode-map "h" 'br-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 (define-key br-mode-map "H" 'br-help-ms) ;; mouse help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 (define-key br-mode-map "i" 'br-entry-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 (define-key br-mode-map "I" 'br-implementors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (define-key br-mode-map "\C-c\C-k" 'br-kill)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
1953 ;; {M-k} is used down below for `br-tree-kill'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 (define-key br-mode-map "l" 'br-lib-top-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (define-key br-mode-map "L" 'br-lib-rebuild)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 (define-key br-mode-map "\C-c\C-l" 'br-env-load)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 (define-key br-mode-map "m" 'br-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 (define-key br-mode-map "M" 'br-match-entries)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 ;; "\C-c\C-m" is reserved for future use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 (define-key br-mode-map "\C-n" 'br-next-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961 (define-key br-mode-map "o" 'br-order)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 (define-key br-mode-map "p" 'br-parents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 (define-key br-mode-map "P" 'br-protocols)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 (define-key br-mode-map "\C-p" 'br-prev-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 (define-key br-mode-map "q" 'br-quit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 ;; {r} does the same thing as {f} and is for backward compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 ;; with prior OO-Browser releases. It may be rebound in the future, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 ;; learn to use {f} instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 (define-key br-mode-map "r" 'br-features)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 (define-key br-mode-map "\C-c\C-r" 'br-refresh)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 (define-key br-mode-map "s" 'br-sys-top-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 (define-key br-mode-map "S" 'br-sys-rebuild)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 (define-key br-mode-map "\C-c\C-s" 'br-env-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 (define-key br-mode-map "t" 'br-top-classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 (define-key br-mode-map "u" 'br-unique)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 (define-key br-mode-map "v" 'br-view-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 (define-key br-mode-map "V" 'br-view-friend)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 (define-key br-mode-map "\C-c\C-v" 'br-to-from-viewer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 (define-key br-mode-map "\C-c\C-w" 'br-write-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 (define-key br-mode-map "w" 'br-where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 (define-key br-mode-map "x" 'br-exit-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 (define-key br-mode-map "\C-x-" 'br-resize-narrow)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 (define-key br-mode-map "\C-x+" 'br-resize-widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 (define-key br-mode-map "#" 'br-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 (define-key br-mode-map "\C-c#" 'br-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 (define-key br-mode-map " " 'br-viewer-scroll-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 (define-key br-mode-map "\177" 'br-viewer-scroll-down)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 ;; Define graphical browser keys if a window system is available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 (if hyperb:window-system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 (progn (require 'br-tree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 (define-key br-mode-map "\M-d" 'br-tree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 (define-key br-mode-map "\M-f" 'br-tree-features-toggle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 (define-key br-mode-map "\M-g" 'br-tree-graph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 (define-key br-mode-map "\M-k" 'br-tree-kill))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 (defvar br-tmp-class-set nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 "Set of classes created for temporary use by br-*-trees functions.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 (defvar br-tmp-depth 0
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
2000 "Temporary variable indicating inheritance depth of class in `br-ancestor-trees'.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 (provide 'br)