Function: semantic-brute-find-tag-by-function

semantic-brute-find-tag-by-function is a byte-compiled function defined in find.el.gz.

Signature

(semantic-brute-find-tag-by-function FUNCTION STREAMORBUFFER &optional SEARCH-PARTS SEARCH-INCLUDES)

Documentation

Find all tags for which FUNCTION's value is non-nil within STREAMORBUFFER.

FUNCTION must return non-nil if an element of STREAM will be included in the new list.

If optional argument SEARCH-PARTS is non-nil, all sub-parts of tags are searched. The overloadable function semantic-tag-components is used for the searching child lists. If SEARCH-PARTS is the symbol positiononly, then only children that have positional information are searched.

If SEARCH-INCLUDES has not been implemented. This parameter hasn't be active for a while and is obsolete.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/find.el.gz
(defun semantic-brute-find-tag-by-function
  (function streamorbuffer &optional search-parts _search-includes)
  "Find all tags for which FUNCTION's value is non-nil within STREAMORBUFFER.
FUNCTION must return non-nil if an element of STREAM will be included
in the new list.

If optional argument SEARCH-PARTS is non-nil, all sub-parts of tags
are searched.  The overloadable function `semantic-tag-components' is
used for the searching child lists.  If SEARCH-PARTS is the symbol
`positiononly', then only children that have positional information are
searched.

If SEARCH-INCLUDES has not been implemented.
This parameter hasn't be active for a while and is obsolete."
  (let ((stream (semantic-something-to-tag-table streamorbuffer))
	(sl nil)			;list of tag children
	(nl nil)			;new list
        (case-fold-search semantic-case-fold))
    (dolist (tag stream)
      (if (not (semantic-tag-p tag))
	  ;; `semantic-tag-components-with-overlays' can return invalid
	  ;; tags if search-parts is not equal to 'positiononly
	  nil ;; Ignore them!
	(if (funcall function tag)
	    (setq nl (cons tag nl)))
	(and search-parts
	     (setq sl (if (eq search-parts 'positiononly)
			  (semantic-tag-components-with-overlays tag)
			(semantic-tag-components tag))
		   )
	     (setq nl (nconc nl
			     (semantic-brute-find-tag-by-function
			      function sl
			      search-parts))))))
    (setq nl (nreverse nl))
    nl))