emacs-devel
[Top][All Lists]
Advanced

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

Re: c-indent-line-or-region with 500 char


From: Alan Mackenzie
Subject: Re: c-indent-line-or-region with 500 char
Date: Mon, 28 Jan 2019 11:11:20 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Yashi.

Unfortunately, the patch I suggested in my last post was faulty.

I've now committed a better patch to Emacs master, which should have
fixed the problem.

All the best!

-- 
Alan Mackenzie (Nuremberg, Germany).


On Sat, Dec 08, 2018 at 13:53:51 +0000, Alan Mackenzie wrote:
> Hello, Yashi.

> On Mon, Nov 26, 2018 at 22:19:15 +0900, Yasushi SHOJI wrote:
> > Hello,

> > I just found this odd behavior on my Emacs and I'd like to ask how to
> > fix it.  I'm attaching a.c with 500 chars in. Go to the very bottom of
> > the file and hitting the tab will move the cursors to the right. hitting the
> > tab key again moves it again. It just keeps going.

> > If you delete some char from the file, it stop behaving.

> > I can reproduce this with the following Emacs with `-q`.

> >  - Debian Sid's Emacs 1:25.2+1-11
> >  - The current tip of emacs-26 branch (ea624626)

> > Does anyone see the behavior?

> Yes, this was one of these bugs which was fairly easy to diagnose, but
> difficult to decide how to fix.  Thanks for taking the trouble to report
> this.

> Your file is actually 502 bytes long.  At some place in CC Mode, there
> was a call to (c-beginning-of-statement-1 ...) with a search limit of
> 500 bytes.  This just failed to reach the # of the #define at the
> beginning of the buffer, hence mis-analysed the text, leading to the
> strange behaviour.

> When a random byte is removed, this 500 limit was just big enough to
> reach that # at the beginning of the buffer, hence analysed it
> correctly, and the <tab> key worked properly.

> The fix in the patch below amends c-beginning-of-statement-1 to detect
> hitting the limit.  It should apply cleanly to the emacs-26 branch.

> Could you please try out this patch (to
> emacs/lisp/progmodes/cc-engine.el), byte compile cc-engine.el, try it
> out on your real code, and confirm to me that it fixes the bug, or tell
> me what's still not working.  If you want any help applying the patch or
> byte compiling the file, feel free to send me private email.

> Thanks again for the report!

[ .... ]



reply via email to

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