bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11749: Acknowledgement (24.1; C-mode indentation gives wrong-type-ar


From: Michael Welsh Duggan
Subject: bug#11749: Acknowledgement (24.1; C-mode indentation gives wrong-type-argument error.)
Date: Tue, 23 Oct 2012 12:13:50 -0400
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> Hi, Michael,
>
> On Wed, Oct 10, 2012 at 08:00:25PM +0000, Alan Mackenzie wrote:
>> On Tue, Oct 09, 2012 at 10:05:07AM -0400, Michael Welsh Duggan wrote:
>> > Alan Mackenzie <acm@muc.de> writes:
>
> [ .... ]
>
>> > > I have found the bug which is causing (most of) these dings, though I
>> > > don't think it is the one which caused Kim's original bug.  Could you try
>> > > out the patch below, please.  (I have also enhanced/corrected the
>> > > debugging routines a bit, too.)
>
>> > Still doesn't seem to help much here.  I have attached a file which
>> > reliably causes a cache failure.  I have attached the smallest file of
>> > the set of files I am working on that causes this particular problem.
>> > Load the attached file and toggle on parse state debugging.  Then scroll
>> > to the bottom of the file.  (Use C-v multiple times, or just M->.)  One
>> > reason I have attached this file is that it only triggers the warning
>> > message once.  Most of my larger files cause this to happen quite a lot.
>
>> What is happening in this file is another bug, arising from historical
>> assumptions which are no longer valid.
>
>> The "from scratch" calculation notes that the starting scanning position
>> would be a long way (>5000) back, hence it tries going back to the second
>> "beginning-of-defun" to get a top-level starting point.  This
>> "beginning-of-defun" is a pure "brace in column zero" test.
>
>> This doesn't work in C++ when constructs inside a namespace have braces
>> at column zero, something I believe has become very common in recent
>> years.  Namespaces didn't exist in C++ when c-parse-state was originally
>> written.
>
>> Obviously this optimisation is no longer valid.  I wouldn't be surprised
>> if it has caused quite a bit of buggy behaviour.  I'll need to think it
>> over for a few days to decide what to do.
>
> The only reasonable thing to do is to disable the heuristic for C++ Mode.
> This is what the patch below now does.  Could you try it out as usual,
> please.  Thanks!

Better, but doesn't solve all problems.  I'll see if I can't find
something reproducible for you.

-- 
Michael Welsh Duggan
(mwd@cert.org)





reply via email to

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