emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-neutralize-syntax-in-and-mark-CPP: Args out of range: 2, 3


From: Alan Mackenzie
Subject: Re: c-neutralize-syntax-in-and-mark-CPP: Args out of range: 2, 3
Date: Wed, 20 Jan 2010 10:40:57 +0000
User-agent: Mutt/1.5.9i

Hi,

On Tue, Jan 19, 2010 at 11:00:14AM -0600, Yuan MEI wrote:

>     I am following the latest bzr revno: 99377 (emacs version
> 23.1.91.1).  Start with `emacs -Q' and create a new .c file.  Then
> when I was trying to type `#include <stdio.h>', as soon as I typed the
> leading `#', the error `c-neutralize-syntax-in-and-mark-CPP: Args out
> of range: 2, 3' showed up.  Any reason why this is happening?  Also if
> I turn on the font-lock in cc-mode, after the first time such error
> occurred, the syntax highlighting went wrong (not completely off, but
> not reliable).

> Thanks,

Thanks for such a high quality bug report.

I have committed a fix into savannah.  Could you please update your bzr
Emacs and check that the bug is indeed fixed.

Alternatively, here is the patch which should fix it:



*** 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.

> ymei

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]