summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/util.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/semantic/util.el')
-rw-r--r--lisp/cedet/semantic/util.el30
1 files changed, 24 insertions, 6 deletions
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el
index 6b13c41cfe2..6cae8a8bdf9 100644
--- a/lisp/cedet/semantic/util.el
+++ b/lisp/cedet/semantic/util.el
@@ -54,6 +54,8 @@ Equivalent modes share a parser, and a set of override methods.
A value of nil means that the current major mode is the only one.")
(make-variable-buffer-local 'semantic-equivalent-major-modes)
+(declare-function semanticdb-file-stream "semantic/db" (file))
+
;; These semanticdb calls will throw warnings in the byte compiler.
;; Doing the right thing to make them available at compile time
;; really messes up the compilation sequence.
@@ -80,6 +82,11 @@ If FILE is not loaded, and semanticdb is not available, find the file
(semantic-alias-obsolete 'semantic-file-token-stream
'semantic-file-tag-table "23.2")
+(declare-function semanticdb-abstract-table-child-p "semantic/db" (obj) t)
+(declare-function semanticdb-refresh-table "semantic/db")
+(declare-function semanticdb-get-tags "semantic/db" (arg &rest args) t)
+(declare-function semanticdb-find-results-p "semantic/db-find" (resultp))
+
(defun semantic-something-to-tag-table (something)
"Convert SOMETHING into a semantic tag table.
Something can be a tag with a valid BUFFER property, a tag table, a
@@ -112,7 +119,7 @@ buffer, or a filename. If SOMETHING is nil return nil."
((and (featurep 'semantic/db)
(require 'semantic/db-mode)
(semanticdb-minor-mode-p)
- (semanticdb-abstract-table-child-p something))
+ (cl-typep something 'semanticdb-abstract-table))
(semanticdb-refresh-table something)
(semanticdb-get-tags something))
;; Semanticdb find-results
@@ -140,6 +147,11 @@ buffer, or a filename. If SOMETHING is nil return nil."
(defvar semantic-read-symbol-history nil
"History for a symbol read.")
+(declare-function semantic-brute-find-tag-by-function
+ "semantic/find"
+ (function streamorbuffer
+ &optional search-parts search-includes))
+
(defun semantic-read-symbol (prompt &optional default stream filter)
"Read a symbol name from the user for the current buffer.
PROMPT is the prompt to use.
@@ -154,6 +166,7 @@ FILTER must be a function to call on each element."
(setq stream
(if filter
(semantic--find-tags-by-function filter stream)
+ (require 'semantic/find)
(semantic-brute-find-tag-standard stream)))
(if (and default (string-match ":" prompt))
(setq prompt
@@ -315,8 +328,8 @@ If TAG is not specified, use the tag at point."
(if (semantic-tag-p tok)
(if (semantic-tag-with-position-p tok)
(let ((o (semantic-tag-overlay tok)))
- (if (and (semantic-overlay-p o)
- (not (semantic-overlay-live-p o)))
+ (if (and (overlayp o)
+ (not (overlay-buffer o)))
(let ((debug-on-error t))
(error "Tag %s is invalid!" (semantic-tag-name tok)))
;; else, tag is OK.
@@ -335,7 +348,7 @@ NOTFIRST indicates that this was not the first call in the recursive use."
(interactive)
(if (and (not cache) (not over) (not notfirst))
(setq cache semantic--buffer-cache
- over (semantic-overlays-in (point-min) (point-max))))
+ over (overlays-in (point-min) (point-max))))
(while cache
(let ((chil (semantic-tag-components-with-overlays (car cache))))
(if (not (memq (semantic-tag-overlay (car cache)) over))
@@ -348,8 +361,8 @@ NOTFIRST indicates that this was not the first call in the recursive use."
;; Strip out all overlays which aren't semantic overlays
(let ((o nil))
(while over
- (when (and (semantic-overlay-get (car over) 'semantic)
- (not (eq (semantic-overlay-get (car over) 'semantic)
+ (when (and (overlay-get (car over) 'semantic)
+ (not (eq (overlay-get (car over) 'semantic)
'unmatched)))
(setq o (cons (car over) o)))
(setq over (cdr over)))
@@ -367,6 +380,11 @@ NOTFIRST indicates that this was not the first call in the recursive use."
;; Symbol completion
+(declare-function semanticdb-fast-strip-find-results
+ "semantic/db-find" (results))
+(declare-function semanticdb-deep-find-tags-for-completion
+ "semantic/db-find" (prefix &optional path find-file-match))
+
(defun semantic-find-tag-for-completion (prefix)
"Find all tags with name starting with PREFIX.
This uses `semanticdb' when available."