Function: semantic-find-tag-by-overlay-next

semantic-find-tag-by-overlay-next is an autoloaded and byte-compiled function defined in find.el.gz.

Signature

(semantic-find-tag-by-overlay-next &optional START BUFFER)

Documentation

Find the next tag after START in BUFFER.

If START is in an overlay, find the tag which starts next, not the current tag.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/find.el.gz
;;;###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,
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 (next-overlay-change os))
	(when os
	  ;; Get overlays at position
	  (setq ol (overlays-at os))
	  ;; find the overlay that belongs to semantic
	  ;; and starts at the found position.
	  (while (and ol (listp ol))
	    (if (and (overlay-get (car ol) 'semantic)
		     (semantic-tag-p
		      (overlay-get (car ol) '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 (overlay-get ol 'semantic)))
	(overlay-get ol 'semantic)))))