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, 21 Jan 2007 09:22:49 +0800

All functions are in the attached file.  I'm sorry I forgot to
declare this.

Best regards,
Guanpeng Xu

From: "Herbert Euler" <address@hidden>
To: address@hidden, address@hidden
CC: address@hidden, address@hidden, address@hidden
Subject: Re: On the behavior of `c-beginning-of-defun'
Date: Sun, 21 Jan 2007 09:19:44 +0800

Please try out the amended version and let me know if anything's not
right.

I did not test all cases but only the case that function
`c-beginning-of-defun' fails.  I think it is almost Ok.  However,
please try the following case, it might be a bug.

Suppose `-!-' indicates the position of point.  If point is, for
example, in the body of function `main1':

   /* 1. K&R C.  */

   /* This will not get correct result until the bug in CC mode is fixed.
      See
http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg01341.html */
   int
   main1 (argc, argv)
        int argc;
        char *argv[];
   {
     -!-/* ...  */
   }

Then `c-beginning-of-defun' moves point to before ``int'':

   /* 1. K&R C.  */

   /* This will not get correct result until the bug in CC mode is fixed.
      See
http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg01341.html */
   -!-int
   main1 (argc, argv)
        int argc;
        char *argv[];
   {
     /* ...  */
   }

Which is a desired behavior.  But if point is just after ``[]'':

   /* 1. K&R C.  */

   /* This will not get correct result until the bug in CC mode is fixed.
      See
http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg01341.html */
   int
   main1 (argc, argv)
        int argc;
        char *argv[]-!-;
   {
     /* ...  */
   }

`c-beginning-of-defun' moves point to the start of the file, rather
than the desired position.

This is the only problem I can see until now.  Thank you very much.

Regards,
Guanpeng Xu

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


<< x.c >>


_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.com/





reply via email to

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