Function: c-lineup-arglist-operators

c-lineup-arglist-operators is a byte-compiled function defined in cc-align.el.gz.

Signature

(c-lineup-arglist-operators LANGELEM)

Documentation

Line up lines starting with an infix operator under the open paren.

Return nil on lines that don't start with an operator, to leave those cases to other line-up functions. Example:

if ( x < 10
   || at_limit (x, <- c-lineup-arglist-operators
                list) <- c-lineup-arglist-operators returns nil
   )

Since this function doesn't do anything for lines without an infix operator you typically want to use it together with some other line-up settings, e.g. as follows (the arglist-close setting is just a suggestion to get a consistent style):

(c-set-offset 'arglist-cont '(c-lineup-arglist-operators 0))
(c-set-offset 'arglist-cont-nonempty '(c-lineup-arglist-operators
                                        c-lineup-arglist))
(c-set-offset 'arglist-close '(c-lineup-arglist-close-under-paren))

Works with: arglist-cont, arglist-cont-nonempty.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-lineup-arglist-operators (langelem)
  "Line up lines starting with an infix operator under the open paren.
Return nil on lines that don't start with an operator, to leave those
cases to other line-up functions.  Example:

if (  x < 10
   || at_limit (x,       <- c-lineup-arglist-operators
                list)    <- c-lineup-arglist-operators returns nil
   )

Since this function doesn't do anything for lines without an infix
operator you typically want to use it together with some other line-up
settings, e.g. as follows (the arglist-close setting is just a
suggestion to get a consistent style):

\(c-set-offset \\='arglist-cont \\='(c-lineup-arglist-operators 0))
\(c-set-offset \\='arglist-cont-nonempty \\='(c-lineup-arglist-operators
                                        c-lineup-arglist))
\(c-set-offset \\='arglist-close \\='(c-lineup-arglist-close-under-paren))

Works with: arglist-cont, arglist-cont-nonempty."
  (save-excursion
    (back-to-indentation)
    (when (looking-at "[-+|&*%<>=]\\|\\(/[^/*]\\)")
      ;; '-' can be both an infix and a prefix operator, but I'm lazy now..
      (c-lineup-arglist-close-under-paren langelem))))