]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/db-global.el
* files.el (auto-mode-alist): Use emacs-lisp-mode for Project.ede.
[gnu-emacs] / lisp / cedet / semantic / db-global.el
index 1677f574cea86fb1e8a4a4560aa593e0d639913a..c45ed16eabfccf223d735ce4150e237c82b52f9a 100644 (file)
@@ -29,7 +29,7 @@
 ;;
 
 (require 'cedet-global)
-(require 'semantic/db-search)
+(require 'semantic/db-find)
 (require 'semantic/symref/global)
 
 (eval-when-compile
   (require 'eieio)
   (require 'eieio-opt)
   )
+
 ;;; Code:
+
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-thing result "data-debug")
+
+;;;###autoload
 (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'
@@ -156,7 +162,6 @@ Return a list of tags."
 Optional argument TAGS is a list of tags to search.
 Return a list of tags."
   (if tags (call-next-method)
-    ;; YOUR IMPLEMENTATION HERE
     (let* ((semantic-symref-tool 'global)
           (result (semantic-symref-find-tags-by-regexp regex 'project))
           )
@@ -211,38 +216,12 @@ Optional argument TAGS is a list of tags to search.
 Like `semanticdb-find-tags-for-completion-method' for global."
   (semanticdb-find-tags-for-completion-method table prefix tags))
 
-;;; TEST
-;;
-;; Here is a testing fcn to try out searches via the GNU Global database.
-(defvar semanticdb-test-gnu-global-startfile "~/src/global-5.7.3/global/global.c"
-  "File to use for testing.")
-
-(defun semanticdb-test-gnu-global (searchfor &optional standardfile)
-  "Test the GNU Global semanticdb.
-Argument SEARCHFOR is the text to search for.
-If optional arg STANDARDFILE is non nil, use a standard file w/ global enabled."
-  (interactive "sSearch For Tag: \nP")
-
-  (require 'data-debug)
-  (save-excursion
-    (when standardfile
-      (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile)))
-
-    (condition-case err
-       (semanticdb-enable-gnu-global-in-buffer)
-      (error (if standardfile
-                (error err)
-              (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile))
-              (semanticdb-enable-gnu-global-in-buffer))))
-
-    (let* ((db (semanticdb-project-database-global "global"))
-          (tab (semanticdb-file-table db (buffer-file-name)))
-          (result (semanticdb-deep-find-tags-for-completion-method tab searchfor))
-          )
-      (data-debug-new-buffer "*SemanticDB Gnu Global Result*")
-      (data-debug-insert-thing result "?" "")
-      )))
-
 (provide 'semantic/db-global)
 
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-feature: semantic/loaddefs
+;; generated-autoload-load-name: "semantic/db-global"
+;; End:
+
 ;;; semantic/db-global.el ends here