[Top][All Lists]

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

bug#7181: 24.0.50; args-out-of-range while reverting C++ header file

From: Stefan Monnier
Subject: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file
Date: Sun, 10 Oct 2010 01:33:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> With the attached files the problem can be reproduced predictability:
>> Save the attached files b.h.master and b.h.next to a directory and cd to
>> it.
>> $ emacs -Q &
>> $ cp b.h.master b.h
>> C-x C-f b.h
>> $ cp b.h.next b.h
>> M-x revert-buffer
>> and the args-out-of-range error pops:
>> c-clear-char-property-with-value-function: Args out of range: 166, 453
>> I was unable to try with the latest Emacs sources because the build is
>> broken. My Emacs is from the 16 September.

> Thanks for the recipe.  I turned on debug-on-error and got this
> traceback:

> Debugger entered--Lisp error: (args-out-of-range 166 453)
>   remove-text-properties(166 453 (category))
>   c-clear-char-property-with-value-function(1 453 category c-cpp-delimiter)
>   c-neutralize-syntax-in-and-mark-CPP(94 94 286)
>   c-after-change(94 94 286) <<======================================
>   insert-file-contents("/home/acm/b.h" t nil nil t)
>   revert-buffer(t)
>   call-interactively(revert-buffer nil nil)

> c-after-change is on the after-change-functions hook.  The values of BEG
> END OLD-LEN it is being passed look utterly wrong.  BEG and END should
> delimit the entire buffer and OLD-LEN should be the length of the
> previous buffer.  Surely?

No, here the after-change is called right after removing the chars that
are different, and just before inserting the new (different) chars.
You can reproduce the same error without reverting:

emacs -Q b.h.master
M-x c-mode
C-u 93 C-f
C-u 286 C-f


reply via email to

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