]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/db-find.el
Nuke arch-tags.
[gnu-emacs] / lisp / cedet / semantic / db-find.el
index 59b190f00735713efa30921989d2c9df98222e84..8c093b12decb261db93c66fabb1a1ed48185b313 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, 2010 Free Software Foundation, Inc.
+;;   2009, 2010, 2011 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
@@ -202,7 +202,7 @@ This class will cache data derived during various searches.")
   (when (oref idx type-cache)
     (semantic-reset (oref idx type-cache)))
   ;; Clear the scope.  Scope doesn't have the data it needs to track
-  ;; it's own reset.
+  ;; its own reset.
   (semantic-scope-reset-cache)
   )
 
@@ -262,13 +262,13 @@ This class will cache data derived during various searches.")
   "Translate PATH into a list of semantic tables.
 Path translation involves identifying the PATH input argument
 in one of the following ways:
-  nil - Take the current buffer, and use it's include list
+  nil - Take the current buffer, and use its include list
   buffer - Use that buffer's include list.
   filename - Use that file's include list.  If the file is not
       in a buffer, see of there is a semanticdb table for it.  If
       not, read that file into a buffer.
   tag - Get that tag's buffer of file file.  See above.
-  table - Search that table, and it's include list.
+  table - Search that table, and its include list.
   find result - Search the results of a previous find.
 
 In addition, once the base path is found, there is the possibility of
@@ -281,7 +281,7 @@ identified by translating PATH.  Such searches use brute force to
 scan every available table.
 
 The return value is a list of objects of type `semanticdb-table' or
-it's children.  In the case of passing in a find result, the result
+their children.  In the case of passing in a find result, the result
 is returned unchanged.
 
 This routine uses `semanticdb-find-table-for-include' to translate
@@ -326,9 +326,8 @@ Default action as described in `semanticdb-find-translate-path'."
         (cond ((null path) semanticdb-current-database)
               ((semanticdb-table-p path) (oref path parent-db))
               (t (let ((tt (semantic-something-to-tag-table path)))
-                   (save-excursion
-                     ;; @todo - What does this DO ??!?!
-                     (set-buffer (semantic-tag-buffer (car tt)))
+                   ;; @todo - What does this DO ??!?!
+                   (with-current-buffer (semantic-tag-buffer (car tt))
                      semanticdb-current-database))))))
     (apply
      #'nconc
@@ -366,7 +365,7 @@ Default action as described in `semanticdb-find-translate-path'."
     ans))
 
 (defun semanticdb-find-need-cache-update-p (table)
-  "Non nil if the semanticdb TABLE cache needs to be updated."
+  "Non-nil if the semanticdb TABLE cache needs to be updated."
   ;; If we were passed in something related to a TABLE,
   ;; do a caching lookup.
   (let* ((index (semanticdb-get-table-index table))
@@ -431,7 +430,7 @@ Default action as described in `semanticdb-find-translate-path'."
   "All include tags scanned, plus action taken on the tag.
 Each entry is an alist:
   (ACTION . TAG)
-where ACTION is one of 'scanned, 'duplicate, 'lost.
+where ACTION is one of 'scanned, 'duplicate, 'lost
 and TAG is a clone of the include tag that was found.")
 (make-variable-buffer-local 'semanticdb-find-scanned-include-tags)
 
@@ -775,7 +774,7 @@ Examines the variable `semanticdb-find-lost-includes'."
                 (buffer-name))
 
       (data-debug-new-buffer "*SEMANTICDB lost-includes ADEBUG*")
-      (data-debug-insert-tag-list lost "*")
+      ;; (data-debug-insert-tag-list lost "*")
       )))
 
 (defun semanticdb-find-adebug-insert-scanned-tag-cons (consdata prefix prebuttontext)
@@ -927,7 +926,7 @@ but should be good enough for debugging assertions."
 
 (defun semanticdb-find-result-with-nil-p (resultp)
   "Non-nil of RESULTP is in the form of a semanticdb search result.
-nil is a valid value where a TABLE usually is, but only if the TAG
+The value nil is valid where a TABLE usually is, but only if the TAG
 results include overlays.
 This query only really tests the first entry in the list that is RESULTP,
 but should be good enough for debugging assertions."
@@ -1007,9 +1006,14 @@ is still made current."
          (when norm
            ;; The normalized tags can now be found based on that
            ;; tags table.
-           (semanticdb-set-buffer (car norm))
-           ;; Now reset ans
-           (setq ans (cdr norm))
+           (condition-case foo
+               (progn
+                 (semanticdb-set-buffer (car norm))
+                 ;; Now reset ans
+                 (setq ans (cdr norm)))
+             ;; Don't error for this case, but don't store
+             ;; the thing either.
+             (no-method-definition nil))
            ))
       )
     ;; Return the tag.
@@ -1020,10 +1024,10 @@ is still made current."
 FCN takes two arguments.  The first is a TAG, and the
 second is a DB from whence TAG originated.
 Returns result."
