Function: semantic-set-tag-folded

semantic-set-tag-folded is a byte-compiled function defined in decorate.el.gz.

Signature

(semantic-set-tag-folded TAG &optional FOLDED)

Documentation

Fold TAG, such that only the first line of text is shown.

Optional argument FOLDED should be non-nil to fold the tag. nil implies the tag should be fully shown.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/decorate.el.gz
;;; Secondary Overlay Uses
;;
;; States to put on tags that depend on a secondary overlay.
(defun semantic-set-tag-folded (tag &optional folded)
  "Fold TAG, such that only the first line of text is shown.
Optional argument FOLDED should be non-nil to fold the tag.
nil implies the tag should be fully shown."
    ;; If they are different, do the deed.
    (let ((o (semantic-tag-folded-p tag)))
      (if (not folded)
	  ;; We unfold.
	  (when o
	    (semantic-tag-delete-secondary-overlay tag 'semantic-folded))
	(unless o
	  ;; Add the foldn
	  (setq o (semantic-tag-create-secondary-overlay tag))
	  ;; mark as folded
	  (overlay-put o 'semantic-folded t)
	  ;; Move to cover end of tag
	  (save-excursion
	    (goto-char (semantic-tag-start tag))
	    (end-of-line)
	    (move-overlay o (point) (semantic-tag-end tag)))
	  ;; We need to modify the invisibility spec for this to
	  ;; work.
	  (if (or (eq buffer-invisibility-spec t)
		  (not (assoc 'semantic-fold buffer-invisibility-spec)))
	      (add-to-invisibility-spec '(semantic-fold . t)))
	  (overlay-put o 'invisible 'semantic-fold)
	  (overlay-put o 'isearch-open-invisible
		       'semantic-set-tag-folded-isearch)))))