Function: semantic-find-tag-by-overlay
semantic-find-tag-by-overlay is an autoloaded and byte-compiled
function defined in find.el.gz.
Signature
(semantic-find-tag-by-overlay &optional POSITIONORMARKER BUFFER)
Documentation
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.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/find.el.gz
;;; 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.
;;
;;;###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.
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 (overlays-at (or positionormarker (point))))
(ret nil))
(while ol
(let ((tmp (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)))))))