Function: c-block-in-arglist-dwim
c-block-in-arglist-dwim is a byte-compiled function defined in
cc-align.el.gz.
Signature
(c-block-in-arglist-dwim ARGLIST-START)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-block-in-arglist-dwim (arglist-start)
;; This function implements the DWIM to avoid far indentation of
;; brace block constructs in arguments in `c-lineup-arglist' etc.
;; Return non-nil if a brace block construct is detected within the
;; arglist starting at ARGLIST-START.
(or
;; Check if the syntactic context contains any of the symbols for
;; in-expression constructs. This can both save the work that we
;; have to do below, and it also detect the brace list constructs
;; that `c-looking-at-inexpr-block' currently misses (they are
;; recognized by `c-inside-bracelist-p' instead).
(assq 'inexpr-class c-syntactic-context)
(assq 'inexpr-statement c-syntactic-context)
(assq 'inlambda c-syntactic-context)
(save-restriction
;; Search for open braces from the arglist start to the end of the
;; line.
(narrow-to-region arglist-start (c-point 'eol arglist-start))
(goto-char arglist-start)
(while (and (c-syntactic-re-search-forward "{" nil t)
(progn
(backward-char)
(or
;; Ignore starts of special brace lists.
(and c-special-brace-lists
(save-restriction
(widen)
(c-looking-at-special-brace-list)))
;; Ignore complete blocks.
(c-safe (c-forward-sexp) t))))
(forward-char))
(looking-at "{"))
(let (containing-sexp)
(goto-char arglist-start)
;; `c-syntactic-eol' always matches somewhere on the line.
(re-search-forward c-syntactic-eol)
(goto-char (match-beginning 0))
(c-forward-syntactic-ws)
(setq containing-sexp (c-most-enclosing-brace (c-parse-state)))
(c-looking-at-inexpr-block
(c-safe-position (or containing-sexp (point)) c-state-cache)
containing-sexp))))