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

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

Re: CC Mode 5.28 (C++); c-indent-sexp yields `Unbalanced close brace'


From: Martin Stjernholm
Subject: Re: CC Mode 5.28 (C++); c-indent-sexp yields `Unbalanced close brace'
Date: 19 Nov 2001 18:42:24 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Eric Hanchrow <offby1@blarg.net> wrote:

> --------------------8-<-cut-here-8-<--------------------
> namespace
> {
> 
> bob
> cat ()
> {
> 
> }
> 
> };
> 
> sam
> ted ()
> {
> }
> 
> frank
> harry (
> )
> 
> {
> }
> --------------------8-<-cut-here-8-<--------------------
> 
> start emacs with `-q'
> 
> find the file with 
> 
>         C-x C-f /tmp/weird.cpp RET
> 
> Put point before the last left-parenthesis -- perhaps like this
> 
>         M-< M-x goto-char RET 63 RET
> 
> Now hit M-C-q; you'll see the error `Unbalanced close brace at line 10'.

Bug verified, thank you. The following patch corrects it:

Index: cc-engine.el
===================================================================
RCS file: /cvsroot/cc-mode/cc-mode/cc-engine.el,v
retrieving revision 5.184
diff -c -r5.184 cc-engine.el
*** cc-engine.el        2001/02/21 18:15:14     5.184
--- cc-engine.el        2001/11/19 17:39:35
***************
*** 704,710 ****
                            (<= placeholder here)
                            (eq (char-after (1- placeholder)) ?\}))
                       (while t
!                        (setq last-bod (c-safe (scan-lists last-bod -1 1)))
                         (if (not last-bod)
                             (save-excursion
                               ;; bogus, but what can we do here?
--- 704,710 ----
                            (<= placeholder here)
                            (eq (char-after (1- placeholder)) ?\}))
                       (while t
!                        (setq last-bod (c-safe (scan-lists last-pos -1 1)))
                         (if (not last-bod)
                             (save-excursion
                               ;; bogus, but what can we do here?




reply via email to

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