Function: semantic-highlight-func-highlight-current-tag

semantic-highlight-func-highlight-current-tag is a byte-compiled function defined in util-modes.el.gz.

Signature

(semantic-highlight-func-highlight-current-tag &optional DISABLE)

Documentation

Highlight the current tag under point.

Optional argument DISABLE will turn off any active highlight. If the current tag for this buffer is different from the last time this function was called, move the overlay.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/util-modes.el.gz
(defun semantic-highlight-func-highlight-current-tag (&optional disable)
  "Highlight the current tag under point.
Optional argument DISABLE will turn off any active highlight.
If the current tag for this buffer is different from the last time this
function was called, move the overlay."
  (when (and (not (minibufferp))
	     (or (not semantic-highlight-func-ct-overlay)
		 (eq (overlay-buffer
		      semantic-highlight-func-ct-overlay)
		     (current-buffer))))
    (let* ((tag (semantic-stickyfunc-tag-to-stick))
	   (ol semantic-highlight-func-ct-overlay))
      (when (not ol)
	;; No overlay in this buffer.  Make one.
	(setq ol (make-overlay (point-min) (point-min)
			       (current-buffer) t nil))
	(overlay-put ol 'highlight-func t)
	(overlay-put ol 'face 'semantic-highlight-func-current-tag-face)
	(overlay-put ol 'keymap semantic-highlight-func-mode-map)
	(overlay-put ol 'help-echo
			      "Current Function : mouse-3 - Context menu")
	(setq semantic-highlight-func-ct-overlay ol)
	)

      ;; TAG is nil if there was nothing of the appropriate type there.
      (if (or (not tag) disable)
	  ;; No tag, make the overlay go away.
	  (progn
	    (overlay-put ol 'tag nil)
	    (move-overlay ol (point-min) (point-min) (current-buffer)))

	;; We have a tag, if it is the same, do nothing.
	(unless (eq (overlay-get ol 'tag) tag)
	  (save-excursion
	    (goto-char (semantic-tag-start tag))
	    (search-forward (semantic-tag-name tag) nil t)
	    (overlay-put ol 'tag tag)
            (move-overlay ol (line-beginning-position) (line-end-position)))))))
  nil)