Mercurial > emacs
annotate lisp/cedet/semantic/ia-sb.el @ 104473:69e6bd939d5a
lisp/cedet/semantic/bovine/c.el: Remove unnecessary function declaration.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 07 Sep 2009 15:31:40 +0000 |
parents | de6e9d927035 |
children | 7f4c7f5c0eba |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
3 ;;; Copyright (C) 2002, 2003, 2004, 2006, 2008, 2009 |
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) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (set-buffer speedbar-buffer) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 ;; 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
|
110 (erase-buffer) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 (speedbar-insert-separator "Buffer/Function") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 ;; 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
|
113 (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
|
114 (buffer-name buffer) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 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
|
116 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 (when cnt |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 (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
|
119 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 'semantic-sb-token-jump)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 (when analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 ;; 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
|
123 ;; 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
|
124 (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
|
125 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 (when analysis |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 ;; 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
|
128 (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
|
129 (when completions |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 (speedbar-insert-separator "Completions") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 (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
|
132 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 'semantic-ia-sb-complete)) |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 ;; Show local variables |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (when scope |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 (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
|
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 (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
|
143 "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
|
144 (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
|
145 (doc nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 (when (semantic-tag-p sym) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 (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
|
148 (when doc |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 (speedbar-insert-separator "Documentation") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 (insert doc) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 (insert "\n") |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 (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
|
156 "Show SCOPE information." |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
157 (let ((localvars (when scope |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 (oref scope localvar))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 (when localvars |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 (speedbar-insert-separator "Local Variables") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 (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
|
163 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 ;; This is from semantic-sb |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 'semantic-sb-token-jump)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 (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
|
168 "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
|
169 (let ((prefix (oref context prefix))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 (when prefix |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 (speedbar-insert-separator "Prefix") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 (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
|
173 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 'semantic-sb-token-jump)) |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 (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
|
178 "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
|
179 (call-next-method) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 (let ((assignee (oref context assignee))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 (when assignee |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 (speedbar-insert-separator "Assignee") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 (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
|
184 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 'semantic-sb-token-jump)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 (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
|
188 "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
|
189 (call-next-method) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 (let ((func (oref context function))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 (when func |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 (speedbar-insert-separator "Function") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 (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
|
194 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 'semantic-sb-token-jump) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 ;; 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
|
197 (let ((arg (oref context argument)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 (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
|
199 (idx 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 (speedbar-insert-separator |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 (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
|
203 (if args |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 (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
|
205 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 'semantic-sb-token-jump |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 (oref context index) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 'speedbar-selected-face) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 ;; 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
|
210 (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
|
211 'speedbar-tag-face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 'semantic-sb-token-jump)) |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 (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
|
216 "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
|
217 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
|
218 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
|
219 (let ((count 1)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 (while list |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 (let* ((usefn nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 (string (cond ((stringp (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 ((semantic-tag-p (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 (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
|
226 (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
|
227 (t "<No Tag>"))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 (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
|
229 face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 idxface)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 (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
|
233 (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
|
234 '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
|
235 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
|
236 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 (speedbar-make-tag-line 'statictag ?? |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 nil nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 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
|
240 0)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 (setq list (cdr list) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 count (1+ count))) |
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 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 (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
|
246 "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
|
247 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
|
248 (while list |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 (let* ((documentable nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 (string (cond ((stringp (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 ((semantic-tag-p (car list)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 (setq documentable t) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 (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
|
255 (t "foo")))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 (if documentable |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 (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
|
258 'semantic-ia-sb-tag-info |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 (car list) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 string function (car list) face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 0) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 (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
|
263 string function (car list) face |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 0)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 (setq list (cdr list))))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 (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
|
268 "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
|
269 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
|
270 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
|
271 (interactive) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 (let ((tok nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 (end-of-line) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 (forward-char -1) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 (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
|
277 (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
|
278 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 (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
|
280 "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
|
281 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
|
282 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
|
283 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
|
284 (when (semantic-tag-p tag) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 (unwind-protect |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 (let ((ob nil)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 (setq ob (current-buffer)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 (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
|
290 ;; Output something about this tag: |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
292 (set-buffer "*Tag Information*") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 (goto-char (point-max)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
294 (insert |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 (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
|
296 "\n") |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
297 (let ((typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 (condition-case nil |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 (set-buffer ob) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 ;; @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
|
302 (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
|
303 (error nil)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 (if typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 (insert (semantic-format-tag-prototype |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 typetok nil t)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 ;; 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
|
308 ;; 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
|
309 ;; 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
|
310 ;; 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
|
311 (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
|
312 (cond ((semantic-tag-p type) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 (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
|
314 ((listp type) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 (setq type (car type)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 (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
|
317 (setq typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 (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
|
319 (if typetok |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 (insert typetok)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 )) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 ;; Make it small |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 (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
|
325 (get-buffer-window "*Tag Information*"))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 (select-frame speedbar-frame)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 (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
|
329 "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
|
330 (save-match-data |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 (let* ((tok (speedbar-line-token)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 (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
|
333 (semantic-tag-buffer tok) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 (current-buffer)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 (buffer-file-name buff)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 (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
|
338 "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
|
339 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
|
340 ;; 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
|
341 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 (unwind-protect |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 (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
|
344 (bounds (oref a bounds)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (movepoint nil) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 (save-excursion |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 (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
|
349 (setq movepoint t)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 (goto-char (car bounds)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 (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
|
352 (insert (semantic-tag-name tag)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 (if movepoint (setq movepoint (point))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 ;; 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
|
355 ;; 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
|
356 ;; analysis tool. |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 ;;(semantic-insert-foreign-tag tag ??)) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 ) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 (if movepoint |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 (let ((cf (selected-frame))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 (speedbar-select-attached-frame) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 (goto-char movepoint) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 (select-frame cf)))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 (select-frame speedbar-frame))) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 (provide 'semantic/ia-sb) |
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 |
104462
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
368 ;; Local variables: |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
369 ;; 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
|
370 ;; generated-autoload-feature: semantic/loaddefs |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
371 ;; 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
|
372 ;; End: |
de6e9d927035
lisp/cedet/semantic/ia-sb.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents:
104435
diff
changeset
|
373 |
104435
52067a6bf088
semantic/cedet/db-global.el, semantic/cedet/ia-sb.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
374 ;;; semantic/ia-sb.el ends here |