Subject: bug#8406: 23.3; cc-engine.el incorrectly classifies member-init-intro as member-init-cont

From: Chong Yidong <[email-masked]>
Date: Sun, 29 Jan 2012 15:14:19 +0800

Hi Alan,

Could you review the following bug report, which has an attached patch?
Thanks.

Ian Masters <[email-masked]> writes:

> 1. Launch emacs
>
> emacs -Q
>
> 2. Create a new buffer
>
> C-x b test.cpp <RET>
>
> 3. Enter c++ mode
>
> M-x c++-mode <RET>
>
> 4. Insert the following constructor which includes a member initializer
> list:
>
> Class::Class(int i)
> :m_i(i)
> {
>
> }
>
> 5. With point on the initializer list on line 2 query the syntactic
> information:
>
> C-c C-s
>
> which returns:
>
> ((member-init-cont 28))
>
> 6. Add a space at the beginning of line 2 to give:
>
> Class::Class(int i)
>  :m_i(i)
> {
>
> }
>
> 7. With point on the initializer list on line 2 query the syntactic
> information again:
>
> C-c C-s
>
> now correctly identifies the line as intro rather than cont:
>
> ((member-init-intro 1))
>
> 8. The following change to lisp/progmodes/cc-engine.el fixes the issue:
>
> 8121c8121
> <             (if (or (> tmp-pos indent-point)
> ---
>>             (if (or (>= tmp-pos indent-point)