Function: c-indent-multi-line-block

c-indent-multi-line-block is a byte-compiled function defined in cc-align.el.gz.

Signature

(c-indent-multi-line-block LANGELEM)

Documentation

Indent a multi line block c-basic-offset extra.

E.g.:

int *foo[] = { int *foo[] = {
    NULL, NULL,
    {17}, <-> { <- c-indent-multi-line-block
                                 17
                                 }
                             <--> c-basic-offset

The block may use any kind of parenthesis character. nil is returned if the line doesn't start with a multi line block, which makes the function usable in list expressions.

Work with: Almost all syntactic symbols, but most useful on *-open.

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-indent-multi-line-block (_langelem)
  "Indent a multi line block `c-basic-offset' extra.
E.g.:

int *foo[] = {           int *foo[] = {
    NULL,                    NULL,
    {17},         <->            {       <- c-indent-multi-line-block
                                 17
                                 }
                             <--> c-basic-offset

The block may use any kind of parenthesis character.  nil is returned
if the line doesn't start with a multi line block, which makes the
function usable in list expressions.

Work with: Almost all syntactic symbols, but most useful on *-open."
  (save-excursion
    (let ((eol (c-point 'eol)))
      (back-to-indentation)
      (if (and (eq (char-syntax (char-after)) ?\()
	       (or (not (c-safe (progn (c-forward-sexp) t)))
		   (> (point) eol)))
	  c-basic-offset
	nil))))