summaryrefslogtreecommitdiff
path: root/lisp/cedet
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet')
-rw-r--r--lisp/cedet/semantic/db-debug.el1
-rw-r--r--lisp/cedet/semantic/db-ebrowse.el1
-rw-r--r--lisp/cedet/semantic/db-el.el7
-rw-r--r--lisp/cedet/semantic/db-file.el47
-rw-r--r--lisp/cedet/semantic/db-find.el31
-rw-r--r--lisp/cedet/semantic/db-global.el20
-rw-r--r--lisp/cedet/semantic/db-javascript.el10
-rw-r--r--lisp/cedet/semantic/db-mode.el16
-rw-r--r--lisp/cedet/semantic/db-ref.el20
-rw-r--r--lisp/cedet/semantic/db-typecache.el6
-rw-r--r--lisp/cedet/semantic/db.el22
11 files changed, 127 insertions, 54 deletions
diff --git a/lisp/cedet/semantic/db-debug.el b/lisp/cedet/semantic/db-debug.el
index 52ae605f6a0..cf188af8323 100644
--- a/lisp/cedet/semantic/db-debug.el
+++ b/lisp/cedet/semantic/db-debug.el
@@ -26,7 +26,6 @@
(require 'data-debug)
(require 'semantic/db)
-(require 'semantic/db-mode)
(require 'semantic/format)
;;; Code:
diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el
index 96f8285e508..bccd6748a20 100644
--- a/lisp/cedet/semantic/db-ebrowse.el
+++ b/lisp/cedet/semantic/db-ebrowse.el
@@ -56,7 +56,6 @@
(require 'eieio-opt)
)
(require 'semantic/db-file)
-(require 'semantic/db-mode)
(require 'semantic/find)
(require 'semantic/sort)
(require 'data-debug)
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 3db6c15570e..e1459f259cc 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -1,4 +1,4 @@
-;;; db-el.el --- Semantic database extensions for Emacs Lisp
+;;; semantic/db-el.el --- Semantic database extensions for Emacs Lisp
;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;;; Free Software Foundation, Inc.
@@ -31,7 +31,8 @@
;; to also work in Emacs Lisp with no compromises.
;;
-(require 'semantic/db-search)
+(require 'semantic/db)
+
(eval-when-compile
;; For generic function searching.
(require 'eieio)
@@ -340,4 +341,4 @@ Return a list of tags."
(provide 'semantic/db-el)
-;;; semanticdb-el.el ends here
+;;; semantic/db-el.el ends here
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index a16f9bbf14a..12cadc43c61 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -1,4 +1,4 @@
-;;; db-file.el --- Save a semanticdb to a cache file.
+;;; semantic/db-file.el --- Save a semanticdb to a cache file.
;;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
;;; Free Software Foundation, Inc.
@@ -147,9 +147,11 @@ If DIRECTORY doesn't exist, create a new one."
db))
;;; File IO
+
+(declare-function inversion-test "inversion")
+
(defun semanticdb-load-database (filename)
"Load the database FILENAME."
- (require 'inversion)
(condition-case foo
(let* ((r (eieio-persistent-read filename))
(c (semanticdb-get-database-tables r))
@@ -160,23 +162,26 @@ If DIRECTORY doesn't exist, create a new one."
(while c
(oset (car c) parent-db r)
(setq c (cdr c)))
- (if (not (inversion-test 'semanticdb-file fv))
- (when (inversion-test 'semantic-tag tv)
- ;; Incompatible version. Flush tables.
- (semanticdb-flush-database-tables r)
- ;; Reset the version to new version.
- (oset r semantic-tag-version semantic-tag-version)
- ;; Warn user
- (message "Semanticdb file is old. Starting over for %s"
- filename)
- )
- ;; Version is not ok. Flush whole system
- (message "semanticdb file is old. Starting over for %s"
- filename)
- ;; This database is so old, we need to replace it.
- ;; We also need to delete it from the instance tracker.
- (delete-instance r)
- (setq r nil))
+ (unless (and (equal semanticdb-file-version fv)
+ (equal semantic-tag-version tv))
+ ;; Try not to load inversion unless we need it:
+ (require 'inversion)
+ (if (not (inversion-test 'semanticdb-file fv))
+ (when (inversion-test 'semantic-tag tv)
+ ;; Incompatible version. Flush tables.
+ (semanticdb-flush-database-tables r)
+ ;; Reset the version to new version.
+ (oset r semantic-tag-version semantic-tag-version)
+ ;; Warn user
+ (message "Semanticdb file is old. Starting over for %s"
+ filename))
+ ;; Version is not ok. Flush whole system
+ (message "semanticdb file is old. Starting over for %s"
+ filename)
+ ;; This database is so old, we need to replace it.
+ ;; We also need to delete it from the instance tracker.
+ (delete-instance r)
+ (setq r nil)))
r)
(error (message "Cache Error: [%s] %s, Restart"
filename foo)
@@ -262,6 +267,8 @@ Live files are either buffers in Emacs, or files existing on the filesystem."
This variable is set to nil after the first error is encountered
to prevent overload.")
+(declare-function data-debug-insert-thing "data-debug")
+
(defmethod object-write ((obj semanticdb-table))
"When writing a table, we have to make sure we deoverlay it first.
Restore the overlays after writting.
@@ -435,4 +442,4 @@ Optional NOERROR prevents errors from being displayed."
(provide 'semantic/db-file)
-;;; semanticdb-file.el ends here
+;;; semantic/db-file.el ends here
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index 681b7d2066c..d81d5c1cadd 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -121,7 +121,20 @@
(require 'eieio)
)
+(require 'semantic/find)
+
+(require 'semantic/tag-file)
+(require 'semantic/sort)
+
;;; Code:
+
+(defvar data-debug-thing-alist)
+(declare-function data-debug-insert-stuff-list "data-debug")
+(declare-function data-debug-insert-tag-list "data-debug")
+(declare-function semantic-scope-reset-cache "semantic/scope")
+(declare-function semanticdb-typecache-notify-reset "semantic/db-typecache")
+(declare-function ede-current-project "ede")
+
(defvar semanticdb-find-throttle-custom-list
'(repeat (radio (const 'local)
(const 'project)
@@ -132,6 +145,7 @@
"Customization values for semanticdb find throttle.
See `semanticdb-find-throttle' for details.")
+;;;###autoload
(defcustom semanticdb-find-default-throttle
'(local project unloaded system recursive)
"The default throttle for `semanticdb-find' routines.
@@ -188,6 +202,7 @@ This class will cache data derived during various searches.")
(defmethod semantic-reset ((idx semanticdb-find-search-index))
"Reset the object IDX."
+ (require 'semantic/scope)
;; Clear the include path.
(oset idx include-path nil)
(when (oref idx type-cache)
@@ -233,6 +248,7 @@ This class will cache data derived during various searches.")
(let ((tab-idx (semanticdb-get-table-index tab)))
;; Not a full reset?
(when (oref tab-idx type-cache)
+ (require 'db-typecache)
(semanticdb-typecache-notify-reset
(oref tab-idx type-cache)))
)))
@@ -300,6 +316,13 @@ Default action as described in `semanticdb-find-translate-path'."
(semanticdb-find-translate-path-brutish-default path)
(semanticdb-find-translate-path-includes-default path))))
+(define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
+ "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
+INCLUDETAG is a semantic TAG of class 'include.
+TABLE is a semanticdb table that identifies where INCLUDETAG came from.
+TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
+ )
+
(defun semanticdb-find-translate-path-brutish-default (path)
"Translate PATH into a list of semantic tables.
Default action as described in `semanticdb-find-translate-path'."
@@ -582,13 +605,6 @@ isn't in memory yet."
"Load an unloaded file in FILENAME using the default semanticdb loader."
(semanticdb-file-table-object filename))
-(define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
- "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
-INCLUDETAG is a semantic TAG of class 'include.
-TABLE is a semanticdb table that identifies where INCLUDETAG came from.
-TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
- )
-
(defun semanticdb-find-table-for-include-default (includetag &optional table)
"Default implementation of `semanticdb-find-table-for-include'.
Uses `semanticdb-current-database-list' as the search path.
@@ -1079,7 +1095,6 @@ Returns result."
(semanticdb-find-log-move-to-end)))
;;; Semanticdb find API functions
-;;
;; These are the routines actually used to perform searches.
;;
(defun semanticdb-find-tags-collector (function &optional path find-file-match
diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el
index 1677f574cea..373b0df8963 100644
--- a/lisp/cedet/semantic/db-global.el
+++ b/lisp/cedet/semantic/db-global.el
@@ -29,7 +29,7 @@
;;
(require 'cedet-global)
-(require 'semantic/db-search)
+(require 'semantic/db-find)
(require 'semantic/symref/global)
(eval-when-compile
@@ -37,7 +37,13 @@
(require 'eieio)
(require 'eieio-opt)
)
+
;;; Code:
+
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-thing result "data-debug")
+
+
(defun semanticdb-enable-gnu-global-databases (mode)
"Enable the use of the GNU Global SemanticDB back end for all files of MODE.
This will add an instance of a GNU Global database to each buffer
@@ -67,6 +73,12 @@ in a GNU Global supported hierarchy."
MODE is the major mode to support."
(semanticdb-enable-gnu-global-in-buffer t))
+(defclass semanticdb-project-database-global
+ ;; @todo - convert to one DB per directory.
+ (semanticdb-project-database eieio-instance-tracker)
+ ()
+ "Database representing a GNU Global tags file.")
+
(defun semanticdb-enable-gnu-global-in-buffer (&optional dont-err-if-not-available)
"Enable a GNU Global database in the current buffer.
Argument DONT-ERR-IF-NOT-AVAILABLE will throw an error if GNU Global
@@ -94,12 +106,6 @@ is not available for this directory."
)
"A table for returning search results from GNU Global.")
-(defclass semanticdb-project-database-global
- ;; @todo - convert to one DB per directory.
- (semanticdb-project-database eieio-instance-tracker)
- ()
- "Database representing a GNU Global tags file.")
-
(defmethod semanticdb-equivalent-mode ((table semanticdb-table-global) &optional buffer)
"Return t, pretend that this table's mode is equivalent to BUFFER.
Equivalent modes are specified by by `semantic-equivalent-major-modes'
diff --git a/lisp/cedet/semantic/db-javascript.el b/lisp/cedet/semantic/db-javascript.el
index dca2c38d4a6..02c089e6ee9 100644
--- a/lisp/cedet/semantic/db-javascript.el
+++ b/lisp/cedet/semantic/db-javascript.el
@@ -1,4 +1,4 @@
-;;; db-javascript.el --- Semantic database extensions for javascript
+;;; semantic/db-javascript.el --- Semantic database extensions for javascript
;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
;;; Free Software Foundation, Inc.
@@ -29,7 +29,9 @@
;; the list of tags.
;;
-(require 'semantic/db-search)
+(require 'semantic/db)
+(require 'semantic/db-find)
+
(eval-when-compile
;; For generic function searching.
(require 'eieio)
@@ -305,6 +307,6 @@ Return a list of tags."
;; function encodeURIComponent (uriComponent){}
-(provide 'semantic/db-el)
+(provide 'semantic/db-javascript)
-;;; semanticdb-el.el ends here
+;;; semantic/db-javascript.el ends here
diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el
index f1baf920ff8..b34fd0b99a5 100644
--- a/lisp/cedet/semantic/db-mode.el
+++ b/lisp/cedet/semantic/db-mode.el
@@ -25,13 +25,17 @@
(require 'semantic/db)
;;; Code:
-(defvar semanticdb-current-database nil
- "For a given buffer, this is the currently active database.")
-(make-variable-buffer-local 'semanticdb-current-database)
-(defvar semanticdb-current-table nil
- "For a given buffer, this is the currently active database table.")
-(make-variable-buffer-local 'semanticdb-current-table)
+;; Moved into semantic/db.el:
+;; (defvar semanticdb-current-database nil
+;; "For a given buffer, this is the currently active database.")
+;; (make-variable-buffer-local 'semanticdb-current-database)
+
+;; (defvar semanticdb-current-table nil
+;; "For a given buffer, this is the currently active database table.")
+;; (make-variable-buffer-local 'semanticdb-current-table)
+
+(declare-function semantic-lex-spp-set-dynamic-table "semantic/lex-spp")
(defcustom semanticdb-global-mode nil
"*If non-nil enable the use of `semanticdb-minor-mode'."
diff --git a/lisp/cedet/semantic/db-ref.el b/lisp/cedet/semantic/db-ref.el
index 62faf9933c2..45f87edbc6e 100644
--- a/lisp/cedet/semantic/db-ref.el
+++ b/lisp/cedet/semantic/db-ref.el
@@ -1,4 +1,4 @@
-;;; db-ref.el --- Handle cross-db file references
+;;; semantic/db-ref.el --- Handle cross-db file references
;;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -36,6 +36,16 @@
;;; Code:
+(require 'eieio)
+(require 'semantic/db)
+(require 'semantic/util)
+
+(defvar semanticdb-find-default-throttle)
+
+;; For the semantic-find-tags-by-name-regexp macro.
+(eval-when-compile (require 'semantic/find))
+(defvar semantic-case-fold)
+
(defmethod semanticdb-add-reference ((dbt semanticdb-abstract-table)
include-tag)
"Add a reference for the database table DBT based on INCLUDE-TAG.
@@ -137,11 +147,17 @@ DBT, the second argument is DBT."
(i-include :initarg :i-include))
"Simple class to allow ADEBUG to show a nice list.")
+(defvar semanticdb-current-table)
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-object-slots "data-debug")
+
(defun semanticdb-ref-test (refresh)
"Dump out the list of references for the current buffer.
If REFRESH is non-nil, cause the current table to have it's references
refreshed before dumping the result."
(interactive "p")
+ (require 'data-debug)
+ (require 'semantic/db)
;; If we need to refresh... then do so.
(when refresh
(semanticdb-refresh-references semanticdb-current-table))
@@ -158,4 +174,4 @@ refreshed before dumping the result."
)
(provide 'semantic/db-ref)
-;;; semanticdb-ref.el ends here
+;;; semantic/db-ref.el ends here
diff --git a/lisp/cedet/semantic/db-typecache.el b/lisp/cedet/semantic/db-typecache.el
index 689e6d903f0..a0827ee0feb 100644
--- a/lisp/cedet/semantic/db-typecache.el
+++ b/lisp/cedet/semantic/db-typecache.el
@@ -30,6 +30,12 @@
(require 'semantic/db)
(require 'semantic/db-find)
+(require 'semantic/tag-ls)
+(require 'semantic/analyze/fcn)
+(require 'semantic/scope)
+
+(declare-function data-debug-insert-thing "data-debug")
+(declare-function data-debug-new-buffer "data-debug")
;;; Code:
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 807b7b3cfb0..ea8bcc91957 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -1,4 +1,4 @@
-;;; db.el --- Semantic tag database manager
+;;; semantic/db.el --- Semantic tag database manager
;;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
;;; 2008, 2009 Free Software Foundation, Inc.
@@ -59,6 +59,13 @@ mechanism.")
This can be changed to try out new types of search indicies.")
(make-variable-buffer-local 'semanticdb-default-find=index-class)
+(defvar semanticdb-current-database nil
+ "For a given buffer, this is the currently active database.")
+(make-variable-buffer-local 'semanticdb-current-database)
+
+(defvar semanticdb-current-table nil
+ "For a given buffer, this is the currently active database table.")
+(make-variable-buffer-local 'semanticdb-current-table)
;;; ABSTRACT CLASSES
;;
@@ -151,6 +158,17 @@ Adds the number of tags in this file to the object print name."
)
strings)))
+(defclass semanticdb-search-results-table (semanticdb-abstract-table)
+ ( )
+ "Table used for search results when there is no file or table association.
+Examples include search results from external sources such as from
+Emacs' own symbol table, or from external libraries.")
+
+(defmethod semanticdb-refresh-table ((obj semanticdb-search-results-table) &optional force)
+ "If the tag list associated with OBJ is loaded, refresh it.
+This will call `semantic-fetch-tags' if that file is in memory."
+ nil)
+
;;; Index Cache
;;
(defclass semanticdb-abstract-search-index ()
@@ -986,4 +1004,4 @@ If file does not have tags available, then load the file, and create them."
(provide 'semantic/db)
-;;; semanticdb.el ends here
+;;; semantic/db.el ends here