Function: semantic-tag-create-secondary-overlay

semantic-tag-create-secondary-overlay is a byte-compiled function defined in decorate.el.gz.

Signature

(semantic-tag-create-secondary-overlay TAG &optional LINK-HOOK)

Documentation

Create a secondary overlay for TAG.

Returns an overlay. The overlay is also saved in TAG. LINK-HOOK is a function called whenever TAG is to be linked into a buffer. It should take TAG and OVERLAY as arguments. The LINK-HOOK should be used to position and set properties on the generated secondary overlay.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/decorate.el.gz
(defun semantic-tag-create-secondary-overlay (tag &optional link-hook)
  "Create a secondary overlay for TAG.
Returns an overlay.  The overlay is also saved in TAG.
LINK-HOOK is a function called whenever TAG is to be linked into
a buffer.  It should take TAG and OVERLAY as arguments.
The LINK-HOOK should be used to position and set properties on the
generated secondary overlay."
  (if (not (semantic-tag-overlay tag))
      ;; do nothing if there is no overlay
      nil
    (let* ((os (semantic-tag-start tag))
	   (oe (semantic-tag-end tag))
	   (o (make-overlay os oe (semantic-tag-buffer tag) t))
	   (attr (semantic-tag-secondary-overlays tag))
	   )
      (semantic--tag-put-property tag 'secondary-overlays (cons o attr))
      (overlay-put o 'semantic-secondary t)
      (overlay-put o 'semantic-link-hook link-hook)
      (semantic-tag-add-hook tag 'link-hook 'semantic--tag-link-secondary-overlays)
      (semantic-tag-add-hook tag 'unlink-hook 'semantic--tag-unlink-secondary-overlays)
      (semantic-tag-add-hook tag 'unlink-copy-hook 'semantic--tag-unlink-copy-secondary-overlays)
      (run-hook-with-args link-hook tag o)
      o)))