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

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

Signature

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

Documentation

Find the next tag before 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-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 (previous-overlay-change os))
	(when os
	  ;; Get overlays at position
	  (setq ol (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 (overlay-get (car ol) 'semantic)
		     (semantic-tag-p
		      (overlay-get (car ol) '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 (overlay-get ol 'semantic)))
	(overlay-get ol 'semantic)))))