]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/db-find.el
from trunk
[gnu-emacs] / lisp / cedet / semantic / db-find.el
index 817d716ab747823d6f7e50cd34e02f8a135695c7..59b190f00735713efa30921989d2c9df98222e84 100644 (file)
@@ -1,7 +1,7 @@
 ;;; semantic/db-find.el --- Searching through semantic databases.
 
-;;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;; 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
 ;; eldoc - popup help
 ;;   => Requires basic search using default path.  (Header files ok)
 ;; tag jump - jump to a named tag
-;;   => Requires a brute search useing whole project.  (Source files only)
+;;   => Requires a brute search using whole project.  (Source files only)
 ;; completion - Completing symbol names in a smart way
 ;;   => Basic search (headers ok)
 ;; type analysis - finding type definitions for variables & fcns
 (require 'semantic/db)
 (require 'semantic/db-ref)
 (eval-when-compile
-  (require 'eieio)
   (require 'semantic/find))
 
 ;;; 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 data-debug-insert-tag-list "adebug")
 (declare-function semantic-scope-reset-cache "semantic/scope")
 (declare-function semanticdb-typecache-notify-reset "semantic/db-typecache")
 (declare-function ede-current-project "ede")
@@ -441,7 +440,7 @@ and TAG is a clone of the include tag that was found.")
 Set this variable with `defvar-mode-local' for a particular mode so
 that any symbols that exist for all files for that mode are included.
 
-Note: This could be used as a way to write a file in a langauge
+Note: This could be used as a way to write a file in a language
 to declare all the built-ins for that language.")
 
 (defun semanticdb-find-translate-path-includes--internal (path)
@@ -470,12 +469,11 @@ a new path from the provided PATH."
                 incfname (semanticdb-full-filename path))
           )
          ((bufferp path)
-          (save-excursion
-            (set-buffer path)
+          (with-current-buffer path
             (semantic-refresh-tags-safe))
           (setq includetags (semantic-find-tags-included path)
-                curtable (save-excursion (set-buffer path)
-                                         semanticdb-current-table)
+                curtable (with-current-buffer path
+                            semanticdb-current-table)
                 incfname (buffer-file-name path)))
          (t
           (setq includetags (semantic-find-tags-included path))
@@ -782,7 +780,7 @@ Examines the variable `semanticdb-find-lost-includes'."
 
 (defun semanticdb-find-adebug-insert-scanned-tag-cons (consdata prefix prebuttontext)
   "Insert a button representing scanned include CONSDATA.
-PREFIX is the text that preceeds the button.
+PREFIX is the text that precedes the button.
 PREBUTTONTEXT is some text between prefix and the overlay button."
   (let* ((start (point))
         (end nil)
@@ -840,17 +838,6 @@ Examines the variable `semanticdb-find-lost-includes'."
       (data-debug-new-buffer "*SEMANTICDB scanned-includes ADEBUG*")
       (data-debug-insert-stuff-list scanned "*")
       )))
-\f
-;;; FIND results and edebug
-;;
-(eval-after-load "cedet-edebug"
-  '(progn
-     (cedet-edebug-add-print-override
-      '(semanticdb-find-results-p object)
-      '(semanticdb-find-result-prin1-to-string object) )
-     ))
-
-
 \f
 ;;; API Functions
 ;;
@@ -1031,7 +1018,7 @@ is still made current."
 (defun semanticdb-find-result-mapc (fcn result)
   "Apply FCN to each element of find RESULT for side-effects only.
 FCN takes two arguments.  The first is a TAG, and the
-second is a DB from wence TAG originated.
+second is a DB from whence TAG originated.
 Returns result."
   (mapc (lambda (sublst)
          (mapc (lambda (tag)
@@ -1050,7 +1037,7 @@ Returns result."
   "The name of the logging buffer.")
 
 (defun semanticdb-find-toggle-logging ()
-  "Toggle sematnicdb logging."
+  "Toggle semanticdb logging."
   (interactive)
   (setq semanticdb-find-log-flag (null semanticdb-find-log-flag))
   (message "Semanticdb find logging is %sabled"
@@ -1060,8 +1047,7 @@ Returns result."
   "Reset the log buffer."
   (interactive)
   (when semanticdb-find-log-flag
-    (save-excursion
-      (set-buffer (get-buffer-create semanticdb-find-log-buffer-name))
+    (with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name)
       (erase-buffer)
       )))
 
@@ -1081,8 +1067,7 @@ Returns result."
 (defun semanticdb-find-log-new-search (forwhat)
   "Start a new search FORWHAT."
   (when semanticdb-find-log-flag
-    (save-excursion
-      (set-buffer (get-buffer-create semanticdb-find-log-buffer-name))
+    (with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name)
       (insert (format "New Search: %S\n" forwhat))
       )
     (semanticdb-find-log-move-to-end)))
@@ -1090,8 +1075,7 @@ Returns result."
 (defun semanticdb-find-log-activity (table result)
   "Log that TABLE has been searched and RESULT was found."
   (when semanticdb-find-log-flag
-    (save-excursion
-      (set-buffer semanticdb-find-log-buffer-name)
+    (with-current-buffer semanticdb-find-log-buffer-name
       (insert "Table: " (object-print table)
              " Result: " (int-to-string (length result)) " tags"
              "\n")
@@ -1251,7 +1235,7 @@ associated with that tag should be loaded into a buffer."
 See `semanticdb-find-translate-path' for details on PATH.
 The argument BRUTISH will be set so that searching includes all tables
 in the current project.
-FIND-FILE-MATCH indicates that any time a matchi is found, the file
+FIND-FILE-MATCH indicates that any time a match is found, the file
 associated wit that tag should be loaded into a buffer."
   (semanticdb-find-tags-collector
    (lambda (table tags)
@@ -1263,7 +1247,7 @@ associated wit that tag should be loaded into a buffer."
 See `semanticdb-find-translate-path' for details on PATH.
 The argument BRUTISH will be set so that searching includes all tables
 in the current project.
-FIND-FILE-MATCH indicates that any time a matchi is found, the file
+FIND-FILE-MATCH indicates that any time a match is found, the file
 associated wit that tag should be loaded into a buffer."
   (semanticdb-find-tags-collector
    (lambda (table tags)
@@ -1339,12 +1323,14 @@ Returns a table of all matching tags."
    "In TABLE, find all occurances of tags whose parent is the PARENT type.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
+   (require 'semantic/find)
    (semantic-find-tags-external-children-of-type parent (or tags (semanticdb-get-tags table))))
 
 (defmethod semanticdb-find-tags-subclasses-of-type-method ((table semanticdb-abstract-table) parent &optional tags)
    "In TABLE, find all occurances of tags whose parent is the PARENT type.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
+   (require 'semantic/find)
    (semantic-find-tags-subclasses-of-type parent (or tags (semanticdb-get-tags table))))
 
 ;;; Deep Searches
@@ -1376,8 +1362,8 @@ Return a table of all matching tags."
 
 ;; Local variables:
 ;; generated-autoload-file: "loaddefs.el"
-;; generated-autoload-feature: semantic/loaddefs
 ;; generated-autoload-load-name: "semantic/db-find"
 ;; End:
 
+;; arch-tag: 5d4162f5-5092-46d7-beed-55c78aab4116
 ;;; semantic/db-find.el ends here