Function: semantic-toggle-decoration-style

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

Signature

(semantic-toggle-decoration-style NAME &optional ARG)

Documentation

Turn on/off the decoration style with NAME.

Decorations are specified in semantic-decoration-styles. With prefix argument ARG, turn on if positive, otherwise off. Return non-nil if the decoration style is enabled.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/decorate/mode.el.gz
(defun semantic-toggle-decoration-style (name &optional arg)
  "Turn on/off the decoration style with NAME.
Decorations are specified in `semantic-decoration-styles'.
With prefix argument ARG, turn on if positive, otherwise off.
Return non-nil if the decoration style is enabled."
  (interactive
   (list (completing-read "Decoration style: "
                          semantic-decoration-styles nil t)
         current-prefix-arg))
  (setq name (format "%s" name)) ;; Ensure NAME is a string.
  (unless (equal name "")
    (let* ((style (assoc name semantic-decoration-styles))
           (flag  (if arg
                      (> (prefix-numeric-value arg) 0)
                    (not (cdr style)))))
      (when (null style)
	(error "Unknown decoration style %s" name))
      (unless (eq (cdr style) flag)
        ;; Store the new flag.
        (setcdr style flag)
        ;; Refresh decorations is `semantic-decoration-mode' is on.
        (when semantic-decoration-mode
          (semantic-decoration-mode -1)
          (semantic-decoration-mode 1))
        (when (called-interactively-p 'interactive)
          (message "Decoration style %s turned %s" (car style)
                   (if flag "on" "off"))))
      flag)))