Function: c-lineup-knr-region-comment
c-lineup-knr-region-comment is a byte-compiled function defined in
cc-align.el.gz.
Signature
(c-lineup-knr-region-comment LANGELEM)
Documentation
Line up a comment in the "K&R region" with the declaration.
That is the region between the function or class header and the beginning of the block. E.g.:
int main()
/* This is the main function. */ <- c-lineup-knr-region-comment
{
return 0;
}
Return nil if called in any other situation, to be useful in list expressions.
Works with: comment-intro.
Probably introduced at or before Emacs version 22.1.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-align.el.gz
(defun c-lineup-knr-region-comment (_langelem)
"Line up a comment in the \"K&R region\" with the declaration.
That is the region between the function or class header and the
beginning of the block. E.g.:
int main()
/* This is the main function. */ <- c-lineup-knr-region-comment
{
return 0;
}
Return nil if called in any other situation, to be useful in list
expressions.
Works with: comment-intro."
(when (or (assq 'topmost-intro-cont c-syntactic-context)
(assq 'func-decl-cont c-syntactic-context)
(assq 'knr-argdecl-intro c-syntactic-context)
(assq 'lambda-intro-cont c-syntactic-context))
(save-excursion
(beginning-of-line)
(c-beginning-of-statement-1)
(vector (current-column)))))