emacs-devel
[Top][All Lists]
Advanced

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

Re: Minor bug in c-beginning-of-defun. May I fix it?


From: Alan Mackenzie
Subject: Re: Minor bug in c-beginning-of-defun. May I fix it?
Date: 17 Apr 2007 21:47:14 +0200
Date: Tue, 17 Apr 2007 22:07:19 +0100
User-agent: Mutt/1.5.9i

Hi, Chong!

On Tue, Apr 17, 2007 at 03:07:36PM -0400, Chong Yidong wrote:
> Alan Mackenzie <address@hidden> writes:

> > !                (c-syntactic-re-search-forward "{" nil t))
> > --- 1531,1537 ----
> > !                (c-syntactic-re-search-forward "{" nil 'eob))

> Hi Alan,

> I played around with your patch a little, and noticed that it
> introduces a slight difference in the behavior of
> c-beginning-of-defun.  Consider the following file (not including the
> "----" characters, and including the final "\n\n"):

> -------------------
> int foo ()
> {
>   asdf;

>   if (asdf)
>     {
>       bar;
>     }
> }

> -------------------

> With point at bob, do C-u -1 M-x c-beginning-of-defun RET.

> Before the change, point moves to the newline just after the last }
> character, and on the same line.

This was the bug.  Just after the } is NOT a beginning-of-defun.

> After the change, it moves one additional line down.

> I guess this is harmless, but could you double-check?  

The new behaviour is correct: c-beginning-of-defun should emulate the
standard b-o-d; the only places point should end up at are a BOD or
[BE]OB.

> (Otherwise, the change looks OK to me, assuming you've tested it out
> thoroughly.)

I've tested it thoroughly.

-- 
Alan.




reply via email to

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