[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
font-lock-mode causes paren-matching to go haywire in c++-mode
From: |
Benjamin Rutt |
Subject: |
font-lock-mode causes paren-matching to go haywire in c++-mode |
Date: |
Thu, 11 Mar 2004 12:17:11 -0500 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v) |
Recipe for reproducing the bug:
1) In current CVS head, put the following C++ code in a buffer called
bug.cpp (cut between the ----- lines):
-----------------------------------------------------------------------------
int StormIndexingClient::chooseTable()
{
int idx = -1;
if ((idx < 1) ||
(idx > (int)len)) {
fprintf(stderr, "ERROR: invalid input %s\n", line);
}
idx--;
return idx;
}
-----------------------------------------------------------------------------
2) run emacs -q bug.cpp, and verify you're in c++-mode
3) type M-x font-lock-mode RET
4) put cursor on line 5 of the resulting buffer (line numbering
starting with 1)
5) place point on the '(' character at the beginning of the "(idx > ..."
expression
6) press C-M-n...instead of getting placed on the matching paren, you get
placed on the '>' character.
Another way to exhibit the bug is use M-x show-paren-mode RET and
place the point on the opening ( of line 5. It will show a faulty
matching end-paren.
I've tried to edebug this but the code ends up calling `scan-lists'
which is a primitive, so the bug must be down there.
Thanks,
Benjamin Rutt
In GNU Emacs 21.3.50.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2004-03-11 on akron.bmi.ohio-state.edu
configured using `configure '--with-gif' '--with-jpeg' '--with-png'
'--with-tiff' '--with-xpm' '--with-x' '--with-toolkit-scroll-bars'
'--with-x-toolkit=yes' '--prefix=/scratch/rutt/local' 'CC=gcc''
Important settings:
value of $LC_ALL: C
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
locale-coding-system: nil
default-enable-multibyte-characters: t
Major mode: C++
Minor modes in effect:
mouse-wheel-mode: t
menu-bar-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
line-number-mode: t
abbrev-mode: t
Recent input:
C-n M-x f o n t - l o c <tab> m o <tab> <return> C-n
C-n C-n C-f C-u C-u C-f C-f C-u C-b C-f C-M-n C-M-p
C-f C-u C-f C-u C-f C-M-p C-M-n C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-M-n C-M-p
C-M-n C-M-p C-M-n M-x s h o w - p a r <tab> C-g C-u
C-b C-b C-b C-M-n C-M-p C-u C-p C-u C-p C-a M-x r e
p o <tab> r <tab> <return>
Recent messages:
(./emacs -q /home/rutt/bug.cpp)
Loading tooltip...done
Loading image...done
Loading cc-mode...done
Loading font-lock...done
Loading jit-lock...done
Quit
Making completion list...
Loading help-mode...done
Loading emacsbug...done
- font-lock-mode causes paren-matching to go haywire in c++-mode,
Benjamin Rutt <=