emacs-devel
[Top][All Lists]
Advanced

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

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


From: Herbert Euler
Subject: Re: On the behavior of `c-beginning-of-defun'
Date: Sun, 31 Dec 2006 17:40:52 +0800

And is this a bug too?

For the following class definition:

class a_b::c_d1 : public e_f, public g_h
{
-!-};

Suppose -!- represents the location of point.  `c-beginning-of-defun'
moves point to

class a_b::c_d1 : -!-public e_f, public g_h
{
};

Rather than

-!-class a_b::c_d1 : public e_f, public g_h
{
};

Thanks in advance.

Regards,
Guanpeng Xu


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)

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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