Function: c-lineup-ObjC-method-call-colons
c-lineup-ObjC-method-call-colons is a byte-compiled function defined
in cc-align.el.gz.
Signature
(c-lineup-ObjC-method-call-colons LANGELEM)
Documentation
Line up selector args as Project Builder / XCode: colons of first
selector portions on successive lines are aligned. If no decision can
be made return NIL, so that other lineup methods can be tried. This is
typically chained with c-lineup-ObjC-method-call.
Works with: objc-method-call-cont.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-lineup-ObjC-method-call-colons (langelem)
"Line up selector args as Project Builder / XCode: colons of first
selector portions on successive lines are aligned. If no decision can
be made return NIL, so that other lineup methods can be tried. This is
typically chained with `c-lineup-ObjC-method-call'.
Works with: objc-method-call-cont."
(save-excursion
(catch 'no-idea
(let* ((method-arg-len (progn
(back-to-indentation)
(if (search-forward ":" (c-point 'eol) 'move)
(- (point) (c-point 'boi))
; no complete argument to indent yet
(throw 'no-idea nil))))
(extra (save-excursion
; indent parameter to argument if needed
(back-to-indentation)
(c-backward-syntactic-ws (c-langelem-pos langelem))
(if (eq ?: (char-before))
c-objc-method-parameter-offset 0)))
(open-bracket-col (c-langelem-col langelem))
(arg-ralign-colon-ofs (progn
(forward-char) ; skip over '['
; skip over object/class name
; and first argument
(c-forward-sexp 2)
(if (search-forward ":" (c-point 'eol) 'move)
(- (current-column) open-bracket-col
method-arg-len extra)
; previous arg has no param
c-objc-method-arg-unfinished-offset))))
(if (>= arg-ralign-colon-ofs c-objc-method-arg-min-delta-to-bracket)
(+ arg-ralign-colon-ofs extra)
(throw 'no-idea nil))))))