Function: semantic-documentation-for-tag

semantic-documentation-for-tag is an autoloaded and byte-compiled function defined in doc.el.gz.

Signature

(semantic-documentation-for-tag &optional TAG NOSNARF)

Documentation

Find documentation from TAG and return it as a clean string.

TAG might have DOCUMENTATION set in it already. If not, there may be some documentation in a comment preceding TAG's definition which we can look for. When appropriate, this can be overridden by a language specific enhancement. Optional argument NOSNARF means return only the lexical analyzer token for it. If NOSNARF is lex, then only return the lex token.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/doc.el.gz
;;; Code:

;;;###autoload
(define-overloadable-function semantic-documentation-for-tag (&optional tag nosnarf)
  "Find documentation from TAG and return it as a clean string.
TAG might have DOCUMENTATION set in it already.  If not, there may be
some documentation in a comment preceding TAG's definition which we
can look for.  When appropriate, this can be overridden by a language specific
enhancement.
Optional argument NOSNARF means return only the lexical analyzer token for it.
If NOSNARF is `lex', then only return the lex token."
  (if (not tag) (setq tag (semantic-current-tag)))
  (save-excursion
    (when (semantic-tag-with-position-p tag)
      (set-buffer (semantic-tag-buffer tag)))
    (:override
     ;; No override.  Try something simple to find documentation nearby
     (save-excursion
       (semantic-go-to-tag tag)
       (let ((doctmp (semantic-tag-docstring tag (current-buffer))))
	 (or
	  ;; Is there doc in the tag???
	  doctmp
	  ;; Check just before the definition.
	  (when (semantic-tag-with-position-p tag)
	    (semantic-documentation-comment-preceding-tag tag nosnarf))
	  ;;  Let's look for comments either after the definition, but before code:
	  ;; Not sure yet.  Fill in something clever later....
	  nil))))))