aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-08-29 00:43:12 +0000
committerChong Yidong2009-08-29 00:43:12 +0000
commita175a831d33f56cce1793a7593fb14178118b117 (patch)
treeb4b2ab60212d84e39bf4ad3ef3efdd761bba97a4
parent1bd955357097f15170e159d24b4e20b3173b8335 (diff)
downloademacs-a175a831d33f56cce1793a7593fb14178118b117.tar.gz
emacs-a175a831d33f56cce1793a7593fb14178118b117.zip
* cedet/semantic/tag.el: Add declare-function statements for
semantic-current-tag, semantic-ctxt-current-mode, semantic-format-tag-prototype, and semantic-find-first-tag-by-name. Require semantic/lex. (semantic-obtain-foreign-tag, semantic-tag-p) (semantic-tag-alias-definition, semantic-tag-components) (semantic-tag-components-with-overlays) (semantic-insert-foreign-tag): Remove unnecessary autoloads. (semantic-tag-mode): Require semantic/find. (semantic--tag-find-parent-by-name): Require semantic/find. (semantic--tag-find-parent-by-name): Require semantic/analyze/fcn/ (semantic--tag-unlink-cache-from-buffer) (semantic--tag-link-cache-to-buffer): Require semantic. (semantic-foreign-tag): Require semantic/doc. (semantic-insert-foreign-tag-default, semantic-insert-foreign-tag): Require semantic/format.
-rw-r--r--lisp/cedet/semantic/tag.el30
1 files changed, 22 insertions, 8 deletions
diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el
index f46eae99c38..ca4669bc0ea 100644
--- a/lisp/cedet/semantic/tag.el
+++ b/lisp/cedet/semantic/tag.el
@@ -50,6 +50,18 @@
50 50
51;; Keep this only so long as we have obsolete fcns. 51;; Keep this only so long as we have obsolete fcns.
52(require 'semantic/fw) 52(require 'semantic/fw)
53(require 'semantic/lex)
54
55(declare-function semantic-current-tag "semantic/find")
56(declare-function semantic-find-first-tag-by-name "semantic/find")
57(declare-function semantic-ctxt-current-mode "semantic/ctxt")
58(declare-function semantic-analyze-split-name "semantic/analyze/fcn")
59(declare-function semantic-fetch-tags "semantic")
60(declare-function semantic-clear-toplevel-cache "semantic")
61(declare-function semantic-documentation-for-tag "semantic/doc")
62(declare-function semantic-format-tag-prototype "semantic/format")
63(declare-function semantic-format-tag-summarize "semantic/format")
64(declare-function semantic-format-tag-name "semantic/format")
53 65
54(defconst semantic-tag-version semantic-version 66(defconst semantic-tag-version semantic-version
55 "Version string of semantic tags made with this code.") 67 "Version string of semantic tags made with this code.")
@@ -207,6 +219,7 @@ If TAG has a :mode property return it.
207If point is inside TAG bounds, return the major mode active at point. 219If point is inside TAG bounds, return the major mode active at point.
208Return the major mode active at beginning of TAG otherwise. 220Return the major mode active at beginning of TAG otherwise.
209See also the function `semantic-ctxt-current-mode'." 221See also the function `semantic-ctxt-current-mode'."
222 (require 'semantic/find)
210 (or tag (setq tag (semantic-current-tag))) 223 (or tag (setq tag (semantic-current-tag)))
211 (or (semantic--tag-get-property tag :mode) 224 (or (semantic--tag-get-property tag :mode)
212 (let ((buffer (semantic-tag-buffer tag)) 225 (let ((buffer (semantic-tag-buffer tag))
@@ -308,8 +321,6 @@ If TAG is unlinked, but has a :filename property, then that is used."
308 (semantic--tag-get-property tag :filename)))) 321 (semantic--tag-get-property tag :filename))))
309 322
310;;; Tag tests and comparisons. 323;;; Tag tests and comparisons.
311;;
312;;;###autoload
313(defsubst semantic-tag-p (tag) 324(defsubst semantic-tag-p (tag)
314 "Return non-nil if TAG is most likely a semantic tag." 325 "Return non-nil if TAG is most likely a semantic tag."
315 (condition-case nil 326 (condition-case nil
@@ -810,10 +821,12 @@ refers to that parent by name, then the :parent attribute should be used."
810 "Find the superclass NAME in the list of SUPERS. 821 "Find the superclass NAME in the list of SUPERS.
811If a simple search doesn't do it, try splitting up the names 822If a simple search doesn't do it, try splitting up the names
812in SUPERS." 823in SUPERS."
824 (require 'semantic/find)
813 (let ((stag nil)) 825 (let ((stag nil))
814 (setq stag (semantic-find-first-tag-by-name name supers)) 826 (setq stag (semantic-find-first-tag-by-name name supers))
815 827
816 (when (not stag) 828 (when (not stag)
829 (require 'semantic/analyze/fcn)
817 (dolist (S supers) 830 (dolist (S supers)
818 (let* ((sname (semantic-tag-name S)) 831 (let* ((sname (semantic-tag-name S))
819 (splitparts (semantic-analyze-split-name sname)) 832 (splitparts (semantic-analyze-split-name sname))
@@ -947,7 +960,6 @@ ATTRIBUTES is a list of additional attributes belonging to this tag."
947 "Return the class of tag TAG is an alias." 960 "Return the class of tag TAG is an alias."
948 (semantic-tag-get-attribute tag :aliasclass)) 961 (semantic-tag-get-attribute tag :aliasclass))
949 962
950;;;###autoload
951(define-overloadable-function semantic-tag-alias-definition (tag) 963(define-overloadable-function semantic-tag-alias-definition (tag)
952 "Return the definition TAG is an alias. 964 "Return the definition TAG is an alias.
953The returned value is a tag of the class that 965The returned value is a tag of the class that
@@ -960,7 +972,6 @@ Return nil if TAG is not of class 'alias."
960 972
961;;; Language Specific Tag access via overload 973;;; Language Specific Tag access via overload
962;; 974;;
963;;;###autoload
964(define-overloadable-function semantic-tag-components (tag) 975(define-overloadable-function semantic-tag-components (tag)
965 "Return a list of components for TAG. 976 "Return a list of components for TAG.
966A Component is a part of TAG which itself may be a TAG. 977A Component is a part of TAG which itself may be a TAG.
@@ -978,7 +989,6 @@ Perform the described task in `semantic-tag-components'."
978 (semantic-tag-function-arguments tag)) 989 (semantic-tag-function-arguments tag))
979 (t nil))) 990 (t nil)))
980 991
981;;;###autoload
982(define-overloadable-function semantic-tag-components-with-overlays (tag) 992(define-overloadable-function semantic-tag-components-with-overlays (tag)
983 "Return the list of top level components belonging to TAG. 993 "Return the list of top level components belonging to TAG.
984Children are any sub-tags which contain overlays. 994Children are any sub-tags which contain overlays.
@@ -1160,6 +1170,7 @@ This function is for internal use only."
1160(defun semantic--tag-unlink-cache-from-buffer () 1170(defun semantic--tag-unlink-cache-from-buffer ()
1161 "Convert all tags in the current cache to use overlay proxys. 1171 "Convert all tags in the current cache to use overlay proxys.
1162This function is for internal use only." 1172This function is for internal use only."
1173 (require 'semantic)
1163 (semantic--tag-unlink-list-from-buffer 1174 (semantic--tag-unlink-list-from-buffer
1164 ;; @todo- use fetch-tags-fast? 1175 ;; @todo- use fetch-tags-fast?
1165 (semantic-fetch-tags))) 1176 (semantic-fetch-tags)))
@@ -1169,6 +1180,7 @@ This function is for internal use only."
1169(defun semantic--tag-link-cache-to-buffer () 1180(defun semantic--tag-link-cache-to-buffer ()
1170 "Convert all tags in the current cache to use overlays. 1181 "Convert all tags in the current cache to use overlays.
1171This function is for internal use only." 1182This function is for internal use only."
1183 (require 'semantic)
1172 (condition-case nil 1184 (condition-case nil
1173 ;; In this unique case, we cannot call the usual toplevel fn. 1185 ;; In this unique case, we cannot call the usual toplevel fn.
1174 ;; because we don't want a reparse, we want the old overlays. 1186 ;; because we don't want a reparse, we want the old overlays.
@@ -1289,6 +1301,7 @@ Signal an error if not."
1289 "Return a copy of TAG as a foreign tag, or nil if it can't be done. 1301 "Return a copy of TAG as a foreign tag, or nil if it can't be done.
1290TAG defaults to the tag at point in current buffer. 1302TAG defaults to the tag at point in current buffer.
1291See also `semantic-foreign-tag-p'." 1303See also `semantic-foreign-tag-p'."
1304 (require 'semantic/doc)
1292 (or tag (setq tag (semantic-current-tag))) 1305 (or tag (setq tag (semantic-current-tag)))
1293 (when (semantic-tag-p tag) 1306 (when (semantic-tag-p tag)
1294 (let ((ftag (semantic-tag-copy tag nil t)) 1307 (let ((ftag (semantic-tag-copy tag nil t))
@@ -1305,8 +1318,6 @@ See also `semantic-foreign-tag-p'."
1305 ftag)))) 1318 ftag))))
1306 1319
1307;; High level obtain/insert foreign tag overloads 1320;; High level obtain/insert foreign tag overloads
1308;;
1309;;;###autoload
1310(define-overloadable-function semantic-obtain-foreign-tag (&optional tag) 1321(define-overloadable-function semantic-obtain-foreign-tag (&optional tag)
1311 "Obtain a foreign tag from TAG. 1322 "Obtain a foreign tag from TAG.
1312TAG defaults to the tag at point in current buffer. 1323TAG defaults to the tag at point in current buffer.
@@ -1319,13 +1330,14 @@ The default behavior assumes the current buffer is a language file,
1319and attempts to insert a prototype/function call." 1330and attempts to insert a prototype/function call."
1320 ;; Long term goal: Have a mechanism for a tempo-like template insert 1331 ;; Long term goal: Have a mechanism for a tempo-like template insert
1321 ;; for the given tag. 1332 ;; for the given tag.
1333 (require 'semantic/format)
1322 (insert (semantic-format-tag-prototype foreign-tag))) 1334 (insert (semantic-format-tag-prototype foreign-tag)))
1323 1335
1324;;;###autoload
1325(define-overloadable-function semantic-insert-foreign-tag (foreign-tag) 1336(define-overloadable-function semantic-insert-foreign-tag (foreign-tag)
1326 "Insert FOREIGN-TAG into the current buffer. 1337 "Insert FOREIGN-TAG into the current buffer.
1327Signal an error if FOREIGN-TAG is not a valid foreign tag. 1338Signal an error if FOREIGN-TAG is not a valid foreign tag.
1328This function is overridable with the symbol `insert-foreign-tag'." 1339This function is overridable with the symbol `insert-foreign-tag'."
1340 (require 'semantic/format)
1329 (semantic-foreign-tag-check foreign-tag) 1341 (semantic-foreign-tag-check foreign-tag)
1330 (:override) 1342 (:override)
1331 (message (semantic-format-tag-summarize foreign-tag))) 1343 (message (semantic-format-tag-summarize foreign-tag)))
@@ -1334,11 +1346,13 @@ This function is overridable with the symbol `insert-foreign-tag'."
1334(define-mode-local-override semantic-insert-foreign-tag 1346(define-mode-local-override semantic-insert-foreign-tag
1335 log-edit-mode (foreign-tag) 1347 log-edit-mode (foreign-tag)
1336 "Insert foreign tags into log-edit mode." 1348 "Insert foreign tags into log-edit mode."
1349 (require 'semantic/format)
1337 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): "))) 1350 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): ")))
1338 1351
1339(define-mode-local-override semantic-insert-foreign-tag 1352(define-mode-local-override semantic-insert-foreign-tag
1340 change-log-mode (foreign-tag) 1353 change-log-mode (foreign-tag)
1341 "Insert foreign tags into log-edit mode." 1354 "Insert foreign tags into log-edit mode."
1355 (require 'semantic/format)
1342 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): "))) 1356 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): ")))
1343 1357
1344 1358