Re: CC Mode 5.31.8 (C++/lah); error on hilighting standard includes
Alan Mackenzie <acm <at> muc.de>
2010-01-20 13:09:06 GMT
Hi, Thomas,
On Wed, Jan 13, 2010 at 12:13:09PM -0600, Thomas Caswell wrote:
> When typeing the stardard #include an error is generated.
> test case:
> 1 open new file in c++-mode
> 2 type #include <string>
> 3 generates errors and does not highlight text and cursor does not jump
> back to the end. generates the following errors:
> c-neutralize-syntax-in-and-mark-CPP: Args out of range: 2, 3Error during redisplay:
(args-out-of-range 10 11)
> Error during redisplay: (args-out-of-range 11 12)
> byte-code: Args out of range: 18, 19
> Error during redisplay: (args-out-of-range 18 19)
> 4 if the file is reloaded with C-x C-v the highlighting works, but
> adding a second include also generates the
> byte-code: Args out of range: 18, 19
> error and does not jump back to the end
> 5 indenting does not work properly, but if the file is reloaded then it
> works again
OK, firstly, thanks for such a clear and explicit bug report.
I've committed a patch to savannah which should fix this. Please either
update your bzr version of Emacs, or apply the following patch.
Afterwards, make sure you byte-compile cc-langs.el, cc-engine.el and
cc-mode.el.
Here's the patch:
*** cc-defs.el~ 2010-01-19 13:24:48.000000000 +0000
--- cc-defs.el 2010-01-19 17:23:44.000000000 +0000
***************
*** 1217,1228 ****
;; This macro does a hidden buffer change.
`(progn
(c-put-char-property ,beg 'category 'c-cpp-delimiter)
! (c-put-char-property ,end 'category 'c-cpp-delimiter)))
(defmacro c-clear-cpp-delimiters (beg end)
;; This macro does a hidden buffer change.
`(progn
(c-clear-char-property ,beg 'category)
! (c-clear-char-property ,end 'category)))
(defsubst c-comment-out-cpps ()
;; Render all preprocessor constructs syntactically commented out.
--- 1217,1230 ----
;; This macro does a hidden buffer change.
`(progn
(c-put-char-property ,beg 'category 'c-cpp-delimiter)
! (if (< ,end (point-max))
! (c-put-char-property ,end 'category 'c-cpp-delimiter))))
(defmacro c-clear-cpp-delimiters (beg end)
;; This macro does a hidden buffer change.
`(progn
(c-clear-char-property ,beg 'category)
! (if (< ,end (point-max))
! (c-clear-char-property ,end 'category))))
(defsubst c-comment-out-cpps ()
;; Render all preprocessor constructs syntactically commented out.
[ CC Mode state dump cut, but appreciated. ]
--
--
Alan Mackenzie (Nuremberg, Germany).
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev