Function: senator-previous-tag-or-parent

senator-previous-tag-or-parent is a byte-compiled function defined in senator.el.gz.

Signature

(senator-previous-tag-or-parent POS)

Documentation

Return the tag before POS or one of its parent where to step.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/senator.el.gz
(defun senator-previous-tag-or-parent (pos)
  "Return the tag before POS or one of its parent where to step."
  (let (ol tag)
    (while (and pos (> pos (point-min)) (not tag))
      (setq pos (previous-overlay-change pos))
      (when pos
        ;; Get overlays at position
        (setq ol (overlays-at pos))
        ;; find the overlay that belongs to semantic
        ;; and STARTS or ENDS at the found position.
        (while (and ol (not tag))
          (setq tag (overlay-get (car ol) 'semantic))
          (unless (and tag (semantic-tag-p tag)
                       (or (= (semantic-tag-start tag) pos)
                           (= (semantic-tag-end   tag) pos)))
            (setq tag nil
                  ol (cdr ol))))))
    (or (senator-step-at-parent tag) tag)))