Function: c-toggle-syntactic-indentation

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

Signature

(c-toggle-syntactic-indentation &optional ARG)

Documentation

Toggle syntactic indentation.

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

When syntactic indentation is turned on (the default), the indentation functions and the electric keys indent according to the syntactic context keys, when applicable.

When it's turned off, the electric keys don't reindent, the indentation functions indents every new line to the same level as the previous nonempty line, and M-x c-indent-command (c-indent-command) adjusts the indentation in steps specified by c-basic-offset. The indentation style has no effect in this mode, nor any of the indentation associated variables, e.g. c-special-indent-hook.

This command sets the variable c-syntactic-indentation.

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
(defun c-toggle-syntactic-indentation (&optional arg)
  "Toggle syntactic indentation.
Optional numeric ARG, if supplied, turns on syntactic indentation when
positive, turns it off when negative, and just toggles it when zero or
left out.

When syntactic indentation is turned on (the default), the indentation
functions and the electric keys indent according to the syntactic
context keys, when applicable.

When it's turned off, the electric keys don't reindent, the indentation
functions indents every new line to the same level as the previous
nonempty line, and \\[c-indent-command] adjusts the indentation in steps
specified by `c-basic-offset'.  The indentation style has no effect in
this mode, nor any of the indentation associated variables,
e.g. `c-special-indent-hook'.

This command sets the variable `c-syntactic-indentation'."
  (interactive "P")
  (setq c-syntactic-indentation
	(c-calculate-state arg c-syntactic-indentation))
  (c-keep-region-active))