Function: cedet-idutils-search
cedet-idutils-search is a byte-compiled function defined in
cedet-idutils.el.gz.
Signature
(cedet-idutils-search SEARCHTEXT TEXTTYPE TYPE SCOPE)
Documentation
Perform a search with ID Utils, return the created buffer.
SEARCHTEXT is text to find.
TEXTTYPE is the type of text, such as regexp, string, tagname,
tagregexp, or tagcompletions.
TYPE is the type of search, meaning that SEARCHTEXT is compared to
filename, tagname (tags table), references (uses of a tag) , or
symbol (uses of something not in the tag table.)
SCOPE is the scope of the search, such as project or subdirs.
Note: Scope is not yet supported.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/cedet-idutils.el.gz
(defun cedet-idutils-search (searchtext texttype type _scope)
"Perform a search with ID Utils, return the created buffer.
SEARCHTEXT is text to find.
TEXTTYPE is the type of text, such as `regexp', `string', `tagname',
`tagregexp', or `tagcompletions'.
TYPE is the type of search, meaning that SEARCHTEXT is compared to
filename, tagname (tags table), references (uses of a tag) , or
symbol (uses of something not in the tag table.)
SCOPE is the scope of the search, such as `project' or `subdirs'.
Note: Scope is not yet supported."
(if (eq type 'file)
;; Calls for file stuff is very simple.
(cedet-idutils-fnid-call (list searchtext))
;; Calls for text searches is more complex.
(let* ((resultflg (if (eq texttype 'tagcompletions)
(list "--key=token")
(list "--result=grep")))
;; (scopeflgs (cond ((eq scope 'project) "" ) ((eq scope 'target) "l")))
(stflag (cond ((or (eq texttype 'tagname)
(eq texttype 'tagregexp))
(list "-r" "-w"))
((eq texttype 'tagcompletions)
;; Add regex to search text for beginning of char.
(setq searchtext (concat "^" searchtext))
(list "-r" "-s" ))
((eq texttype 'regexp)
(list "-r"))
;; t means 'symbol
(t (list "-l" "-w"))))
)
(cedet-idutils-lid-call (append resultflg nil stflag ;; scopeflgs
(list searchtext))))))