Function: senator-next-tag

senator-next-tag is an autoloaded, interactive and byte-compiled function defined in senator.el.gz.

Signature

(senator-next-tag)

Documentation

Navigate to the next Semantic tag.

Return the tag or nil if at end of buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/senator.el.gz
;;; Navigation commands

;;;###autoload
(defun senator-next-tag ()
  "Navigate to the next Semantic tag.
Return the tag or nil if at end of buffer."
  (interactive)
  (semantic-error-if-unparsed)
  (let ((pos (point))
        (tag (semantic-current-tag))
        where)
    (if (and tag
             (not (senator-skip-p tag))
             (senator-step-at-start-end-p tag)
             (or (= pos (semantic-tag-start tag))
                 (senator-middle-of-tag-p pos tag)))
        nil
      (if (setq tag (senator-step-at-parent tag))
          nil
        (setq tag (semantic-find-tag-by-overlay-next pos))
        (while (and tag (senator-skip-p tag))
          (setq tag (semantic-find-tag-by-overlay-next
                       (semantic-tag-start tag))))))
    (if (not tag)
        (progn
          (goto-char (point-max))
          (message "End of buffer"))
      (cond ((and (senator-step-at-start-end-p tag)
                  (or (= pos (semantic-tag-start tag))
                      (senator-middle-of-tag-p pos tag)))
             (setq where "end")
             (goto-char (semantic-tag-end tag)))
            (t
             (setq where "start")
             (goto-char (semantic-tag-start tag))))
      (senator-momentary-highlight-tag tag)
      (message "%S: %s (%s)"
	       (semantic-tag-class tag)
	       (semantic-tag-name  tag)
	       where))
    tag))