Enrico Scholz <enrico.scholz(a)informatik.tu-chemnitz.de> wrote:
c++-mode seems to misinterpret statements like
| if (c<0 || c>99)
as some kind of template specification. /.../
I overlooked expressions like that when I made the template parsing
heuristics, but I've now tuned them for it. 5.30.8 will be available
shortly with the fix. Thank you.
E.g. when a file 'foo.cc' contains
int main()
{
if (c<0 || c>99) {}
}
I can reproduce it with:
| $ xemacs -vanilla
| M-x load-library<CR>completion
| select 'Options -> Syntax Highlighting -> In This Buffer' in the menu
| C-x C-f foo.cc
| press 'C-f' subsequently until the '0' will be reached (from
'c<0')
Now, I get:
| (1) (error/warning) Error in `pre-command-hook' (setting hook to nil): (error
Containing expression ends prematurely)
The stack-trace is
| Signaling: (error "Containing expression ends prematurely")
| scan-sexps(22 -1)
| symbol-under-point()
| symbol-under-or-before-point()
| use-completion-under-or-before-point()
| completion-before-command()
This is however a problem in completion mode. I imagine the same thing
can occur for legitimate templates. My guess is that the completion
package doesn't cope with non-paren chars (i.e. "<" and ">")
behaving
as parens through syntax-table properties.
I've therefore cc'd this to xemacs-beta(a)xemacs.org.
Emacs : XEmacs 21.4 (patch 14) "Reasonable Discussion"
[Lucid] (i386-redhat-linux, Mule) of Wed Oct 15 2003 on kosh.ultra.csn.tu-chemnitz.de
Package: CC Mode 5.30.7 (C)
Buffer Style: gnu
c-emacs-features: (pps-extended-state gen-string-delim syntax-properties 8-bit)