annotate lisp/cedet/semantic/decorate/include.el @ 112218:376148b31b5e

Add 2011 to FSF/AIST copyright years.
author Glenn Morris <rgm@gnu.org>
date Sun, 02 Jan 2011 15:50:46 -0800
parents a5ad4f188e19
children ef719132ddfa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; semantic/decorate/include.el --- Decoration modes for include statements
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110523
diff changeset
3 ;; Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Highlight any include that is in a state the user may care about.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;; The basic idea is to have the state be highly visible so users will
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; as 'what is this?" and get the info they need to fix problems that
105334
8cf4deed919e Fix comment typo.
Glenn Morris <rgm@gnu.org>
parents: 104470
diff changeset
27 ;; are otherwise transparent when trying to get smart completion
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;; working.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 (require 'semantic/decorate/mode)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 (require 'semantic/db)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 (require 'semantic/db-ref)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 (require 'semantic/db-find)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 (eval-when-compile
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 (require 'semantic/find))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 (defvar semantic-dependency-system-include-path)
104456
6065d66f0c99 lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents: 104451
diff changeset
39 (declare-function ede-get-locator-object "ede/files")
6065d66f0c99 lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents: 104451
diff changeset
40 (declare-function ede-system-include-path "ede/cpp-root")
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 ;;; Code:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 ;;; FACES AND KEYMAPS
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 (defvar semantic-decoratiton-mouse-3 (if (featurep 'xemacs) [ button3 ] [ mouse-3 ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 "The keybinding lisp object to use for binding the right mouse button.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 ;;; Includes that that are in a happy state!
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (defface semantic-decoration-on-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 nil
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 "*Overlay Face used on includes that are not in some other state.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 Used by the decoration style: `semantic-decoration-on-includes'."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 :group 'semantic-faces)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 (defvar semantic-decoration-on-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 (let ((km (make-sparse-keymap)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 km)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 "Keymap used on includes.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 (defvar semantic-decoration-on-include-menu nil
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 "Menu used for include headers.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 (easy-menu-define
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 semantic-decoration-on-include-menu
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 semantic-decoration-on-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 "Include Menu"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 (list
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 "Include"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 ["What Is This?" semantic-decoration-include-describe
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 :help "Describe why this include has been marked this way." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 ["Visit This Include" semantic-decoration-include-visit
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 :help "Visit this include file." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82 ["Summarize includes current buffer" semantic-decoration-all-include-summary
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 :help "Show a summary for the current buffer containing this include." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 ["List found includes (load unparsed)" semanticdb-find-test-translate-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 :help "List all includes found for this file, and parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 ["List found includes (no loading)" semanticdb-find-test-translate-path-no-loading
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 :help "List all includes found for this file, do not parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 ["List all unknown includes" semanticdb-find-adebug-lost-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 :help "Show a list of all includes semantic cannot find for this file." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 ["Customize System Include Path" semantic-customize-system-include-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 :active (get 'semantic-dependency-system-include-path major-mode)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 :help "Run customize for the system include path for this major mode." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 ["Add a System Include Path" semantic-add-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 ["Remove a System Include Path" semantic-remove-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 ;;["" semantic-decoration-include-
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111 ;; :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 ;; :help "" ]
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 ;;; Unknown Includes!
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 (defface semantic-decoration-on-unknown-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 '((((class color) (background dark))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 (:background "#900000"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 (((class color) (background light))
110523
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
121 (:background "#fff0f0")))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 "*Face used to show includes that cannot be found.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 Used by the decoration style: `semantic-decoration-on-unknown-includes'."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 :group 'semantic-faces)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 (defvar semantic-decoration-on-unknown-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 (let ((km (make-sparse-keymap)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 ;(define-key km [ mouse-2 ] 'semantic-decoration-unknown-include-describe)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-unknown-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130 km)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 "Keymap used on unparsed includes.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 (defvar semantic-decoration-on-unknown-include-menu nil
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 "Menu used for unparsed include headers.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 (easy-menu-define
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 semantic-decoration-on-unknown-include-menu
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 semantic-decoration-on-unknown-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 "Unknown Include Menu"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 (list
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 "Unknown Include"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 ["What Is This?" semantic-decoration-unknown-include-describe
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 :help "Describe why this include has been marked this way." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 ["List all unknown includes" semanticdb-find-adebug-lost-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 :help "Show a list of all includes semantic cannot find for this file." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 ["Summarize includes current buffer" semantic-decoration-all-include-summary
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 :help "Show a summary for the current buffer containing this include." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 ["List found includes (load unparsed)" semanticdb-find-test-translate-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 :help "List all includes found for this file, and parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 ["List found includes (no loading)" semanticdb-find-test-translate-path-no-loading
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 :help "List all includes found for this file, do not parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 ["Customize System Include Path" semantic-customize-system-include-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 :active (get 'semantic-dependency-system-include-path major-mode)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 :help "Run customize for the system include path for this major mode." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 ["Add a System Include Path" semantic-add-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 ["Remove a System Include Path" semantic-remove-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 ;;; Includes that need to be parsed.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (defface semantic-decoration-on-unparsed-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 '((((class color) (background dark))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 (:background "#555500"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183 (((class color) (background light))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 (:background "#ffff55")))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185 "*Face used to show includes that have not yet been parsed.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 Used by the decoration style: `semantic-decoration-on-unparsed-includes'."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 :group 'semantic-faces)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 (defvar semantic-decoration-on-unparsed-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 (let ((km (make-sparse-keymap)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (define-key km semantic-decoratiton-mouse-3 'semantic-decoration-unparsed-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 km)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 "Keymap used on unparsed includes.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 (defvar semantic-decoration-on-unparsed-include-menu nil
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 "Menu used for unparsed include headers.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (easy-menu-define
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 semantic-decoration-on-unparsed-include-menu
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 semantic-decoration-on-unparsed-include-map
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202 "Unparsed Include Menu"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 (list
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 "Unparsed Include"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 ["What Is This?" semantic-decoration-unparsed-include-describe
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 :help "Describe why this include has been marked this way." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 ["Visit This Include" semantic-decoration-include-visit
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 :help "Visit this include file so that header file's tags can be used." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214 ["Parse This Include" semantic-decoration-unparsed-include-parse-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 :help "Parse this include file so that header file's tags can be used." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218 ["Parse All Includes" semantic-decoration-unparsed-include-parse-all-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 :help "Parse all the includes so the contents can be used." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
222 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223 ["Summarize includes current buffer" semantic-decoration-all-include-summary
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225 :help "Show a summary for the current buffer containing this include." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
227 ["List found includes (load unparsed)" semanticdb-find-test-translate-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 :help "List all includes found for this file, and parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231 ["List found includes (no loading)" semanticdb-find-test-translate-path-no-loading
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233 :help "List all includes found for this file, do not parse unparsed files." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235 ["List all unknown includes" semanticdb-find-adebug-lost-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237 :help "Show a list of all includes semantic cannot find for this file." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 "---"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 ["Customize System Include Path" semantic-customize-system-include-path
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241 :active (get 'semantic-dependency-system-include-path major-mode)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 :help "Run customize for the system include path for this major mode." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
243 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
244 ["Add a System Include Path" semantic-add-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
245 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 (semantic-menu-item
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 ["Remove a System Include Path" semantic-remove-system-include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
249 :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250 :help "Add an include path for this session." ])
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 ;;["" semantic-decoration-unparsed-include-
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 ;; :active t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253 ;; :help "" ]
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
255
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
257 ;;; MODES
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
258
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
259 ;;; Include statement Decorate Mode
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
260 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
261 ;; This mode handles the three states of an include statements
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
262 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
263 (define-semantic-decoration-style semantic-decoration-on-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
264 "Highlight class members that are includes.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
265 This mode provides a nice context menu on the include statements."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
266 :enabled t)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
267
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
268 (defun semantic-decoration-on-includes-p-default (tag)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
269 "Return non-nil if TAG has is an includes that can't be found."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
270 (semantic-tag-of-class-p tag 'include))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
271
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
272 (defun semantic-decoration-on-includes-highlight-default (tag)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
273 "Highlight the include TAG to show that semantic can't find it."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
274 (let* ((file (semantic-dependency-tag-file tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
275 (table (when file
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
276 (semanticdb-file-table-object file t)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
277 (face nil)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
278 (map nil)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
279 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
280 (cond
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
281 ((not file)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
282 ;; Cannot find this header.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
283 (setq face 'semantic-decoration-on-unknown-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
284 map semantic-decoration-on-unknown-include-map)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
286 ((and table (number-or-marker-p (oref table pointmax)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
287 ;; A found and parsed file.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
288 (setq face 'semantic-decoration-on-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289 map semantic-decoration-on-include-map)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291 (t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 ;; An unparsed file.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293 (setq face 'semantic-decoration-on-unparsed-includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
294 map semantic-decoration-on-unparsed-include-map)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
295 (when table
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296 ;; Set ourselves up for synchronization
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297 (semanticdb-cache-get
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
298 table 'semantic-decoration-unparsed-include-cache)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
299 ;; Add a dependancy.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 (let ((table semanticdb-current-table))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 (semanticdb-add-reference table tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
303 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304
110523
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
305 ;; @TODO - if not a tag w/ a position, we need to get one. How?
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
306
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
307 (when (semantic-tag-with-position-p tag)
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
308 (let ((ol (semantic-decorate-tag tag
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
309 (semantic-tag-start tag)
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
310 (semantic-tag-end tag)
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
311 face))
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
312 )
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
313 (semantic-overlay-put ol 'mouse-face 'highlight)
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
314 (semantic-overlay-put ol 'keymap map)
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
315 (semantic-overlay-put ol 'help-echo
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
316 "Header File : mouse-3 - Context menu")
a5ad4f188e19 Synch Semantic to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents: 106860
diff changeset
317 ))))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 ;;; Regular Include Functions
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 (defun semantic-decoration-include-describe ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322 "Describe what unparsed includes are in the current buffer.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 Argument EVENT is the mouse clicked event."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325 (let* ((tag (or (semantic-current-tag)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
326 (error "No tag under point")))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 (file (semantic-dependency-tag-file tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
328 (table (when file
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 (semanticdb-file-table-object file t))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330 (with-output-to-temp-buffer (help-buffer) ; "*Help*"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 (help-setup-xref (list #'semantic-decoration-include-describe)
106197
019d906c8f48 * cedet/srecode/map.el (srecode-get-maps):
Chong Yidong <cyd@stupidchicken.com>
parents: 105842
diff changeset
332 (called-interactively-p 'interactive))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 (princ "Include File: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334 (princ (semantic-format-tag-name tag nil t))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335 (princ "\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 (princ "This include file was found at:\n ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 (princ (semantic-dependency-tag-file tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 (princ "\n\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339 (princ "Semantic knows where this include file is, and has parsed
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 its contents.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 (let ((inc (semantic-find-tags-by-class 'include table))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344 (ok 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 (unknown 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
346 (unparsed 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 (all 0))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 (dolist (i inc)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
349 (let* ((fileinner (semantic-dependency-tag-file i))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 (cond ((not fileinner)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352 (setq unknown (1+ unknown)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
353 ((number-or-marker-p (oref table pointmax))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 (setq ok (1+ ok)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
355 (t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
356 (setq unparsed (1+ unparsed))))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
357 (setq all (+ ok unknown unparsed))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
358 (if (= 0 all)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
359 (princ "There are no other includes in this file.\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
360 (princ (format "There are %d more includes in this file.\n"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
361 all))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
362 (princ (format " Unknown Includes: %d\n" unknown))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
363 (princ (format " Unparsed Includes: %d\n" unparsed))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
364 (princ (format " Parsed Includes: %d\n" ok)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
365 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
366 ;; Get the semanticdb statement, and display it's contents.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
367 (princ "\nDetails for header file...\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
368 (princ "\nMajor Mode: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
369 (princ (oref table :major-mode))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
370 (princ "\nTags: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
371 (princ (format "%s entries" (length (oref table :tags))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
372 (princ "\nFile Size: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
373 (princ (format "%s chars" (oref table :pointmax)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
374 (princ "\nSave State: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
375 (cond ((oref table dirty)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
376 (princ "Table needs to be saved."))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
377 (t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
378 (princ "Table is saved on disk."))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
379 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
380 (princ "\nExternal References:")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
381 (dolist (r (oref table db-refs))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
382 (princ "\n ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
383 (princ (oref r file)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
384 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
385
104467
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
386 ;;;###autoload
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
387 (defun semantic-decoration-include-visit ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
388 "Visit the included file at point."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
389 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
390 (let ((tag (semantic-current-tag)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
391 (unless (eq (semantic-tag-class tag) 'include)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
392 (error "Point is not on an include tag"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
393 (let ((file (semantic-dependency-tag-file tag)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
394 (cond
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
395 ((or (not file) (not (file-exists-p file)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
396 (error "Could not location include %s"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
397 (semantic-tag-name tag)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
398 ((get-file-buffer file)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
399 (switch-to-buffer (get-file-buffer file)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
400 ((stringp file)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
401 (find-file file))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
402 ))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
403
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
404 (defun semantic-decoration-include-menu (event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
405 "Popup a menu that can help a user understand unparsed includes.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
406 Argument EVENT describes the event that caused this function to be called."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
407 (interactive "e")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
408 (let* ((startwin (selected-window))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
409 (win (semantic-event-window event))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
410 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
411 (select-window win t)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
412 (save-excursion
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
413 ;(goto-char (window-start win))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
414 (mouse-set-point event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
415 (sit-for 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
416 (semantic-popup-menu semantic-decoration-on-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
417 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
418 (select-window startwin)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
419
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
420
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
421 ;;; Unknown Include functions
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
422 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
423 (defun semantic-decoration-unknown-include-describe ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
424 "Describe what unknown includes are in the current buffer.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
425 Argument EVENT is the mouse clicked event."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
426 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
427 (let ((tag (semantic-current-tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
428 (mm major-mode))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
429 (with-output-to-temp-buffer (help-buffer) ; "*Help*"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
430 (help-setup-xref (list #'semantic-decoration-unknown-include-describe)
106197
019d906c8f48 * cedet/srecode/map.el (srecode-get-maps):
Chong Yidong <cyd@stupidchicken.com>
parents: 105842
diff changeset
431 (called-interactively-p 'interactive))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
432 (princ "Include File: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
433 (princ (semantic-format-tag-name tag nil t))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
434 (princ "\n\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
435 (princ "This header file has been marked \"Unknown\".
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
436 This means that Semantic has not been able to locate this file on disk.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
437
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
438 When Semantic cannot find an include file, this means that the
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
439 idle summary mode and idle completion modes cannot use the contents of
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
440 that file to provide coding assistance.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
441
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
442 If this is a system header and you want it excluded from Semantic's
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
443 searches (which may be desirable for speed reasons) then you can
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
444 safely ignore this state.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
445
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
446 If this is a system header, and you want to include it in Semantic's
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
447 searches, then you will need to use:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
448
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
449 M-x semantic-add-system-include RET /path/to/includes RET
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
450
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
451 or, in your .emacs file do:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
452
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
453 (semantic-add-system-include \"/path/to/include\" '")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
454 (princ (symbol-name mm))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
455 (princ ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
456
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
457 to add the path to Semantic's search.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
458
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
459 If this is an include file that belongs to your project, then you may
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
460 need to update `semanticdb-project-roots' or better yet, use `ede'
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
461 to manage your project. See the ede manual for projects that will
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
462 wrap existing project code for Semantic's benifit.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
463 ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
464
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
465 (when (or (eq mm 'c++-mode) (eq mm 'c-mode))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
466 (princ "
106860
4cf58c2379f4 Mario Lang <mlang@delysid.org>: Remove some duplicated words.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
467 For C/C++ includes located within a project, you can use a special
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
468 EDE project that will wrap an existing build system. You can do that
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
469 like this in your .emacs file:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
470
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
471 (ede-cpp-root-project \"NAME\" :file \"FILENAME\" :locate-fcn 'MYFCN)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
472
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
473 See the CEDET manual, the EDE manual, or the commentary in
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
474 ede-cpp-root.el for more.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
475
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
476 If you think this header tag is marked in error, you may need to do:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
477
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
478 C-u M-x bovinate RET
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
479
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
480 to refresh the tags in this buffer, and recalculate the state."))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
481
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
482 (princ "
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
483 See the Semantic manual node on SemanticDB for more about search paths.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
484 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
485
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
486 (defun semantic-decoration-unknown-include-menu (event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
487 "Popup a menu that can help a user understand unparsed includes.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
488 Argument EVENT describes the event that caused this function to be called."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
489 (interactive "e")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
490 (let* ((startwin (selected-window))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
491 ;; This line has an issue in XEmacs.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
492 (win (semantic-event-window event))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
493 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
494 (select-window win t)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
495 (save-excursion
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
496 ;(goto-char (window-start win))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
497 (mouse-set-point event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
498 (sit-for 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
499 (semantic-popup-menu semantic-decoration-on-unknown-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
500 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
501 (select-window startwin)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
502
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
503
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
504 ;;; Interactive parts of unparsed includes
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
505 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
506 (defun semantic-decoration-unparsed-include-describe ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
507 "Describe what unparsed includes are in the current buffer.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
508 Argument EVENT is the mouse clicked event."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
509 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
510 (let ((tag (semantic-current-tag)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
511 (with-output-to-temp-buffer (help-buffer); "*Help*"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
512 (help-setup-xref (list #'semantic-decoration-unparsed-include-describe)
106197
019d906c8f48 * cedet/srecode/map.el (srecode-get-maps):
Chong Yidong <cyd@stupidchicken.com>
parents: 105842
diff changeset
513 (called-interactively-p 'interactive))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
514
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
515 (princ "Include File: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
516 (princ (semantic-format-tag-name tag nil t))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
517 (princ "\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
518 (princ "This include file was found at:\n ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
519 (princ (semantic-dependency-tag-file tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
520 (princ "\n\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
521 (princ "This header file has been marked \"Unparsed\".
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
522 This means that Semantic has located this header file on disk
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
523 but has not yet opened and parsed this file.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
524
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
525 So long as this header file is unparsed, idle summary and
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
526 idle completion will not be able to reference the details in this
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
527 header.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
528
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
529 To resolve this, use the context menu to parse this include file,
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
530 or all include files referred to in ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
531 (princ (buffer-name))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
532 (princ ".
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
533 This can take a while in large projects.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
534
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
535 Alternately, you can call:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
536
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
537 M-x semanticdb-find-test-translate-path RET
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
538
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
539 to search path Semantic uses to perform completion.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
540
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
541
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
542 If you think this header tag is marked in error, you may need to do:
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
543
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
544 C-u M-x bovinate RET
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
545
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
546 to refresh the tags in this buffer, and recalculate the state.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
547 If you find a repeatable case where a header is marked in error,
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
548 report it to cedet-devel@lists.sf.net.") )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
549
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
550
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
551 (defun semantic-decoration-unparsed-include-menu (event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
552 "Popup a menu that can help a user understand unparsed includes.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
553 Argument EVENT describes the event that caused this function to be called."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
554 (interactive "e")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
555 (let* ((startwin (selected-window))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
556 (win (semantic-event-window event))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
557 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
558 (select-window win t)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
559 (save-excursion
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
560 ;(goto-char (window-start win))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
561 (mouse-set-point event)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
562 (sit-for 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
563 (semantic-popup-menu semantic-decoration-on-unparsed-include-menu)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
564 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
565 (select-window startwin)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
566
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
567 (defun semantic-decoration-unparsed-include-parse-include ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
568 "Parse the include file the user menu-selected from."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
569 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
570 (let* ((file (semantic-dependency-tag-file (semantic-current-tag))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
571 (semanticdb-file-table-object file)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
572 (semantic-decoration-unparsed-include-do-reset)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
573
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
574
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
575 (defun semantic-decoration-unparsed-include-parse-all-includes ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
576 "Parse the include file the user menu-selected from."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
577 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
578 (semanticdb-find-translate-path nil nil)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
579 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
580
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
581
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
582 ;;; General Includes Information
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
583 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
584 (defun semantic-decoration-all-include-summary ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
585 "Provide a general summary for the state of all includes."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
586 (interactive)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
587 (require 'semantic/dep)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
588 (let* ((table semanticdb-current-table)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
589 (tags (semantic-fetch-tags))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
590 (inc (semantic-find-tags-by-class 'include table))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
591 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
592 (with-output-to-temp-buffer (help-buffer) ;"*Help*"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
593 (help-setup-xref (list #'semantic-decoration-all-include-summary)
106197
019d906c8f48 * cedet/srecode/map.el (srecode-get-maps):
Chong Yidong <cyd@stupidchicken.com>
parents: 105842
diff changeset
594 (called-interactively-p 'interactive))
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
595
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
596 (princ "Include Summary for File: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
597 (princ (file-truename (buffer-file-name)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
598 (princ "\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
599
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
600 (when (oref table db-refs)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
601 (princ "\nExternal Database References to this buffer:")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
602 (dolist (r (oref table db-refs))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
603 (princ "\n ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
604 (princ (oref r file)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
605 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
606
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
607 (princ (format "\nThis file contains %d tags, %d of which are includes.\n"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
608 (length tags) (length inc)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
609 (let ((ok 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
610 (unknown 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
611 (unparsed 0)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
612 (all 0))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
613 (dolist (i inc)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
614 (let* ((fileinner (semantic-dependency-tag-file i))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
615 (tableinner (when fileinner
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
616 (semanticdb-file-table-object fileinner t))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
617 (cond ((not fileinner)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
618 (setq unknown (1+ unknown)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
619 ((number-or-marker-p (oref tableinner pointmax))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
620 (setq ok (1+ ok)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
621 (t
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
622 (setq unparsed (1+ unparsed))))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
623 (setq all (+ ok unknown unparsed))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
624 (when (not (= 0 all))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
625 (princ (format " Unknown Includes: %d\n" unknown))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
626 (princ (format " Unparsed Includes: %d\n" unparsed))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
627 (princ (format " Parsed Includes: %d\n" ok)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
628 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
629
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
630 (princ "\nInclude Path Summary:\n\n")
104456
6065d66f0c99 lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents: 104451
diff changeset
631 (when (and (boundp 'ede-object)
6065d66f0c99 lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents: 104451
diff changeset
632 (boundp 'ede-object-project)
6065d66f0c99 lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents: 104451
diff changeset
633 ede-object)
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
634 (princ " This file's project include search is handled by the EDE object:\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
635 (princ " Buffer Target: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
636 (princ (object-print ede-object))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
637 (princ "\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
638 (when (not (eq ede-object ede-object-project))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
639 (princ " Buffer Project: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
640 (princ (object-print ede-object-project))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
641 (princ "\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
642 )
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
643 (when ede-object-project
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
644 (let ((loc (ede-get-locator-object ede-object-project)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
645 (princ " Backup in-project Locator: ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
646 (princ (object-print loc))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
647 (princ "\n")))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
648 (let ((syspath (ede-system-include-path ede-object-project)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
649 (if (not syspath)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
650 (princ " EDE Project system include path: Empty\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
651 (princ " EDE Project system include path:\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
652 (dolist (dir syspath)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
653 (princ " ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
654 (princ dir)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
655 (princ "\n"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
656 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
657
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
658 (princ "\n This file's system include path is:\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
659 (dolist (dir semantic-dependency-system-include-path)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
660 (princ " ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
661 (princ dir)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
662 (princ "\n"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
663
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
664 (let ((unk semanticdb-find-lost-includes))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
665 (when unk
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
666 (princ "\nAll unknown includes:\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
667 (dolist (tag unk)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
668 (princ " ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
669 (princ (semantic-tag-name tag))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
670 (princ "\n"))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
671 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
672
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
673 (let* ((semanticdb-find-default-throttle
104470
6ccad1511df1 Minor whitespace changes and `require' fixes.
Chong Yidong <cyd@stupidchicken.com>
parents: 104467
diff changeset
674 (if (featurep 'semantic/db-find)
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
675 (remq 'unloaded semanticdb-find-default-throttle)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
676 nil))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
677 (path (semanticdb-find-translate-path nil nil)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
678 (if (<= (length path) (length inc))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
679 (princ "\nThere are currently no includes found recursively.\n")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
680 ;; List the full include list.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
681 (princ "\nSummary of all includes needed by ")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
682 (princ (buffer-name))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
683 (dolist (p path)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
684 (if (slot-boundp p 'tags)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
685 (princ (format "\n %s :\t%d tags, %d are includes. %s"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
686 (object-name-string p)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
687 (length (oref p tags))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
688 (length (semantic-find-tags-by-class
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
689 'include p))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
690 (cond
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
691 ((condition-case nil
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
692 (oref p dirty)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
693 (error nil))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
694 " dirty.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
695 ((not (number-or-marker-p (oref table pointmax)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
696 " Needs to be parsed.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
697 (t ""))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
698 (princ (format "\n %s :\tUnparsed"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
699 (object-name-string p))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
700 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
701 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
702
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
703
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
704 ;;; Unparsed Include Features
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
705 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
706 ;; This section handles changing states of unparsed include
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
707 ;; decorations base on what happens in other files.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
708 ;;
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
709
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
710 (defclass semantic-decoration-unparsed-include-cache (semanticdb-abstract-cache)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
711 ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
712 "Class used to reset decorated includes.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
713 When an include's referring file is parsed, we need to undecorate
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
714 any decorated referring includes.")
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
715
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
716
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
717 (defmethod semantic-reset ((obj semantic-decoration-unparsed-include-cache))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
718 "Reset OBJ back to it's empty settings."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
719 (let ((table (oref obj table)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
720 ;; This is a hack. Add in something better?
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
721 (semanticdb-notify-references
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
722 table (lambda (tab me)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
723 (semantic-decoration-unparsed-include-refrence-reset tab)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
724 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
725 ))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
726
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
727 (defmethod semanticdb-partial-synchronize ((cache semantic-decoration-unparsed-include-cache)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
728 new-tags)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
729 "Synchronize CACHE with some NEW-TAGS."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
730 (if (semantic-find-tags-by-class 'include new-tags)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
731 (semantic-reset cache)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
732
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
733 (defmethod semanticdb-synchronize ((cache semantic-decoration-unparsed-include-cache)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
734 new-tags)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
735 "Synchronize a CACHE with some NEW-TAGS."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
736 (semantic-reset cache))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
737
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
738 (defun semantic-decoration-unparsed-include-refrence-reset (table)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
739 "Refresh any highlighting in buffers referred to by TABLE.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
740 If TABLE is not in a buffer, do nothing."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
741 ;; This cache removal may seem odd in that we are "creating one", but
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
742 ;; since we cant get in the fcn unless one exists, this ought to be
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
743 ;; ok.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
744 (let ((c (semanticdb-cache-get
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
745 table 'semantic-decoration-unparsed-include-cache)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
746 (semanticdb-cache-remove table c))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
747
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
748 (let ((buf (semanticdb-in-buffer-p table)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
749 (when buf
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
750 (semantic-decorate-add-pending-decoration
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
751 'semantic-decoration-unparsed-include-do-reset
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
752 buf)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
753 )))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
754
104467
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
755 ;;;###autoload
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
756 (defun semantic-decoration-unparsed-include-do-reset ()
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
757 "Do a reset of unparsed includes in the current buffer."
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
758 (let* ((style (assoc "semantic-decoration-on-includes"
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
759 semantic-decoration-styles)))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
760 (when (cdr style)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
761 (let ((allinc (semantic-find-tags-included
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
762 (semantic-fetch-tags-fast))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
763 ;; This will do everything, but it should be speedy since it
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
764 ;; would have been done once already.
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
765 (semantic-decorate-add-decorations allinc)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
766 ))))
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
767
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
768
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
769 (provide 'semantic/decorate/include)
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
770
104467
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
771 ;; Local variables:
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
772 ;; generated-autoload-file: "../loaddefs.el"
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
773 ;; generated-autoload-load-name: "semantic/decorate/include"
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
774 ;; End:
fe04795ca590 lisp/cedet/semantic/decorate/include.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104456
diff changeset
775
105377
7f4c7f5c0eba Add arch tagline
Miles Bader <miles@gnu.org>
parents: 105334
diff changeset
776 ;; arch-tag: c3277137-be3f-43e2-af89-3b14b9bd7479
104451
2858c6bcc446 lisp/cedet/semantic/decorate/include.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
777 ;;; semantic/decorate/include.el ends here