;;; 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.
+;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: tags
;; The PATH argument is then the most interesting argument. It can
;; have these values:
;;
-;; 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.
;;
;; Search Results:
;;
(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)
)
"Synchronize the search index IDX with some NEW-TAGS."
;; Reset our parts.
(semantic-reset idx)
- ;; Notify dependants by clearning their indicies.
+ ;; Notify dependants by clearing their indices.
(semanticdb-notify-references
(oref idx table)
(lambda (tab me)
(if (semantic-find-tags-by-class 'include new-tags)
(progn
(semantic-reset idx)
- ;; Notify dependants by clearning their indicies.
+ ;; Notify dependants by clearing their indices.
(semanticdb-notify-references
(oref idx table)
(lambda (tab me)
(when (oref idx type-cache)
(when (semanticdb-partial-synchronize (oref idx type-cache) new-tags)
;; If the synchronize returns true, we need to notify.
- ;; Notify dependants by clearning their indicies.
+ ;; Notify dependants by clearing their indices.
(semanticdb-notify-references
(oref idx table)
(lambda (tab me)
"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
(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
;; do a caching lookup.
(let ((index (semanticdb-get-table-index table)))
(if (semanticdb-find-need-cache-update-p table)
- ;; Lets go look up our indicies
+ ;; Let's go look up our indices.
(let ((ans (semanticdb-find-translate-path-includes--internal path)))
(oset index include-path ans)
- ;; Once we have our new indicies set up, notify those
+ ;; Once we have our new indices set up, notify those
;; who depend on us if we found something for them to
;; depend on.
(when ans (semanticdb-refresh-references table))
(setq ans (semanticdb-file-table
(car systemdb)
;; I would expect most omniscient to return the same
- ;; thing reguardless of filename, but we may have
+ ;; thing regardless of filename, but we may have
;; one that can return a table of all things the
;; current file needs.
(buffer-file-name (current-buffer))))
;;
;; NOTE: Not used if EDE is active!
((and (semanticdb-find-throttle-active-p 'project)
- ;; And dont do this if it is a system include. Not supported by all languages,
+ ;; And don't do this if it is a system include. Not supported by all languages,
;; but when it is, this is a nice fast way to skip this step.
(not (semantic-tag-include-system-p includetag))
;; Don't do this if we have an EDE project.
(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)
(let ((tab (car (car tmp)))
(tags (cdr (car tmp))))
(dolist (T tags)
- ;; Normilzation gives specialty database tables a chance
+ ;; Normalization gives specialty database tables a chance
;; to convert into a more stable tag format.
(let* ((norm (semanticdb-normalize-one-tag tab T))
(ntab (car norm))
result
" ")
">")
- ;; Longer results should have an abreviated form.
+ ;; Longer results should have an abbreviated form.
(format "#<FIND RESULT %d TAGS in %d FILES>"
(semanticdb-find-result-length result)
(length result))))
(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.
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)
;; generated-autoload-load-name: "semantic/db-find"
;; End:
-;; arch-tag: 5d4162f5-5092-46d7-beed-55c78aab4116
;;; semantic/db-find.el ends here