From: Alan Mackenzie <address@hidden>
To: Herbert Euler <address@hidden>
CC: address@hidden, address@hidden, address@hidden,
address@hidden
Subject: Re: On the behavior of `c-beginning-of-defun'
Date: Sat, 30 Dec 2006 21:27:15 +0000
Hi, Guanpeng!
On Sat, Dec 30, 2006 at 12:09:55PM +0800, Herbert Euler wrote:
> Hello Alan,
[ .... ]
> I planned to use `c-beginning-of-defun' and `c-end-of-defun'. But I
> found a strange behavior of `c-beginning-of-defun'. In the attatched
> `x.c' file, `c-beginning-of-defun' moves point differently for the
> function `main' and others. For the `main' function, it moves point
> to the open of the function body, i.e. before the { at line 6; for
> other functions, it moves point to the beginning of the definition of
> the function, i.e. before the type specification of the return value
> of the function.
[ .... ]
> Is this a bug or a desired behavior of `c-beginning-of-defun'?
The behaviour of c-beginning-of-defun in your `main' function is a bug.
c-b-o-d should go to before "int \nmain". As you wrote, the square
brackets in "*argv[]" is confusing the function. Thanks for reporting
this bug!
I'll try and fix it soon.
> Please reply to both this mail address (address@hidden) and my
> orignal mail address (address@hidden) if possible.
> Thanks in advance.
> Regards,
> Guanpeng Xu
> int
> main (argc, argv)
> int argc;
> char *argv[];
> {
> if ()
> ;
> }
[ .... ]
--
Alan Mackenzie (Ittersbach, Germany)