[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Parens matching does match wrong parentheses
From: |
Arjan Bos |
Subject: |
Parens matching does match wrong parentheses |
Date: |
Fri, 17 Sep 2004 20:11:28 +0200 |
To: address@hidden
Subject: Parens matching does match wrong parentheses types
--text follows this line--
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
Your bug report will be posted to the address@hidden mailing
list.
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
Dear emacs maintainers,
Currently I work a lot with rtf-files. These files are riddled with
matching curly braces `{ }'. Every now and then, a pair of curly braces
contains an open parentheses `(', or a closing parentheses `)'. The
functions (forward-sexp) and (backward-sexp), C-M-f and C-M-b match the
parentheses as a curly brace. Also, the font-locking for paren-mode
gets confused by this.
A sample, non-sensical, but syntacticly valid rtf code that contains
this problem is included here:
{\rtf1\mac\ansicpg10000\uc1
{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}}
The first `{' matches the last `}'. Only C-M-f jumps from the first `{'
to the one-to-last `}'. This is incorrect, as there are, in sequence
three opening parentheses `{', one closing parentheses `)' and three
closing curly braces `}'
Also, when point is on the first opening curly brace, and
(show-paren-mode 1) is in effect, it will, incorrectly show the first
'{' as non-matching.
This problem is not restricted to rtf-code, elisp also suffers from it.
Try auto-indenting the following piece of elisp:
(defvar generic-rtf-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?( "." table)
(modify-syntax-entry ?) "." table)
(modify-syntax-entry ?[ "." table)
(modify-syntax-entry ?] "." table)
table))
I hope that solving this bug will make the (emacs) world an even better
place.
Thanks a lot in advance for your time!
Arjan Bos
Appendices:
In GNU Emacs 21.3.50.4 (powerpc-apple-darwin7.5.0)
of 2004-09-05 on Arjan-Bos-Computer.local
configured using `configure '--enable-carbon-app' '--without-x''
Important settings:
value of $LC_ALL: nil
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: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
Major mode: Rtf-Generic
Minor modes in effect:
desktop-save-mode: t
show-paren-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <help-echo>
<down-mouse-1> <mouse-1> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down-mouse-1> <mouse-1>
<down> <down> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down-mouse-1> <mouse-1> <down> <down> <down> <down>
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> <down-mouse-1> <mouse-1> <down> <down> <down-mouse-1>
<mouse-1> C-v <down> <down> <down> <down> <down> <down>
<down> <down> <help-echo> <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> C-x k <return> <menu-bar> <help-menu> <r
eport-emacs-bug>
Recent messages:
Loading tex...done
Loading font-latex...done
Loading latex...done
Loading easy-mmode...done
Applying style hooks... done
Desktop: 29 buffers restored.
Quit
Mark set
View mode: type C-h for help, h for commands, q to quit.
Loading emacsbug...done
---
Multiple exclamation marks are a sure sign of a sick mind
-- (Terry Pratchett, Mort)
- Parens matching does match wrong parentheses,
Arjan Bos <=