Subject: bug#6688: Acknowledgement (23.2; Auto-fill broken in C/C++ modes.)

From: Alan Mackenzie <[email-masked]>
Date: Sat, 24 Jul 2010 20:26:05 +0000

Hi, Matthieu,

thanks for such a wonderfully helpful bug report!

On Wed, Jul 21, 2010 at 07:27:37PM +0200, Matthieu Moy wrote:
> Digging a bit further, I found out in this example:

> /*
>   Test

> */

> * The problems seems to be that the last */ is at the beginning of
>   line. If I add a space before, the problem disapears. It seems to be
>   a problem with `c-mask-paragraph', around this

> 		(let* ((ender-start (save-excursion
> 				      (goto-char (cdr c-lit-limits))
> 				      (skip-syntax-backward "^w ")
> 				      (point)))

The problem is indeed nearby, in c-mask-paragraph.  Would you please try
out the patch below, indeed please test it as intensively as possible
and let me know if there are any remaining problems.  The code here is
complicated enough for me not to be totally confident about the patch.

>   since the skip-syntax-backward will skip the newline and move out of
>   the line of the */.

> * If I download version 5.31.3 of cc-mode and install it, the problem
>   goes away.

> Hope this helps,

Very much so!

#########################################################################

Hi, Martin,

would you please try this patch out on the test case for which you
committed change 83096, and let me know if that bug remains fixed.
83096 is this one:

------------------------------------------------------------
revno: 83096
committer: Martin Rudalics <[email-masked]>
timestamp: Sat 2007-12-08 09:55:18 +0000
message:
  (c-mask-paragraph): Avoid invalid search
    bound error in block comment branch.
    
Thanks!

#########################################################################

> -- 
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/

-- 
Alan Mackenzie (Nuremberg, Germany).