;;; 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")
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)
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))
(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)
(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
;;
(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)
"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"
"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)
)))
(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)))
(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")
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)
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)
"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
;; 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