Function: c-indent-line-or-region

c-indent-line-or-region is an interactive and byte-compiled function defined in cc-cmds.el.gz.

Signature

(c-indent-line-or-region &optional ARG REGION)

Documentation

Indent active region, current line, or block starting on this line.

In Transient Mark mode, when the region is active, reindent the region. Otherwise, with a prefix argument, rigidly reindent the expression starting on the current line. Otherwise reindent just the current line.

View in manual

Probably introduced at or before Emacs version 20.4.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
(defun c-indent-line-or-region (&optional arg region)
  "Indent active region, current line, or block starting on this line.
In Transient Mark mode, when the region is active, reindent the region.
Otherwise, with a prefix argument, rigidly reindent the expression
starting on the current line.
Otherwise reindent just the current line."
  (interactive
   (list current-prefix-arg (c-region-is-active-p)))
  (c-with-string-fences
   (if region
       (c-indent-region (region-beginning) (region-end))
     (c-indent-command arg))))