"Stephen J. Turnbull" <stephen(a)xemacs.org> wrote:
>>>>> "S" == S David Pullara
<sdpullara(a)yahoo.ca> writes:
namespace {
const char* hello()
{ return "hello"; }
} //namespace
MyClass::MyClass()
{}
void foo()
{
}
S> Go to the definition of foo() and try to hit tab, or try to
S> reindent. The mode thinks there is a brace mismatch, but if
S> you look you'll see that there is no mismatch;
S> blink-matching-open also sees each matching brace if you do it
S> at each closing brace.
This is a problem with the routine c-parse-state in CC Mode that finds
out the parenthesis state around the indentation position. The
following patch fixes it. I'd appreciate if it's installed in the
XEmacs package of CC Mode. Thanks.
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?