From 1bd955357097f15170e159d24b4e20b3173b8335 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Aug 2009 19:18:35 +0000 Subject: cedet/semantic/ctxt.el, cedet/semantic/db-find.el, cedet/semantic/db-ref.el, cedet/semantic/find.el, cedet/semantic/format.el, cedet/semantic/sort.el: New files. --- lisp/cedet/semantic/find.el | 795 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 795 insertions(+) create mode 100644 lisp/cedet/semantic/find.el (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el new file mode 100644 index 00000000000..a01b2ae2b22 --- /dev/null +++ b/lisp/cedet/semantic/find.el @@ -0,0 +1,795 @@ +;;; find.el --- Search routines for Semantic + +;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 +;;; Free Software Foundation, Inc. + +;; Author: Eric M. Ludlam +;; Keywords: syntax + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; Routines for searching through lists of tags. +;; There are several groups of tag search routines: +;; +;; 1) semantic-brute-find-tag-by-* +;; These routines use brute force hierarchical search to scan +;; through lists of tags. They include some parameters +;; used for compatibility with the semantic 1.x search routines. +;; +;; 1.5) semantic-brute-find-first-tag-by-* +;; Like 1, except seraching stops on the first match for the given +;; information. +;; +;; 2) semantic-find-tag-by-* +;; These prefered search routines attempt to scan through lists +;; in an intelligent way based on questions asked. +;; +;; 3) semantic-find-*-overlay +;; These routines use overlays to return tags based on a buffer position. +;; +;; 4) ... + +(require 'semantic/tag) + +;;; Code: + +;;; Overlay Search Routines +;; +;; These routines provide fast access to tokens based on a buffer that +;; has parsed tokens in it. Uses overlays to perform the hard work. +(defun semantic-find-tag-by-overlay (&optional positionormarker buffer) + "Find all tags covering POSITIONORMARKER by using overlays. +If POSITIONORMARKER is nil, use the current point. +Optional BUFFER is used if POSITIONORMARKER is a number, otherwise the current +buffer is used. This finds all tags covering the specified position +by checking for all overlays covering the current spot. They are then sorted +from largest to smallest via the start location." + (save-excursion + (when positionormarker + (if (markerp positionormarker) + (set-buffer (marker-buffer positionormarker)) + (if (bufferp buffer) + (set-buffer buffer)))) + (let ((ol (semantic-overlays-at (or positionormarker (point)))) + (ret nil)) + (while ol + (let ((tmp (semantic-overlay-get (car ol) 'semantic))) + (when (and tmp + ;; We don't need with-position because no tag w/out + ;; a position could exist in an overlay. + (semantic-tag-p tmp)) + (setq ret (cons tmp ret)))) + (setq ol (cdr ol))) + (sort ret (lambda (a b) (< (semantic-tag-start a) + (semantic-tag-start b))))))) + +(defun semantic-find-tag-by-overlay-in-region (start end &optional buffer) + "Find all tags which exist in whole or in part between START and END. +Uses overlays to determine positin. +Optional BUFFER argument specifies the buffer to use." + (save-excursion + (if buffer (set-buffer buffer)) + (let ((ol (semantic-overlays-in start end)) + (ret nil)) + (while ol + (let ((tmp (semantic-overlay-get (car ol) 'semantic))) + (when (and tmp + ;; See above about position + (semantic-tag-p tmp)) + (setq ret (cons tmp ret)))) + (setq ol (cdr ol))) + (sort ret (lambda (a b) (< (semantic-tag-start a) + (semantic-tag-start b))))))) + +(defun semantic-find-tag-by-overlay-next (&optional start buffer) + "Find the next tag after START in BUFFER. +If START is in an overlay, find the tag which starts next, +not the current tag." + (save-excursion + (if buffer (set-buffer buffer)) + (if (not start) (setq start (point))) + (let ((os start) (ol nil)) + (while (and os (< os (point-max)) (not ol)) + (setq os (semantic-overlay-next-change os)) + (when os + ;; Get overlays at position + (setq ol (semantic-overlays-at os)) + ;; find the overlay that belongs to semantic + ;; and starts at the found position. + (while (and ol (listp ol)) + (if (and (semantic-overlay-get (car ol) 'semantic) + (semantic-tag-p + (semantic-overlay-get (car ol) 'semantic)) + (= (semantic-overlay-start (car ol)) os)) + (setq ol (car ol))) + (when (listp ol) (setq ol (cdr ol)))))) + ;; convert ol to a tag + (when (and ol (semantic-tag-p (semantic-overlay-get ol 'semantic))) + (semantic-overlay-get ol 'semantic))))) + +(defun semantic-find-tag-by-overlay-prev (&optional start buffer) + "Find the next tag before START in BUFFER. +If START is in an overlay, find the tag which starts next, +not the current tag." + (save-excursion + (if buffer (set-buffer buffer)) + (if (not start) (setq start (point))) + (let ((os start) (ol nil)) + (while (and os (> os (point-min)) (not ol)) + (setq os (semantic-overlay-previous-change os)) + (when os + ;; Get overlays at position + (setq ol (semantic-overlays-at (1- os))) + ;; find the overlay that belongs to semantic + ;; and ENDS at the found position. + ;; + ;; Use end because we are going backward. + (while (and ol (listp ol)) + (if (and (semantic-overlay-get (car ol) 'semantic) + (semantic-tag-p + (semantic-overlay-get (car ol) 'semantic)) + (= (semantic-overlay-end (car ol)) os)) + (setq ol (car ol))) + (when (listp ol) (setq ol (cdr ol)))))) + ;; convert ol to a tag + (when (and ol + (semantic-tag-p (semantic-overlay-get ol 'semantic))) + (semantic-overlay-get ol 'semantic))))) + +(defun semantic-find-tag-parent-by-overlay (tag) + "Find the parent of TAG by overlays. +Overlays are a fast way of finding this information for active buffers." + (let ((tag (nreverse (semantic-find-tag-by-overlay + (semantic-tag-start tag))))) + ;; This is a lot like `semantic-current-tag-parent', but + ;; it uses a position to do it's work. Assumes two tags don't share + ;; the same start unless they are siblings. + (car (cdr tag)))) + +(defun semantic-current-tag () + "Return the current tag in the current buffer. +If there are more than one in the same location, return the +smallest tag. Return nil if there is no tag here." + (car (nreverse (semantic-find-tag-by-overlay)))) + +(defun semantic-current-tag-parent () + "Return the current tags parent in the current buffer. +A tag's parent would be a containing structure, such as a type +containing a field. Return nil if there is no parent." + (car (cdr (nreverse (semantic-find-tag-by-overlay))))) + +(defun semantic-current-tag-of-class (class) + "Return the current (smallest) tags of CLASS in the current buffer. +If the smallest tag is not of type CLASS, keep going upwards until one +is found. +Uses `semantic-tag-class' for classification." + (let ((tags (nreverse (semantic-find-tag-by-overlay)))) + (while (and tags + (not (eq (semantic-tag-class (car tags)) class))) + (setq tags (cdr tags))) + (car tags))) + +;;; Search Routines +;; +;; These are routines that search a single tags table. +;; +;; The original API (see COMPATIBILITY section below) in semantic 1.4 +;; had these usage statistics: +;; +;; semantic-find-nonterminal-by-name 17 +;; semantic-find-nonterminal-by-name-regexp 8 - Most doing completion +;; semantic-find-nonterminal-by-position 13 +;; semantic-find-nonterminal-by-token 21 +;; semantic-find-nonterminal-by-type 2 +;; semantic-find-nonterminal-standard 1 +;; +;; semantic-find-nonterminal-by-function (not in other searches) 1 +;; +;; New API: As above w/out `search-parts' or `search-includes' arguments. +;; Extra fcn: Specific to completion which is what -name-regexp is +;; mostly used for +;; +;; As for the sarguments "search-parts" and "search-includes" here +;; are stats: +;; +;; search-parts: 4 - charting x2, find-doc, senator (sans db) +;; +;; Implement command to flatten a tag table. Call new API Fcn w/ +;; flattened table for same results. +;; +;; search-include: 2 - analyze x2 (sans db) +;; +;; Not used effectively. Not to be re-implemented here. + +(defsubst semantic--find-tags-by-function (predicate &optional table) + "Find tags for which PREDICATE is non-nil in TABLE. +PREDICATE is a lambda expression which accepts on TAG. +TABLE is a semantic tags table. See `semantic-something-to-tag-table'." + (let ((tags (semantic-something-to-tag-table table)) + (result nil)) +; (mapc (lambda (tag) (and (funcall predicate tag) +; (setq result (cons tag result)))) +; tags) + ;; A while loop is actually faster. Who knew + (while tags + (and (funcall predicate (car tags)) + (setq result (cons (car tags) result))) + (setq tags (cdr tags))) + (nreverse result))) + +;; I can shave off some time by removing the funcall (see above) +;; and having the question be inlined in the while loop. +;; Strangely turning the upper level fcns into macros had a larger +;; impact. +(defmacro semantic--find-tags-by-macro (form &optional table) + "Find tags for which FORM is non-nil in TABLE. +TABLE is a semantic tags table. See `semantic-something-to-tag-table'." + `(let ((tags (semantic-something-to-tag-table ,table)) + (result nil)) + (while tags + (and ,form + (setq result (cons (car tags) result))) + (setq tags (cdr tags))) + (nreverse result))) + +;;; Top level Searches +;; +(defsubst semantic-find-first-tag-by-name (name &optional table) + "Find the first tag with NAME in TABLE. +NAME is a string. +TABLE is a semantic tags table. See `semantic-something-to-tag-table'. +This routine uses `assoc' to quickly find the first matching entry." + (funcall (if semantic-case-fold 'assoc-ignore-case 'assoc) + name (semantic-something-to-tag-table table))) + +(defmacro semantic-find-tags-by-name (name &optional table) + "Find all tags with NAME in TABLE. +NAME is a string. +TABLE is a tag table. See `semantic-something-to-tag-table'." + `(let ((case-fold-search semantic-case-fold)) + (semantic--find-tags-by-macro + (string= ,name (semantic-tag-name (car tags))) + ,table))) + +(defmacro semantic-find-tags-for-completion (prefix &optional table) + "Find all tags whos name begins with PREFIX in TABLE. +PREFIX is a string. +TABLE is a tag table. See `semantic-something-to-tag-table'. +While it would be nice to use `try-completion' or `all-completions', +those functions do not return the tags, only a string. +Uses `compare-strings' for fast comparison." + `(let ((l (length ,prefix))) + (semantic--find-tags-by-macro + (eq (compare-strings ,prefix 0 nil + (semantic-tag-name (car tags)) 0 l + semantic-case-fold) + t) + ,table))) + +(defmacro semantic-find-tags-by-name-regexp (regexp &optional table) + "Find all tags with name matching REGEXP in TABLE. +REGEXP is a string containing a regular expression, +TABLE is a tag table. See `semantic-something-to-tag-table'. +Consider using `semantic-find-tags-for-completion' if you are +attempting to do completions." + `(let ((case-fold-search semantic-case-fold)) + (semantic--find-tags-by-macro + (string-match ,regexp (semantic-tag-name (car tags))) + ,table))) + +(defmacro semantic-find-tags-by-class (class &optional table) + "Find all tags of class CLASS in TABLE. +CLASS is a symbol 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 + (eq ,class (semantic-tag-class (car tags))) + ,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 +language the tags were parsed from, such as \"int\", or perhaps +a tag whose name is that of a struct or class. +TABLE is a tag table. See `semantic-something-to-tag-table'." + `(semantic--find-tags-by-macro + (semantic-tag-of-type-p (car tags) ,type) + ,table)) + +(defmacro semantic-find-tags-of-compound-type (&optional table) + "Find all tags which are a compound type in TABLE. +Compound types are structures, or other data type which +is not of a primitive nature, such as int or double. +Used in completion." + `(semantic--find-tags-by-macro + (semantic-tag-type-compound-p (car tags)) + ,table)) + +(define-overloadable-function semantic-find-tags-by-scope-protection (scopeprotection parent &optional table) + "Find all tags accessable by SCOPEPROTECTION. +SCOPEPROTECTION is a symbol which can be returned by the method +`semantic-tag-protection'. A hard-coded order is used to determine a match. +PARENT is a tag representing the PARENT slot needed for +`semantic-tag-protection'. +TABLE is a list of tags (a subset of PARENT members) to scan. If TABLE is nil, +the type members of PARENT are used. +See `semantic-tag-protected-p' for details on which tags are returned." + (if (not (eq (semantic-tag-class parent) 'type)) + (signal 'wrong-type-argument '(semantic-find-tags-by-scope-protection + parent + semantic-tag-class type)) + (:override))) + +(defun semantic-find-tags-by-scope-protection-default + (scopeprotection parent &optional table) + "Find all tags accessable by SCOPEPROTECTION. +SCOPEPROTECTION is a symbol which can be returned by the method +`semantic-tag-protection'. A hard-coded order is used to determine a match. +PARENT is a tag representing the PARENT slot needed for +`semantic-tag-protection'. +TABLE is a list of tags (a subset of PARENT members) to scan. If TABLE is nil, +the type members of PARENT are used. +See `semantic-tag-protected-p' for details on which tags are returned." + (if (not table) (setq table (semantic-tag-type-members parent))) + (if (null scopeprotection) + table + (semantic--find-tags-by-macro + (not (semantic-tag-protected-p (car tags) scopeprotection parent)) + table))) + +(defsubst 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'." + (semantic-find-tags-by-class 'include table)) + +;;; Deep Searches + +(defmacro semantic-deep-find-tags-by-name (name &optional table) + "Find all tags with NAME in TABLE. +Search in top level tags, and their components, in TABLE. +NAME is a string. +TABLE is a tag table. See `semantic-flatten-tags-table'. +See also `semantic-find-tags-by-name'." + `(semantic-find-tags-by-name + ,name (semantic-flatten-tags-table ,table))) + +(defmacro semantic-deep-find-tags-for-completion (prefix &optional table) + "Find all tags whos name begins with PREFIX in TABLE. +Search in top level tags, and their components, in TABLE. +TABLE is a tag table. See `semantic-flatten-tags-table'. +See also `semantic-find-tags-for-completion'." + `(semantic-find-tags-for-completion + ,prefix (semantic-flatten-tags-table ,table))) + +(defmacro semantic-deep-find-tags-by-name-regexp (regexp &optional table) + "Find all tags with name matching REGEXP in TABLE. +Search in top level tags, and their components, in TABLE. +REGEXP is a string containing a regular expression, +TABLE is a tag table. See `semantic-flatten-tags-table'. +See also `semantic-find-tags-by-name-regexp'. +Consider using `semantic-deep-find-tags-for-completion' if you are +attempting to do completions." + `(semantic-find-tags-by-name-regexp + ,regexp (semantic-flatten-tags-table ,table))) + +;;; Specialty Searches +;; +(defun semantic-find-tags-external-children-of-type (type &optional table) + "Find all tags in whose parent is TYPE in TABLE. +These tags are defined outside the scope of the original TYPE declaration. +TABLE is a tag table. See `semantic-something-to-tag-table'." + (semantic--find-tags-by-macro + (equal (semantic-tag-external-member-parent (car tags)) + type) + table)) + +(defun semantic-find-tags-subclasses-of-type (type &optional table) + "Find all tags of class type in whose parent is TYPE in TABLE. +These tags are defined outside the scope of the original TYPE declaration. +TABLE is a tag table. See `semantic-something-to-tag-table'." + (semantic--find-tags-by-macro + (and (eq (semantic-tag-class (car tags)) 'type) + (or (member type (semantic-tag-type-superclasses (car tags))) + (member type (semantic-tag-type-interfaces (car tags))))) + table)) + +;; +;; ************************** Compatibility *************************** +;; + +;;; Old Style Brute Force Search Routines +;; +;; These functions will search through tags lists explicity for +;; desired information. + +;; The -by-name nonterminal search can use the built in fcn +;; `assoc', which is faster than looping ourselves, so we will +;; not use `semantic-brute-find-tag-by-function' to do this, +;; instead erroring on the side of speed. + +(defun semantic-brute-find-first-tag-by-name + (name streamorbuffer &optional search-parts search-include) + "Find a tag NAME within STREAMORBUFFER. NAME is a string. +If SEARCH-PARTS is non-nil, search children of tags. +If SEARCH-INCLUDE was never implemented. + +Use `semantic-find-first-tag-by-name' instead." + (let* ((stream (semantic-something-to-tag-table streamorbuffer)) + (assoc-fun (if semantic-case-fold + #'assoc-ignore-case + #'assoc)) + (m (funcall assoc-fun name stream))) + (if m + m + (let ((toklst stream) + (children nil)) + (while (and (not m) toklst) + (if search-parts + (progn + (setq children (semantic-tag-components-with-overlays + (car toklst))) + (if children + (setq m (semantic-brute-find-first-tag-by-name + name children search-parts search-include))))) + (setq toklst (cdr toklst))) + (if (not m) + ;; Go to dependencies, and search there. + nil) + m)))) + +(defmacro semantic-brute-find-tag-by-class + (class streamorbuffer &optional search-parts search-includes) + "Find all tags with a class CLASS within STREAMORBUFFER. +CLASS is a symbol representing the class of the tags to find. +See `semantic-tag-class'. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'. + +Use `semantic-find-tag-by-class' instead." + `(semantic-brute-find-tag-by-function + (lambda (tag) (eq ,class (semantic-tag-class tag))) + ,streamorbuffer ,search-parts ,search-includes)) + +(defmacro semantic-brute-find-tag-standard + (streamorbuffer &optional search-parts search-includes) + "Find all tags in STREAMORBUFFER which define simple class types. +See `semantic-tag-class'. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + `(semantic-brute-find-tag-by-function + (lambda (tag) (member (semantic-tag-class tag) + '(function variable type))) + ,streamorbuffer ,search-parts ,search-includes)) + +(defun semantic-brute-find-tag-by-type + (type streamorbuffer &optional search-parts search-includes) + "Find all tags with type TYPE within STREAMORBUFFER. +TYPE is a string which is the name of the type of the tags returned. +See `semantic-tag-type'. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) + (let ((ts (semantic-tag-type tag))) + (if (and (listp ts) + (or (= (length ts) 1) + (eq (semantic-tag-class ts) 'type))) + (setq ts (semantic-tag-name ts))) + (equal type ts))) + streamorbuffer search-parts search-includes)) + +(defun semantic-brute-find-tag-by-type-regexp + (regexp streamorbuffer &optional search-parts search-includes) + "Find all tags with type matching REGEXP within STREAMORBUFFER. +REGEXP is a regular expression which matches the name of the type of the +tags returned. See `semantic-tag-type'. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) + (let ((ts (semantic-tag-type tag))) + (if (listp ts) + (setq ts + (if (eq (semantic-tag-class ts) 'type) + (semantic-tag-name ts) + (car ts)))) + (and ts (string-match regexp ts)))) + streamorbuffer search-parts search-includes)) + +(defun semantic-brute-find-tag-by-name-regexp + (regex streamorbuffer &optional search-parts search-includes) + "Find all tags whose name match REGEX in STREAMORBUFFER. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) (string-match regex (semantic-tag-name tag))) + streamorbuffer search-parts search-includes) + ) + +(defun semantic-brute-find-tag-by-property + (property value streamorbuffer &optional search-parts search-includes) + "Find all tags with PROPERTY equal to VALUE in STREAMORBUFFER. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) (equal (semantic--tag-get-property tag property) value)) + streamorbuffer search-parts search-includes) + ) + +(defun semantic-brute-find-tag-by-attribute + (attr streamorbuffer &optional search-parts search-includes) + "Find all tags with a given ATTR in STREAMORBUFFER. +ATTR is a symbol key into the attributes list. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) (semantic-tag-get-attribute tag attr)) + streamorbuffer search-parts search-includes) + ) + +(defun semantic-brute-find-tag-by-attribute-value + (attr value streamorbuffer &optional search-parts search-includes) + "Find all tags with a given ATTR equal to VALUE in STREAMORBUFFER. +ATTR is a symbol key into the attributes list. +VALUE is the value that ATTR should match. +Optional argument SEARCH-PARTS and SEARCH-INCLUDES are passed to +`semantic-brute-find-tag-by-function'." + (semantic-brute-find-tag-by-function + (lambda (tag) (equal (semantic-tag-get-attribute tag attr) value)) + streamorbuffer search-parts search-includes) + ) + +(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-componenets' 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)) + +(defun semantic-brute-find-first-tag-by-function + (function streamorbuffer &optional search-parts search-includes) + "Find the first tag which FUNCTION match within STREAMORBUFFER. +FUNCTION must return non-nil if an element of STREAM will be included +in the new list. + +The following parameters were never implemented. + +If optional argument SEARCH-PARTS, all sub-parts of tags are searched. +The overloadable function `semantic-tag-components' is used for +searching. +If SEARCH-INCLUDES is non-nil, then all include files are also +searched for matches." + (let ((stream (semantic-something-to-tag-table streamorbuffer)) + (found nil) + (case-fold-search semantic-case-fold)) + (while (and (not found) stream) + (if (funcall function (car stream)) + (setq found (car stream))) + (setq stream (cdr stream))) + found)) + + +;;; Old Positional Searches +;; +;; Are these useful anymore? +;; +(defun semantic-brute-find-tag-by-position (position streamorbuffer + &optional nomedian) + "Find a tag covering POSITION within STREAMORBUFFER. +POSITION is a number, or marker. If NOMEDIAN is non-nil, don't do +the median calculation, and return nil." + (save-excursion + (if (markerp position) (set-buffer (marker-buffer position))) + (let* ((stream (if (bufferp streamorbuffer) + (save-excursion + (set-buffer streamorbuffer) + (semantic-fetch-tags)) + streamorbuffer)) + (prev nil) + (found nil)) + (while (and stream (not found)) + ;; perfect fit + (if (and (>= position (semantic-tag-start (car stream))) + (<= position (semantic-tag-end (car stream)))) + (setq found (car stream)) + ;; Median between to objects. + (if (and prev (not nomedian) + (>= position (semantic-tag-end prev)) + (<= position (semantic-tag-start (car stream)))) + (let ((median (/ (+ (semantic-tag-end prev) + (semantic-tag-start (car stream))) + 2))) + (setq found + (if (> position median) + (car stream) + prev))))) + ;; Next!!! + (setq prev (car stream) + stream (cdr stream))) + found))) + +(defun semantic-brute-find-innermost-tag-by-position + (position streamorbuffer &optional nomedian) + "Find a list of tags covering POSITION within STREAMORBUFFER. +POSITION is a number, or marker. If NOMEDIAN is non-nil, don't do +the median calculation, and return nil. +This function will find the topmost item, and recurse until no more +details are available of findable." + (let* ((returnme nil) + (current (semantic-brute-find-tag-by-position + position streamorbuffer nomedian)) + (nextstream (and current + (if (eq (semantic-tag-class current) 'type) + (semantic-tag-type-members current) + nil)))) + (while nextstream + (setq returnme (cons current returnme)) + (setq current (semantic-brute-find-tag-by-position + position nextstream nomedian)) + (setq nextstream (and current + ;; NOTE TO SELF: + ;; Looking at this after several years away, + ;; what does this do??? + (if (eq (semantic-tag-class current) 'token) + (semantic-tag-type-members current) + nil)))) + (nreverse (cons current returnme)))) + +;;; Compatibility Aliases +(semantic-alias-obsolete 'semantic-find-nonterminal-by-overlay + 'semantic-find-tag-by-overlay) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-overlay-in-region + 'semantic-find-tag-by-overlay-in-region) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-overlay-next + 'semantic-find-tag-by-overlay-next) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-overlay-prev + 'semantic-find-tag-by-overlay-prev) + +(semantic-alias-obsolete 'semantic-find-nonterminal-parent-by-overlay + 'semantic-find-tag-parent-by-overlay) + +(semantic-alias-obsolete 'semantic-current-nonterminal + 'semantic-current-tag) + +(semantic-alias-obsolete 'semantic-current-nonterminal-parent + 'semantic-current-tag-parent) + +(semantic-alias-obsolete 'semantic-current-nonterminal-of-type + 'semantic-current-tag-of-class) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-name + 'semantic-brute-find-first-tag-by-name) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-token + 'semantic-brute-find-tag-by-class) + +(semantic-alias-obsolete 'semantic-find-nonterminal-standard + 'semantic-brute-find-tag-standard) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-type + 'semantic-brute-find-tag-by-type) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-type-regexp + 'semantic-brute-find-tag-by-type-regexp) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-name-regexp + 'semantic-brute-find-tag-by-name-regexp) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-property + 'semantic-brute-find-tag-by-property) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-extra-spec + 'semantic-brute-find-tag-by-attribute) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-extra-spec-value + 'semantic-brute-find-tag-by-attribute-value) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-function + 'semantic-brute-find-tag-by-function) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-function-first-match + 'semantic-brute-find-first-tag-by-function) + +(semantic-alias-obsolete 'semantic-find-nonterminal-by-position + 'semantic-brute-find-tag-by-position) + +(semantic-alias-obsolete 'semantic-find-innermost-nonterminal-by-position + 'semantic-brute-find-innermost-tag-by-position) + +;;; TESTING +;; +(defun semantic-find-benchmark () + "Run some simple benchmarks to see how we are doing. +Optional argument ARG is the number of iterations to run." + (interactive) + (require 'benchmark) + (let ((f-name nil) + (b-name nil) + (f-comp) + (b-comp) + (f-regex) + ) + (garbage-collect) + (setq f-name + (benchmark-run-compiled + 1000 (semantic-find-first-tag-by-name "class3" + "test/test.cpp"))) + (garbage-collect) + (setq b-name + (benchmark-run-compiled + 1000 (semantic-brute-find-first-tag-by-name "class3" + "test/test.cpp"))) + (garbage-collect) + (setq f-comp + (benchmark-run-compiled + 1000 (semantic-find-tags-for-completion "method" + "test/test.cpp"))) + (garbage-collect) + (setq b-comp + (benchmark-run-compiled + 1000 (semantic-brute-find-tag-by-name-regexp "^method" + "test/test.cpp"))) + (garbage-collect) + (setq f-regex + (benchmark-run-compiled + 1000 (semantic-find-tags-by-name-regexp "^method" + "test/test.cpp"))) + + (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]" + (car f-name) (car b-name) + (car f-comp) (car f-regex) + (car b-comp)) + )) + + +(provide 'semantic/find) + +;;; semantic-find.el ends here -- cgit v1.2.1 From 978c25c6a0b0d88568abb91c871363758c678da0 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 31 Aug 2009 02:16:34 +0000 Subject: cedet/semantic/chart.el: Don't require semantic/find. cedet/semantic/complete.el: Don't require semantic/find. cedet/semantic/decorate.el: Require semantic/tag-file. (semantic-set-tag-folded-isearch): Require semantic/find. cedet/semantic/dep.el: Change semantic--dependency-find-file-on-path into a macro, to avoid compiler warning. Defvar ede-minor-mode and ede-object. Declare ede-system-include-path. cedet/semantic/doc.el: Require semantic/tag-file and semantic/find. cedet/semantic/edit.el: Require semantic/find and semantic/format. cedet/semantic/find.el: Defvar semantic-case-fold. Require semantic. (semantic-find-tags-external-children-of-type): Require semantic/sort. (semantic-find-tags-by-scope-protection-default): Require semantic/tag-ls. cedet/semantic/format.el: Require semantic/tag-ls. eval-when-compile semantic/find. (semantic-format-tag-name): Move up to avoid compiler error. (semantic-format-tag-prototype): Move up to avoid compiler error. (semantic--format-tag-parent-tree): Require semantic/tag-file. (semantic-format-tag-short-doc-default): Require semantic/doc. --- lisp/cedet/semantic/find.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index a01b2ae2b22..4751c3e1c2a 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -1,4 +1,4 @@ -;;; find.el --- Search routines for Semantic +;;; semantic/find.el --- Search routines for Semantic ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 ;;; Free Software Foundation, Inc. @@ -44,6 +44,7 @@ ;; ;; 4) ... +(require 'semantic) (require 'semantic/tag) ;;; Code: @@ -335,6 +336,8 @@ See `semantic-tag-protected-p' for details on which tags are returned." semantic-tag-class type)) (:override))) +(declare-function semantic-tag-protected-p "semantic/tag-ls") + (defun semantic-find-tags-by-scope-protection-default (scopeprotection parent &optional table) "Find all tags accessable by SCOPEPROTECTION. @@ -348,6 +351,7 @@ See `semantic-tag-protected-p' for details on which tags are returned." (if (not table) (setq table (semantic-tag-type-members parent))) (if (null scopeprotection) table + (require 'semantic/tag-ls) (semantic--find-tags-by-macro (not (semantic-tag-protected-p (car tags) scopeprotection parent)) table))) @@ -389,10 +393,13 @@ attempting to do completions." ;;; Specialty Searches ;; +(declare-function semantic-tag-external-member-parent "semantic/sort") + (defun semantic-find-tags-external-children-of-type (type &optional table) "Find all tags in whose parent is TYPE in TABLE. These tags are defined outside the scope of the original TYPE declaration. TABLE is a tag table. See `semantic-something-to-tag-table'." + (require 'semantic/sort) (semantic--find-tags-by-macro (equal (semantic-tag-external-member-parent (car tags)) type) @@ -792,4 +799,4 @@ Optional argument ARG is the number of iterations to run." (provide 'semantic/find) -;;; semantic-find.el ends here +;;; semantic/find.el ends here -- cgit v1.2.1 From 3d9d848682f41fff87e19103f8b12968e9ba14e3 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 2 Sep 2009 04:37:10 +0000 Subject: lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el. lisp/emacs-lisp/autoload.el (generated-autoload-feature): New var. (autoload-rubric): Use it. lisp/cedet/semantic/adebug.el (data-debug-insert-find-results-button): Require db-find. lisp/cedet/semantic/analyze.el: Require semantic/tag. Don't declare autoloaded functions. lisp/cedet/semantic/chart.el: Don't declare autoloaded functions. lisp/cedet/semantic/complete.el: eval-when-compile semantic/find for macro. (semantic-collector-calculate-completions-raw): Require semantic/db-find. lisp/cedet/semantic/ctxt.el (semantic-up-context): Require semantic/find. Don't require it at top-level. lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-dump): Require data-debug. Don't require it at top-level. Don't require semantic/sort. lisp/cedet/semantic/db-find.el: Add local vars for autoloading. Don't require semantic/tag-file and semantic/sort. (semanticdb-find-default-throttle, semanticdb-find-result-length) (semanticdb-find-result-nth, semanticdb-find-result-nth-in-buffer) (semanticdb-find-tags-by-name, semanticdb-find-tags-for-completion) (semanticdb-find-translate-path, semanticdb-find-table-for-include): Autoload. lisp/cedet/semantic/db-ref.el: Require semantic and semantic/tag. (semanticdb-ref-test): Require data-debug. Don't require it at top-level. lisp/cedet/semantic/db-typecache.el: Require semantic and semantic/tag. Declare semantic-sort-tags-by-name-then-type-increasing and semantic-scope-tag-clone-with-scope. eval-when-compile semantic/find for semantic-find-tags-by-* macros. Add local vars for autoloading. (semanticdb-typecache-find): Autoload. lisp/cedet/semantic/db.el: Add local vars for autoloading. (semanticdb-current-database, semanticdb-current-table) (semanticdb-file-table-object): Autoload. lisp/cedet/semantic/decorate.el: Don't requirements for autoloaded functions. lisp/cedet/semantic/doc.el: Add local vars for autoloading. (semantic-documentation-for-tag): Autoload. lisp/cedet/semantic/edit.el: Drop requirements for autoloaded functions. lisp/cedet/semantic/find.el: Add local vars for autoloading. (semantic-current-tag, semantic-find-tag-by-overlay) (semantic-find-first-tag-by-name): Autoload. lisp/cedet/semantic/format.el: Add local vars for autoloading. (semantic-format-tag-name, semantic-format-tag-custom-list) (semantic-format-tag-functions): Autoload. lisp/cedet/semantic/fw.el: Require semantic/loaddefs. lisp/cedet/semantic/html.el (semantic-html-recursive-combobulate-list): Use assoc-string instead of assoc-case. lisp/cedet/semantic/ia.el (semantic-ia-insert-tag): Move up to avoid compiler error. (semantic-ia-complete-symbol-menu): Require imenu. (semantic-ia-fast-jump): Require semantic/decorate/include. lisp/cedet/semantic/idle.el: Require semantic and semantic/tag. Declare semanticdb-typecache-refresh-for-buffer and eldoc-message. eval-when-compile semantic/find for semantic-find-tags-by-name macro. lisp/cedet/semantic/sort.el: Add local vars for autoloading. (semantic-flatten-tags-table, semantic-tag-external-member-parent): Autoload. lisp/cedet/semantic/tag-file.el: Add local vars for autoloading. (semantic-go-to-tag, semantic-dependency-tag-file): Autoload. lisp/cedet/semantic/tag-ls.el: Add local vars for autoloading. (semantic-tag-prototype-p): Autoload. lisp/cedet/semantic/tag.el: Don't declare autoloaded functions. lisp/cedet/semantic/analyze/complete.el: Add local variables for autoloading. (semantic-analyze-possible-completions): Autoload. lisp/cedet/semantic/analyze/fcn.el: Require mode-local. --- lisp/cedet/semantic/find.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index 4751c3e1c2a..a8351baa51d 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -53,6 +53,8 @@ ;; ;; These routines provide fast access to tokens based on a buffer that ;; has parsed tokens in it. Uses overlays to perform the hard work. + +;;;###autoload (defun semantic-find-tag-by-overlay (&optional positionormarker buffer) "Find all tags covering POSITIONORMARKER by using overlays. If POSITIONORMARKER is nil, use the current point. @@ -79,6 +81,7 @@ from largest to smallest via the start location." (sort ret (lambda (a b) (< (semantic-tag-start a) (semantic-tag-start b))))))) +;;;###autoload (defun semantic-find-tag-by-overlay-in-region (start end &optional buffer) "Find all tags which exist in whole or in part between START and END. Uses overlays to determine positin. @@ -97,6 +100,7 @@ Optional BUFFER argument specifies the buffer to use." (sort ret (lambda (a b) (< (semantic-tag-start a) (semantic-tag-start b))))))) +;;;###autoload (defun semantic-find-tag-by-overlay-next (&optional start buffer) "Find the next tag after START in BUFFER. If START is in an overlay, find the tag which starts next, @@ -123,6 +127,7 @@ not the current tag." (when (and ol (semantic-tag-p (semantic-overlay-get ol 'semantic))) (semantic-overlay-get ol 'semantic))))) +;;;###autoload (defun semantic-find-tag-by-overlay-prev (&optional start buffer) "Find the next tag before START in BUFFER. If START is in an overlay, find the tag which starts next, @@ -152,6 +157,7 @@ not the current tag." (semantic-tag-p (semantic-overlay-get ol 'semantic))) (semantic-overlay-get ol 'semantic))))) +;;;###autoload (defun semantic-find-tag-parent-by-overlay (tag) "Find the parent of TAG by overlays. Overlays are a fast way of finding this information for active buffers." @@ -162,6 +168,7 @@ Overlays are a fast way of finding this information for active buffers." ;; the same start unless they are siblings. (car (cdr tag)))) +;;;###autoload (defun semantic-current-tag () "Return the current tag in the current buffer. If there are more than one in the same location, return the @@ -249,8 +256,9 @@ TABLE is a semantic tags table. See `semantic-something-to-tag-table'." (nreverse result))) ;;; Top level Searches -;; -(defsubst semantic-find-first-tag-by-name (name &optional table) + +;;;###autoload +(defun semantic-find-first-tag-by-name (name &optional table) "Find the first tag with NAME in TABLE. NAME is a string. TABLE is a semantic tags table. See `semantic-something-to-tag-table'. @@ -399,7 +407,6 @@ attempting to do completions." "Find all tags in whose parent is TYPE in TABLE. These tags are defined outside the scope of the original TYPE declaration. TABLE is a tag table. See `semantic-something-to-tag-table'." - (require 'semantic/sort) (semantic--find-tags-by-macro (equal (semantic-tag-external-member-parent (car tags)) type) @@ -796,7 +803,11 @@ Optional argument ARG is the number of iterations to run." (car b-comp)) )) - (provide 'semantic/find) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/find.el ends here -- cgit v1.2.1 From 55b522b2eb02de72ce207a04aef15ed7f193b568 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 3 Sep 2009 03:58:13 +0000 Subject: lisp/cedet/semantic/analyze.el: Add local vars for autoloading. (semantic-analyze-current-context): Autoload. lisp/cedet/semantic/ctxt.el: Add local vars for autoloading. Don't eval-when-compile semantic/db (semantic-ctxt-current-mode): Autoload. (semantic-up-context): Require semantic/find. lisp/cedet/semantic/find.el (semantic-current-tag-parent) (semantic-find-tags-by-scope-protection): Autoload. lisp/cedet/semantic/format.el (semantic-format-tag-prototype) (semantic-format-tag-summarize): Autoload. lisp/cedet/semantic/idle.el: Declare external functions. (semantic-idle-work-for-one-buffer, semantic-idle-work-core-handler): Require semantic/db-mode. (semantic-idle-work-core-handler): Synch to upstream. (semantic-idle-scheduler-refresh-tags): Require semantic/decorate/mode. (semantic-idle-summary-find-current-symbol-tag): Require semantic/db-find. (semantic-idle-summary-current-symbol-info-context): Require semantic/analyze. (semantic-idle-summary-maybe-highlight, semantic-idle-tag-highlight): Require pulse. (semantic-idle-completion-list-default): Require semantic/complete. lisp/cedet/semantic/lex-spp.el: Require semantic. (semantic-lex-spp-analyzer-push-tokens-for-symbol): Synch to upstream. (semantic-lex-spp-first-token-arg-list): Use split-string. lisp/cedet/semantic/lex.el: Declare semantic-elapsed-time. Add local vars for autoloading. (semantic-lex-test): Require semantic. (semantic-lex): Autoload. (semantic-flex): Use semantic-lex-keyword-p to avoid compiler warning. lisp/cedet/semantic/sb.el: Require semantic/sort. Declare semanticdb-minor-mode-p. (semantic-sb-fetch-tag-table): Require semantic/db-mode. lisp/cedet/semantic/scope.el: eval-when-compile semantic/find. Declare external functions. (semantic-analyze-scope-nested-tags-default): Require semantic/analyze. (semantic-analyze-show): Require semantic/analyze. (semantic-calculate-scope): Require semantic/db-typecache. lisp/cedet/semantic/sort.el: Add local vars for autoloading. Declare semanticdb-find-tags-external-children-of-type. (semantic-flatten-tags-table, semantic-tag-external-member-parent): Autoload. (semantic-tag-external-member-children-default): Require semantic/db-find. lisp/cedet/semantic/symref.el: Require semantic. Declare data-debug-new-buffer and data-debug-insert-object-slots. (semantic-symref-data-debug-last-result): Require eieio-datadebug. lisp/cedet/semantic/tag-file.el: Declare external functions. (semantic-go-to-tag): Call semanticdb-table-child-p only if semantic/db is loaded. (semantic-dependency-tag-file): Require semantic/dep. lisp/cedet/semantic/tag-ls.el: Require semantic. Add local variables for autoloading. (semantic-tag-prototype-p): Autoload. lisp/cedet/semantic/tag-write.el: Require semantic. lisp/cedet/semantic/tag.el: Update external function declarations and requirements, removing autoloaded functions. Add local vars for autoloading. (semantic-tag-components): Autoload. lisp/cedet/semantic/texi.el: Declare lookup-words. eval-when-compile semantic/find. lisp/cedet/semantic/util.el: Update file header. lisp/cedet/semantic/analyze/complete.el: Add local variables for autoloading. (semantic-analyze-possible-completions, semantic-analyze-type-constants): Autoload. --- lisp/cedet/semantic/find.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index a8351baa51d..3d14303061c 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -175,6 +175,7 @@ If there are more than one in the same location, return the smallest tag. Return nil if there is no tag here." (car (nreverse (semantic-find-tag-by-overlay)))) +;;;###autoload (defun semantic-current-tag-parent () "Return the current tags parent in the current buffer. A tag's parent would be a containing structure, such as a type @@ -329,6 +330,7 @@ Used in completion." (semantic-tag-type-compound-p (car tags)) ,table)) +;;;###autoload (define-overloadable-function semantic-find-tags-by-scope-protection (scopeprotection parent &optional table) "Find all tags accessable by SCOPEPROTECTION. SCOPEPROTECTION is a symbol which can be returned by the method -- cgit v1.2.1 From 996bc9bf73f16625e00df0bb58ea98b2ca3ba317 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Sep 2009 01:00:36 +0000 Subject: * emacs-lisp/autoload.el (generated-autoload-load-name): New var. (autoload-generate-file-autoloads): Use it. (make-autoload): Handle define-overloadable-function. * emacs-lisp/lisp-mode.el (define-overloadable-function): Add doc-string-elt property for define-overloadable-function. lisp/cedet/semantic/analyze.el: Add generated-autoload-load-name var. lisp/cedet/semantic/ctxt.el: Add generated-autoload-load-name var. lisp/cedet/semantic/db.el: Add generated-autoload-load-name var. lisp/cedet/semantic/db-file.el: Add generated-autoload-load-name var. lisp/cedet/semantic/db-mode.el: Add generated-autoload-load-name var. lisp/cedet/semantic/db-typecache.el: Add generated-autoload-load-name var. lisp/cedet/semantic/doc.el: Add generated-autoload-load-name var. lisp/cedet/semantic/find.el: Add generated-autoload-load-name var. lisp/cedet/semantic/format.el: Add generated-autoload-load-name var. lisp/cedet/semantic/lex.el: Add generated-autoload-load-name var. lisp/cedet/semantic/sb.el: Require semantic/format. lisp/cedet/semantic/sort.el: Add generated-autoload-load-name var. lisp/cedet/semantic/tag.el: Add generated-autoload-load-name var. lisp/cedet/semantic/tag-file.el: Add generated-autoload-load-name var. lisp/cedet/semantic/tag-ls.el: Add generated-autoload-load-name var. --- lisp/cedet/semantic/find.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index 3d14303061c..4ab6a8d8a62 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -810,6 +810,7 @@ Optional argument ARG is the number of iterations to run." ;; Local variables: ;; generated-autoload-file: "loaddefs.el" ;; generated-autoload-feature: semantic/loaddefs +;; generated-autoload-load-name: "semantic/find" ;; End: ;;; semantic/find.el ends here -- cgit v1.2.1 From a964f5e552c64a53fb4b5c417f1825807cdcca6f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 13 Sep 2009 15:58:30 +0000 Subject: Synch to Eric M. Ludlam's upstream CEDET repository. * cedet/semantic/wisent/java-tags.el: * cedet/semantic/wisent/javat-wy.el: New files. * cedet/semantic/wisent/java.el: * cedet/semantic/wisent/java-wy.el: Files removed. * cedet/semantic/java.el (semantic-java-prototype-function) (semantic-java-prototype-variable, semantic-java-prototype-type): Doc fix (java-mode::semantic-format-tag-prototype): Renamed from semantic-format-prototype-tag, which didn't match the overloadable function. * cedet/semantic/bovine/c.el (semantic-c-dereference-namespace-alias): Deal correctly with nested namespaces. Make sure type actually exists in original namespace. * cedet/semantic/lex-spp.el (semantic-lex-spp-hack-depth): New. (semantic-lex-spp-lex-text-string): Use above to enable recursion. * cedet/semantic/format.el: Whitespace cleanup. (semantic-test-all-format-tag-functions): Move to end. (semantic-format-tag-prototype, semantic-format-tag-name) (semantic-format-tag-name-default): Revert to original upstream positions. * cedet/semantic/elp.el: File removed. * cedet/semantic/analyze.el (semantic-adebug-analyze): New function, moved here from semantic/adebug. * cedet/semantic/adebug.el: Declare external semanticdb functions. (semantic-adebug-analyze, semantic-adebug-edebug-expr): Deleted. * emacs-lisp/eieio.el (eieio-unbound): Default value is now robust to recompile. * emacs-lisp/eieio-datadebug.el: Add eieio objects to the list of data debug things to recognize. * emacs-lisp/eieio-comp.el: Synch to upstream. * cedet/data-debug.el: Don't require eieio and semantic/tag. If eieio is loaded, require eieio-datadebug. (data-debug-insert-ring-button): Do not be specific about the ring contents. (data-debug-thing-alist): Remove eieio and semantic specific entries. (data-debug-add-specialized-thing): New function. * cedet/cedet.el: Update commentary. * cedet/cedet-edebug.el: Require edebug and debug. --- lisp/cedet/semantic/find.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/cedet/semantic/find.el') diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index 4ab6a8d8a62..0a7475081be 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -53,7 +53,7 @@ ;; ;; These routines provide fast access to tokens based on a buffer that ;; has parsed tokens in it. Uses overlays to perform the hard work. - +;; ;;;###autoload (defun semantic-find-tag-by-overlay (&optional positionormarker buffer) "Find all tags covering POSITIONORMARKER by using overlays. @@ -257,7 +257,7 @@ TABLE is a semantic tags table. See `semantic-something-to-tag-table'." (nreverse result))) ;;; Top level Searches - +;; ;;;###autoload (defun semantic-find-first-tag-by-name (name &optional table) "Find the first tag with NAME in TABLE. -- cgit v1.2.1