Function: semantic-toggle-minor-mode-globally

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

Signature

(semantic-toggle-minor-mode-globally MODE &optional ARG)

Documentation

Toggle minor mode MODE in every Semantic enabled buffer.

Return non-nil if MODE is turned on in every Semantic enabled buffer. If ARG is positive, enable, if it is negative, disable. MODE must be a valid minor mode defined in minor-mode-alist and must be too an interactive function used to toggle the mode.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/util-modes.el.gz
(defun semantic-toggle-minor-mode-globally (mode &optional arg)
  "Toggle minor mode MODE in every Semantic enabled buffer.
Return non-nil if MODE is turned on in every Semantic enabled buffer.
If ARG is positive, enable, if it is negative, disable.
MODE must be a valid minor mode defined in `minor-mode-alist' and must be
too an interactive function used to toggle the mode."
  ;; FIXME: All callers should pass a -1 or +1 argument.
  (or (and (fboundp mode) (or (assq mode minor-mode-alist) ;Needed?
			      (assq mode semantic-minor-mode-alist)))
      (error "Semantic minor mode %s not found" mode))
  ;; Add or remove the MODE toggle function from `semantic-init-hook'.
  (cond
   ;; Turn off if ARG < 0
   ((< arg 0) (remove-hook 'semantic-init-hook mode))
   ;; Turn on if ARG > 0
   ((> arg 0) (add-hook 'semantic-init-hook mode))
   ;; Otherwise just check MODE state
   (t
    (error "semantic-toggle-minor-mode-globally: arg should be -1 or 1")))
  ;; Update the minor mode format.
  (semantic-mode-line-update)
  ;; Then turn MODE on or off in every Semantic enabled buffer.
  (semantic-map-buffers (lambda () (funcall mode arg))))