Function: semantic-format-tag-short-doc-default

semantic-format-tag-short-doc-default is a byte-compiled function defined in format.el.gz.

Signature

(semantic-format-tag-short-doc-default TAG &optional PARENT COLOR)

Documentation

Display a short form of TAG's documentation. (Comments, or docstring.) Optional argument PARENT is the parent type if TAG is a detail. Optional argument COLOR means highlight the prototype with font-lock colors.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/format.el.gz
(defun semantic-format-tag-short-doc-default (tag &optional parent color)
  "Display a short form of TAG's documentation.  (Comments, or docstring.)
Optional argument PARENT is the parent type if TAG is a detail.
Optional argument COLOR means highlight the prototype with font-lock colors."
  (let* ((fname (or (semantic-tag-file-name tag)
		    (when parent (semantic-tag-file-name parent))))
	 (buf (or (semantic-tag-buffer tag)
		  (when parent (semantic-tag-buffer parent))))
	 (doc (semantic-tag-docstring tag buf)))
    (when (and (not doc) (not buf) fname)
      ;; If there is no doc, and no buffer, but we have a filename,
      ;; let's try again.
      (save-match-data
	(setq buf (find-file-noselect fname)))
      (setq doc (semantic-tag-docstring tag buf)))
    (when (not doc)
      (require 'semantic/doc)
      (setq doc (semantic-documentation-for-tag tag))
      )
    (setq doc
	  (if (not doc)
	      ;; No doc, use summarize.
	      (semantic-format-tag-summarize tag parent color)
	    ;; We have doc.  Can we devise a single line?
	    (if (string-match "$" doc)
		(substring doc 0 (match-beginning 0))
	      doc)
	    ))
    (when color
      (setq doc (semantic--format-colorize-text doc 'documentation)))
    doc
    ))