GNU bug report logs -
#22156
CC Mode 5.33 (C++/l); Strange end-of-buffer error
Previous Next
Full log
View this message in rfc822 format
Alan Mackenzie <acm <at> muc.de> writes:
> On Sun, Dec 13, 2015 at 12:15:42AM -0500, Michael Welsh Duggan wrote:
>> Using emacs -Q /tmp/foo.cpp to start a new file, type the following:
>
>> struct foo<A<B,
>
>> When you type the comma, you should get an "End of buffer" error. The
>> error seems to be at the point following this in the backtrace:
>
> Yes. Thanks again for such a succinct bug report, and for the
> backtrace. For some reason I couldn't get Emacs to give me a backtrace
> no matter what I tried.
>
>> Debugger entered--returning value: nil
>> c-syntactic-re-search-forward("[<;{},|+&-]\\|[>)]" nil t t)
>> * c-forward-<>-arglist-recur(nil)
>> * c-forward-<>-arglist-recur(nil)
>> * c-forward-<>-arglist(nil)
>> * c-forward-name()
>> * c-forward-type(t)
>> * #[(preceding-token-end context last-cast-end)
>> "`\306\211\211\211\211\211\ ...
>> * apply(#[(preceding-token-end context last-cast-end)
>> "`\306\211\211\211\211\211 ...
>> * c-forward-decl-or-cast-1(1 nil nil)
>> c-just-after-func-arglist-p(1)
>> c-guess-basic-syntax()
>> c-indent-line()
>> c-electric-semi&comma(nil)
>> funcall-interactively(c-electric-semi&comma nil)
>> call-interactively(c-electric-semi&comma nil nil)
>> command-execute(c-electric-semi&comma)
>
>
>> Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit)
>> of 2015-11-26
>> Package: CC Mode 5.33 (C++/l)
>> Buffer Style: SiLK
>> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes
>> gen-string-delim gen-comment-delim syntax-properties 1-bit)
>
> [ Dump of CC Mode's state snipped, but appreciated. ]
>
> The cause was a simple coding error: after searching forward (for a
> closing >), c-forward-<>-arglist-recur failed to set point back to the
> starting place before trying the next possibility.
>
> Here is a patch which I hope fixes things. Please let me know whether
> or not it works satisfactorily.
I can confirm that this seems to fix the problem.
--
Michael Welsh Duggan
(md5i <at> md5i.com)
This bug report was last modified 9 years and 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.