[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On the behavior of `c-beginning-of-defun'

From: Alan Mackenzie
Subject: Re: On the behavior of `c-beginning-of-defun'
Date: 30 Dec 2006 21:15:49 +0100
Date: Sat, 30 Dec 2006 21:27:15 +0000
User-agent: Mutt/1.5.9i

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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]