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

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

bug#11448: 24.1.50; Strange indentation level in C macro


From: Alan Mackenzie
Subject: bug#11448: 24.1.50; Strange indentation level in C macro
Date: Sat, 1 Jun 2013 13:56:09 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi, Michael!

On Thu, May 30, 2013 at 10:46:20PM -0400, Michael Welsh Duggan wrote:
> I'd like to bump this issue.

Sorry, I missed this one last year.

> I looked into it a little, and it looks like several of the macros
> before the point in question are being marked as c-in-sws, which
> doesn't seem right to me.  The code ends up evaluating
> `c-beginning-of-macro' in a buffer that is narrowed such that the
> beginning of the macro that it is trying to find the beginning of is
> cut off.

Yes, sort of.  I think the c-in-sws properties are right.

What I think is throwing it off is the calculation of a search limit
(effectively a buffer narrowing) in `c-guess-basic-syntax'.  That limit
was erroneously at a random position, but it actually needs to be at a
"syntactically neutral" position.

I put that limit calculation in as part of a large optimisation for a
~3,500 line macro which was causing scrolling to go very slowly.  Taking
it out again doesn't seem to slow it down all that badly.  So, out it
comes!

> The resulting indentation problem isn't horrible, but the bug that leads
> to this problem is subtle enough that it could be causing other problems
> in similar situations.

Yes.  Thanks for the bug report.  Could you try out this patch please.
I think it fixes the bug:



diff -r ce17d1595c2f cc-engine.el
--- a/cc-engine.el      Tue May 28 15:00:49 2013 +0000
+++ b/cc-engine.el      Sat Jun 01 13:52:38 2013 +0000
@@ -9396,10 +9396,6 @@
                          containing-sexp nil)))
              (setq lim (1+ containing-sexp))))
        (setq lim (point-min)))
-      (when (c-beginning-of-macro)
-       (goto-char indent-point)
-       (let ((lim1 (c-determine-limit 2000)))
-         (setq lim (max lim lim1))))
 
       ;; If we're in a parenthesis list then ',' delimits the
       ;; "statements" rather than being an operator (with the


> -- 
> Michael Duggan

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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