Function: semantic-add-minor-mode

semantic-add-minor-mode is a byte-compiled function defined in util-modes.el.gz.

Signature

(semantic-add-minor-mode TOGGLE NAME)

Documentation

Register a new Semantic minor mode.

TOGGLE is a symbol which is the name of a buffer-local variable that is toggled on or off to say whether the minor mode is active or not. It is also an interactive function to toggle the mode.

NAME specifies what will appear in the mode line when the minor mode is active. NAME should be either a string starting with a space, or a symbol whose value is such a string.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/util-modes.el.gz
(defun semantic-add-minor-mode (toggle name)
  "Register a new Semantic minor mode.
TOGGLE is a symbol which is the name of a buffer-local variable that
is toggled on or off to say whether the minor mode is active or not.
It is also an interactive function to toggle the mode.

NAME specifies what will appear in the mode line when the minor mode
is active.  NAME should be either a string starting with a space, or a
symbol whose value is such a string."
  ;; Record how to display this minor mode in the mode line
  (let ((mm (assq toggle semantic-minor-mode-alist)))
    (if mm
        (setcdr mm (list name))
      (setq semantic-minor-mode-alist (cons (list toggle name)
                                       semantic-minor-mode-alist))))
  (semantic-mode-line-update)

  ;; Semantic minor modes don't work with Desktop restore.
  ;; This line will disable this minor mode from being restored
  ;; by Desktop.
  (when (boundp 'desktop-minor-mode-handlers)
    (add-to-list 'desktop-minor-mode-handlers
		 (cons toggle 'semantic-desktop-ignore-this-minor-mode))))