-  (mapc (lambda (sublst)
-         (mapc (lambda (tag)
-                 (funcall fcn tag (car sublst)))
-               (cdr sublst)))
+  (mapc (lambda (sublst-icky)
+         (mapc (lambda (tag-icky)
+                 (funcall fcn tag-icky (car sublst-icky)))
+               (cdr sublst-icky)))
        result)
   result)
 
@@ -1090,8 +1094,8 @@ Returns result."
   "Collect all tags returned by FUNCTION over PATH.
 The FUNCTION must take two arguments.  The first is TABLE,
 which is a semanticdb table containing tags.  The second argument
-to FUNCTION is TAGS.  TAGS may be a list of tags.  If TAGS is non-nil, then
-FUNCTION should search the TAG list, not through TABLE.
+to FUNCTION is TAGS.  TAGS may be a list of tags.  If TAGS is non-nil,
+then FUNCTION should search the TAG list, not through TABLE.
 
 See `semanticdb-find-translate-path' for details on PATH.
 FIND-FILE-MATCH indicates that any time a match is found, the file
@@ -1296,38 +1300,38 @@ associated with that tag should be loaded into a buffer."
 
 ;;; Top level Searches
 (defmethod semanticdb-find-tags-by-name-method ((table semanticdb-abstract-table) name &optional tags)
-  "In TABLE, find all occurances of tags with NAME.
+  "In TABLE, find all occurrences of tags with NAME.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
   (semantic-find-tags-by-name name (or tags (semanticdb-get-tags table))))
 
 (defmethod semanticdb-find-tags-by-name-regexp-method ((table semanticdb-abstract-table) regexp &optional tags)
-  "In TABLE, find all occurances of tags matching REGEXP.
+  "In TABLE, find all occurrences of tags matching REGEXP.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
   (semantic-find-tags-by-name-regexp regexp (or tags (semanticdb-get-tags table))))
 
 (defmethod semanticdb-find-tags-for-completion-method ((table semanticdb-abstract-table) prefix &optional tags)
-  "In TABLE, find all occurances of tags matching PREFIX.
+  "In TABLE, find all occurrences of tags matching PREFIX.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
   (semantic-find-tags-for-completion prefix (or tags (semanticdb-get-tags table))))
 
 (defmethod semanticdb-find-tags-by-class-method ((table semanticdb-abstract-table) class &optional tags)
-  "In TABLE, find all occurances of tags of CLASS.
+  "In TABLE, find all occurrences of tags of CLASS.
 Optional argument TAGS is a list of tags to search.
 Returns a table of all matching tags."
   (semantic-find-tags-by-class class (or tags (semanticdb-get-tags table))))
 
 (defmethod semanticdb-find-tags-external-children-of-type-method ((table semanticdb-abstract-table) parent &optional tags)
-   "In TABLE, find all occurances of tags whose parent is the PARENT type.
+   "In TABLE, find all occurrences 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.
+   "In TABLE, find all occurrences 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)
@@ -1335,7 +1339,7 @@ Returns a table of all matching tags."
 
 ;;; Deep Searches
 (defmethod semanticdb-deep-find-tags-by-name-method ((table semanticdb-abstract-table) name &optional tags)
-  "In TABLE, find all occurances of tags with NAME.
+  "In TABLE, find all occurrences of tags with NAME.
 Search in all tags in TABLE, and all components of top level tags in
 TABLE.
 Optional argument TAGS is a list of tags to search.
@@ -1343,7 +1347,7 @@ Return a table of all matching tags."
   (semantic-find-tags-by-name name (semantic-flatten-tags-table (or tags (semanticdb-get-tags table)))))
 
 (defmethod semanticdb-deep-find-tags-by-name-regexp-method ((table semanticdb-abstract-table) regexp &optional tags)
-  "In TABLE, find all occurances of tags matching REGEXP.
+  "In TABLE, find all occurrences of tags matching REGEXP.
 Search in all tags in TABLE, and all components of top level tags in
 TABLE.
 Optional argument TAGS is a list of tags to search.
@@ -1351,7 +1355,7 @@ Return a table of all matching tags."
   (semantic-find-tags-by-name-regexp regexp (semantic-flatten-tags-table (or tags (semanticdb-get-tags table)))))
 
 (defmethod semanticdb-deep-find-tags-for-completion-method ((table semanticdb-abstract-table) prefix &optional tags)
-  "In TABLE, find all occurances of tags matching PREFIX.
+  "In TABLE, find all occurrences of tags matching PREFIX.
 Search in all tags in TABLE, and all components of top level tags in
 TABLE.
 Optional argument TAGS is a list of tags to search.
@@ -1365,5 +1369,4 @@ Return a table of all matching tags."
 ;; generated-autoload-load-name: "semantic/db-find"
 ;; End:
 
-;; arch-tag: 5d4162f5-5092-46d7-beed-55c78aab4116
 ;;; semantic/db-find.el ends here