Function: c-lineup-topmost-intro-cont

c-lineup-topmost-intro-cont is a byte-compiled function defined in cc-align.el.gz.

Signature

(c-lineup-topmost-intro-cont LANGELEM)

Documentation

Line up declaration continuation lines zero or one indentation step.

For lines in the "header" of a definition, zero is used. For other lines, c-basic-offset is added to the indentation. E.g.:

int
neg (int i) <- c-lineup-topmost-intro-cont
{
    return -i;
}

struct
larch <- c-lineup-topmost-intro-cont
{
    double height;
}
    the_larch, <- c-lineup-topmost-intro-cont
    another_larch; <- c-lineup-topmost-intro-cont
<--> c-basic-offset

struct larch
the_larch, <- c-lineup-topmost-intro-cont
    another_larch; <- c-lineup-topmost-intro-cont

(This function is mainly provided to mimic the behavior of CC Mode
5.28 and earlier where this case wasn't handled consistently so that
these lines could be analyzed as either topmost-intro-cont or statement-cont.)

Works with: topmost-intro-cont.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
;; Standard line-up functions
;;
;; See the section "Custom Indentation Functions" in the manual for
;; details on the calling convention.

(defun c-lineup-topmost-intro-cont (langelem)
  "Line up declaration continuation lines zero or one indentation step.
For lines in the \"header\" of a definition, zero is used.  For other
lines, `c-basic-offset' is added to the indentation.  E.g.:

int
neg (int i)           <- c-lineup-topmost-intro-cont
{
    return -i;
}

struct
larch                 <- c-lineup-topmost-intro-cont
{
    double height;
}
    the_larch,        <- c-lineup-topmost-intro-cont
    another_larch;    <- c-lineup-topmost-intro-cont
<--> c-basic-offset

struct larch
the_larch,            <- c-lineup-topmost-intro-cont
    another_larch;    <- c-lineup-topmost-intro-cont

\(This function is mainly provided to mimic the behavior of CC Mode
5.28 and earlier where this case wasn't handled consistently so that
these lines could be analyzed as either topmost-intro-cont or
statement-cont.)

Works with: topmost-intro-cont."
  (save-excursion
    (beginning-of-line)
    (c-backward-syntactic-ws (c-langelem-pos langelem))
    (if (and (memq (char-before) '(?} ?,))
	     (not (and c-overloadable-operators-regexp
		       (c-after-special-operator-id))))
	c-basic-offset)))