Function: semantic-decoration-mode

semantic-decoration-mode is an interactive and byte-compiled function defined in mode.el.gz.

Signature

(semantic-decoration-mode &optional ARG)

Documentation

Minor mode for decorating tags.

Decorations are specified in semantic-decoration-styles. You can define new decoration styles with define-semantic-decoration-style.

The minor mode can be turned on only if semantic feature is available and the current buffer was set up for parsing. Return non-nil if the minor mode is enabled.

This is a minor mode. If called interactively, toggle the Semantic-Decoration mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate semantic-decoration-mode(var)/semantic-decoration-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/decorate/mode.el.gz
(define-minor-mode semantic-decoration-mode
  "Minor mode for decorating tags.
Decorations are specified in `semantic-decoration-styles'.  You
can define new decoration styles with
`define-semantic-decoration-style'.

The minor mode can be turned on only if semantic feature is
available and the current buffer was set up for parsing.  Return
non-nil if the minor mode is enabled."
;;
;;\\{semantic-decoration-map}"
  :lighter nil
  (if semantic-decoration-mode
      (if (not (and (featurep 'semantic) (semantic-active-p)))
          (progn
            ;; Disable minor mode if semantic stuff not available
            (setq semantic-decoration-mode nil)
            (error "Buffer %s was not set up for parsing"
                   (buffer-name)))
        ;; Add hooks
        (add-hook 'semantic-after-partial-cache-change-hook
                  #'semantic-decorate-tags-after-partial-reparse nil t)
        (add-hook 'semantic-after-toplevel-cache-change-hook
                  #'semantic-decorate-tags-after-full-reparse nil t)
        ;; Add decorations to available tags.  The above hooks ensure
        ;; that new tags will be decorated when they become available.
        ;; However, don't do this immediately, because EDE will be
        ;; activated later by find-file-hook, and includes might not
        ;; be found yet.
	(run-with-idle-timer
	 0.1 nil
	 (lambda ()
	   (semantic-decorate-add-decorations (semantic-fetch-available-tags)))))
    ;; Remove decorations from available tags.
    (semantic-decorate-clear-decorations (semantic-fetch-available-tags))
    ;; Cleanup any leftover crap too.
    (semantic-decorate-flush-decorations)
    ;; Remove hooks
    (remove-hook 'semantic-after-partial-cache-change-hook
                 #'semantic-decorate-tags-after-partial-reparse t)
    (remove-hook 'semantic-after-toplevel-cache-change-hook
                 #'semantic-decorate-tags-after-full-reparse t)))