Function: c-toggle-electric-state

c-toggle-electric-state is an interactive and byte-compiled function defined in cc-cmds.el.gz.

Signature

(c-toggle-electric-state &optional ARG)

Documentation

Toggle the electric indentation feature.

Optional numeric ARG, if supplied, turns on electric indentation when positive, turns it off when negative, and just toggles it when zero or left out.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
(defun c-toggle-electric-state (&optional arg)
  "Toggle the electric indentation feature.
Optional numeric ARG, if supplied, turns on electric indentation when
positive, turns it off when negative, and just toggles it when zero or
left out."
  (interactive "P")
  (setq c-electric-flag (c-calculate-state arg c-electric-flag))
  (c-update-modeline)
  (when (fboundp 'electric-indent-local-mode) ; Emacs 24.4 or later.
    (electric-indent-local-mode (if c-electric-flag 1 0)))
  (c-keep-region-active))