Function: c-lineup-runin-statements

c-lineup-runin-statements is a byte-compiled function defined in cc-align.el.gz.

Signature

(c-lineup-runin-statements LANGELEM)

Documentation

Line up statements when the first statement is on the same line as the block opening brace. E.g.:

int main()
{ puts ("Hello world!");
  return 0; <- c-lineup-runin-statements
}

If there is no statement after the opening brace to align with, nil is returned. This makes the function usable in list expressions.

Works with: The statement syntactic symbol.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-lineup-runin-statements (langelem)
  "Line up statements when the first statement is on the same line as
the block opening brace.  E.g.:

int main()
{ puts (\"Hello world!\");
  return 0;                 <- c-lineup-runin-statements
}

If there is no statement after the opening brace to align with, nil is
returned.  This makes the function usable in list expressions.

Works with: The `statement' syntactic symbol."
  (if (eq (char-after (c-langelem-pos langelem)) ?{)
      (save-excursion
	(if (c-langelem-pos langelem)
	    (goto-char (c-langelem-pos langelem)))
	(forward-char 1)
	(c-forward-comments (c-point 'eol))
	(unless (eolp)
	  (vector (current-column))))))