Function: semantic-tag-mode
semantic-tag-mode is a byte-compiled function defined in tag.el.gz.
Signature
(semantic-tag-mode &optional TAG)
Documentation
Return the major mode active for TAG.
TAG defaults to the tag at point in current buffer.
If TAG has a :mode property return it.
If point is inside TAG bounds, return the major mode active at point.
Return the major mode active at beginning of TAG otherwise.
See also the function semantic-ctxt-current-mode.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/tag.el.gz
(defun semantic-tag-mode (&optional tag)
"Return the major mode active for TAG.
TAG defaults to the tag at point in current buffer.
If TAG has a :mode property return it.
If point is inside TAG bounds, return the major mode active at point.
Return the major mode active at beginning of TAG otherwise.
See also the function `semantic-ctxt-current-mode'."
(or tag (setq tag (semantic-current-tag)))
(or (semantic--tag-get-property tag :mode)
(let ((buffer (semantic-tag-buffer tag))
(start (semantic-tag-start tag))
(end (semantic-tag-end tag)))
(save-excursion
(and buffer (set-buffer buffer))
;; Unless point is inside TAG bounds, move it to the
;; beginning of TAG.
(or (and (>= (point) start) (< (point) end))
(goto-char start))
(require 'semantic/ctxt)
(semantic-ctxt-current-mode)))))