;;; semantic/find.el --- Search routines for Semantic
-;; Copyright (C) 1999-2005, 2008-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2008-2013 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: syntax
(require 'semantic/tag)
(declare-function semantic-tag-protected-p "semantic/tag-ls")
+(declare-function semantic-tag-package-protected-p "semantic/tag-ls")
;;; Overlay Search Routines
;;
(eq ,class (semantic-tag-class (car tags)))
,table))
+(defmacro semantic-filter-tags-by-class (class &optional table)
+ "Find all tags of class not in the list CLASS in TABLE.
+CLASS is a list of symbols representing the class of the token,
+such as 'variable, of 'function..
+TABLE is a tag table. See `semantic-something-to-tag-table'."
+ `(semantic--find-tags-by-macro
+ (not (memq (semantic-tag-class (car tags)) ,class))
+ ,table))
+
(defmacro semantic-find-tags-by-type (type &optional table)
"Find all tags of with a type TYPE in TABLE.
TYPE is a string or tag representing a data type as defined in the
table
(require 'semantic/tag-ls)
(semantic--find-tags-by-macro
- (not (semantic-tag-protected-p (car tags) scopeprotection parent))
+ (not (and (semantic-tag-protected-p (car tags) scopeprotection parent)
+ (semantic-tag-package-protected-p (car tags) parent)))
table)))
-(defsubst semantic-find-tags-included (&optional table)
+;;;###autoload
+(define-overloadable-function semantic-find-tags-included (&optional table)
"Find all tags in TABLE that are of the 'include class.
-TABLE is a tag table. See `semantic-something-to-tag-table'."
+TABLE is a tag table. See `semantic-something-to-tag-table'.")
+
+(defun semantic-find-tags-included-default (&optional table)
+ "Find all tags in TABLE that are of the 'include class.
+TABLE is a tag table. See `semantic-something-to-tag-table'.
+By default, just call `semantic-find-tags-by-class'."
(semantic-find-tags-by-class 'include table))
;;; Deep Searches
;;; Old Style Brute Force Search Routines
;;
-;; These functions will search through tags lists explicity for
+;; These functions will search through tags lists explicitly for
;; desired information.
;; The -by-name nonterminal search can use the built in fcn
in the new list.
If optional argument SEARCH-PARTS is non-nil, all sub-parts of tags
-are searched. The overloadable function `semantic-tag-componenets' is
+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.