Mercurial > emacs
annotate lisp/cedet/semantic/ia-sb.el @ 106815:1d1d5d9bd884
Add 2010 to copyright years.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 13 Jan 2010 00:35:10 -0800 |
parents | 83dde921cc1b |
children | 376148b31b5e |
rev | line source |
---|---|
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic/ia-sb.el --- Speedbar analysis display interactor |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
106815 | 3 ;;; Copyright (C) 2002, 2003, 2004, 2006, 2008, 2009, 2010 |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 ;;; Free Software Foundation, Inc. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; Keywords: syntax |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; Speedbar node for displaying derived context information. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 (require 'semantic/analyze) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 (require 'speedbar) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;;; Code: |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 (defvar semantic-ia-sb-key-map nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 "Keymap used when in semantic analysis display mode.") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 (if semantic-ia-sb-key-map |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 (setq semantic-ia-sb-key-map (speedbar-make-specialized-keymap)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 ;; Basic featuers. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (define-key semantic-ia-sb-key-map "\C-m" 'speedbar-edit-line) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 (define-key semantic-ia-sb-key-map "I" 'semantic-ia-sb-show-tag-info) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (defvar semantic-ia-sb-easymenu-definition |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 '( "---" |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 ; [ "Expand" speedbar-expand-line nil ] |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 ; [ "Contract" speedbar-contract-line nil ] |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 [ "Tag Information" semantic-ia-sb-show-tag-info t ] |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 [ "Jump to Tag" speedbar-edit-line t ] |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 [ "Complete" speedbar-edit-line t ] |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 "Extra menu items Analysis mode.") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 ;; Make sure our special speedbar major mode is loaded |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (speedbar-add-expansion-list '("Analyze" |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 semantic-ia-sb-easymenu-definition |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 semantic-ia-sb-key-map |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 semantic-ia-speedbar)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (speedbar-add-mode-functions-list |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (list "Analyze" |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 ;;'(speedbar-item-info . eieio-speedbar-item-info) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 '(speedbar-line-directory . semantic-ia-sb-line-path))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 |
104462
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
66 ;;;###autoload |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (defun semantic-speedbar-analysis () |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 "Start Speedbar in semantic analysis mode. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 The analyzer displays information about the current context, plus a smart |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 list of possible completions." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (interactive) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 ;; Make sure that speedbar is active |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (speedbar-frame-mode 1) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 ;; Now, throw us into Analyze mode on speedbar. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (speedbar-change-initial-expansion-list "Analyze") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (defun semantic-ia-speedbar (directory zero) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 "Create buttons in speedbar which define the current analysis at POINT. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 DIRECTORY is the current directory, which is ignored, and ZERO is 0." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 (let ((analysis nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (scope nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (buffer nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (completions nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 (cf (selected-frame)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 (cnt nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 (mode-local-active-mode nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 ;; Try and get some sort of analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 (condition-case nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 (progn |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 (setq buffer (current-buffer)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 (setq mode-local-active-mode major-mode) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 ;; Get the current scope |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (setq scope (semantic-calculate-scope (point))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 ;; Get the analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (setq analysis (semantic-analyze-current-context (point))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (setq cnt (semantic-find-tag-by-overlay)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (when analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (setq completions (semantic-analyze-possible-completions analysis)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 (error nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 (select-frame cf) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
107 (with-current-buffer speedbar-buffer |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 ;; If we have something, do something spiff with it. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 (erase-buffer) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 (speedbar-insert-separator "Buffer/Function") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 ;; Note to self: Turn this into an expandable file name. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 (speedbar-make-tag-line 'bracket ? nil nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 (buffer-name buffer) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 nil nil 'speedbar-file-face 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 (when cnt |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 (semantic-ia-sb-string-list cnt |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 'semantic-sb-token-jump)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 (when analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 ;; If this analyzer happens to point at a complete symbol, then |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 ;; see if we can dig up some documentation for it. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 (semantic-ia-sb-show-doc analysis)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (when analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 ;; Let different classes draw more buttons. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 (semantic-ia-sb-more-buttons analysis) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 (when completions |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 (speedbar-insert-separator "Completions") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 (semantic-ia-sb-completion-list completions |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 'semantic-ia-sb-complete)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 ;; Show local variables |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 (when scope |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (semantic-ia-sb-show-scope scope)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 ))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 (defmethod semantic-ia-sb-show-doc ((context semantic-analyze-context)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 "Show documentation about CONTEXT iff CONTEXT points at a complete symbol." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 (let ((sym (car (reverse (oref context prefix)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 (doc nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (when (semantic-tag-p sym) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 (setq doc (semantic-documentation-for-tag sym)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 (when doc |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 (speedbar-insert-separator "Documentation") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 (insert doc) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 (insert "\n") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
152 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
153 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
154 (defun semantic-ia-sb-show-scope (scope) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 "Show SCOPE information." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 (let ((localvars (when scope |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
157 (oref scope localvar))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 (when localvars |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 (speedbar-insert-separator "Local Variables") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 (semantic-ia-sb-string-list localvars |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 ;; This is from semantic-sb |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 'semantic-sb-token-jump)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 (defmethod semantic-ia-sb-more-buttons ((context semantic-analyze-context)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 "Show a set of speedbar buttons specific to CONTEXT." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
168 (let ((prefix (oref context prefix))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
169 (when prefix |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 (speedbar-insert-separator "Prefix") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 (semantic-ia-sb-string-list prefix |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 'semantic-sb-token-jump)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 (defmethod semantic-ia-sb-more-buttons ((context semantic-analyze-context-assignment)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 "Show a set of speedbar buttons specific to CONTEXT." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 (call-next-method) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 (let ((assignee (oref context assignee))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 (when assignee |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 (speedbar-insert-separator "Assignee") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 (semantic-ia-sb-string-list assignee |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
184 'semantic-sb-token-jump)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 (defmethod semantic-ia-sb-more-buttons ((context semantic-analyze-context-functionarg)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 "Show a set of speedbar buttons specific to CONTEXT." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 (call-next-method) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 (let ((func (oref context function))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 (when func |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 (speedbar-insert-separator "Function") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 (semantic-ia-sb-string-list func |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 'semantic-sb-token-jump) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 ;; An index for the argument the prefix is in: |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 (let ((arg (oref context argument)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 (args (semantic-tag-function-arguments (car func))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 (idx 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 (speedbar-insert-separator |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 (format "Argument #%d" (oref context index))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 (if args |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 (semantic-ia-sb-string-list args |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 'semantic-sb-token-jump |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 (oref context index) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 'speedbar-selected-face) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 ;; Else, no args list, so use what the context had. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 (semantic-ia-sb-string-list arg |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 'semantic-sb-token-jump)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 )))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
213 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
214 (defun semantic-ia-sb-string-list (list face function &optional idx idxface) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 "Create some speedbar buttons from LIST. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 Each button will use FACE, and be activated with FUNCTION. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 Optional IDX is an index into LIST to apply IDXFACE instead." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 (let ((count 1)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 (while list |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 (let* ((usefn nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 (string (cond ((stringp (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 ((semantic-tag-p (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 (setq usefn (semantic-tag-with-position-p (car list))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 (semantic-format-tag-uml-concise-prototype (car list))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 (t "<No Tag>"))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 (localface (if (or (not idx) (/= idx count)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 idxface)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 (if (semantic-tag-p (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 (speedbar-make-tag-line 'angle ?i |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 'semantic-ia-sb-tag-info (car list) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 string (if usefn function) (car list) localface |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 (speedbar-make-tag-line 'statictag ?? |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 nil nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 string (if usefn function) (car list) localface |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 0)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 (setq list (cdr list) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 count (1+ count))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 ))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
243 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 (defun semantic-ia-sb-completion-list (list face function) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 "Create some speedbar buttons from LIST. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 Each button will use FACE, and be activated with FUNCTION." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 (while list |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 (let* ((documentable nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 (string (cond ((stringp (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 ((semantic-tag-p (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 (setq documentable t) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 (semantic-format-tag-uml-concise-prototype (car list))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 (t "foo")))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 (if documentable |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 (speedbar-make-tag-line 'angle ?i |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 'semantic-ia-sb-tag-info |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 (car list) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 string function (car list) face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 (speedbar-make-tag-line 'statictag ? nil nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 string function (car list) face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 0)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 (setq list (cdr list))))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 (defun semantic-ia-sb-show-tag-info () |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 "Display information about the tag on the current line. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
268 Same as clicking on the <i> button. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
269 See `semantic-ia-sb-tag-info' for more." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
270 (interactive) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
271 (let ((tok nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 (end-of-line) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 (forward-char -1) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 (setq tok (get-text-property (point) 'speedbar-token))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 (semantic-ia-sb-tag-info nil tok 0))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
277 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
278 (defun semantic-ia-sb-tag-info (text tag indent) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 "Display as much information as we can about tag. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
280 Show the information in a shrunk split-buffer and expand |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
281 out as many details as possible. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
282 TEXT, TAG, and INDENT are speedbar function arguments." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
283 (when (semantic-tag-p tag) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
284 (unwind-protect |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 (let ((ob nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 (setq ob (current-buffer)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 (with-output-to-temp-buffer "*Tag Information*" |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 ;; Output something about this tag: |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
290 (with-current-buffer "*Tag Information*" |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 (goto-char (point-max)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
292 (insert |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 (semantic-format-tag-prototype tag nil t) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
294 "\n") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 (let ((typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
296 (condition-case nil |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
297 (with-current-buffer ob |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 ;; @todo - We need a context to derive a scope from. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 (semantic-analyze-tag-type tag nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 (error nil)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 (if typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 (insert (semantic-format-tag-prototype |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 typetok nil t)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 ;; No type found by the analyzer |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 ;; The below used to try and select the buffer from the last |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 ;; analysis, but since we are already in the correct buffer, I |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 ;; don't think that is needed. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
308 (let ((type (semantic-tag-type tag))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
309 (cond ((semantic-tag-p type) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
310 (setq type (semantic-tag-name type))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
311 ((listp type) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
312 (setq type (car type)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 (if (semantic-lex-keyword-p type) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
314 (setq typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 (semantic-lex-keyword-get type 'summary)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 (if typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 (insert typetok)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 ;; Make it small |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 (shrink-window-if-larger-than-buffer |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 (get-buffer-window "*Tag Information*"))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 (select-frame speedbar-frame)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 (defun semantic-ia-sb-line-path (&optional depth) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 "Return the file name associated with DEPTH." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 (save-match-data |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 (let* ((tok (speedbar-line-token)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 (buff (if (semantic-tag-buffer tok) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 (semantic-tag-buffer tok) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 (current-buffer)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 (buffer-file-name buff)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
333 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 (defun semantic-ia-sb-complete (text tag indent) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 "At point in the attached buffer, complete the symbol clicked on. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 TEXT TAG and INDENT are the details." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 ;; Find the specified bounds from the current analysis. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 (unwind-protect |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 (let* ((a (semantic-analyze-current-context (point))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 (bounds (oref a bounds)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 (movepoint nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (if (and (<= (point) (cdr bounds)) (>= (point) (car bounds))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 (setq movepoint t)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 (goto-char (car bounds)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 (delete-region (car bounds) (cdr bounds)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 (insert (semantic-tag-name tag)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 (if movepoint (setq movepoint (point))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 ;; I'd like to use this to add fancy () or what not at the end |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 ;; but we need the parent file whih requires an upgrade to the |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 ;; analysis tool. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 ;;(semantic-insert-foreign-tag tag ??)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
356 (if movepoint |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 (let ((cf (selected-frame))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 (goto-char movepoint) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 (select-frame cf)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 (select-frame speedbar-frame))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 (provide 'semantic/ia-sb) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 |
104462
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
365 ;; Local variables: |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
366 ;; generated-autoload-file: "loaddefs.el" |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
367 ;; generated-autoload-load-name: "semantic/ia-sb" |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
368 ;; End: |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
369 |
105377 | 370 ;; arch-tag: 4ab9f509-6978-415f-9938-9266edad9886 |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
371 ;;; semantic/ia-sb.el ends here |