bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#7181: after-change-functions hook arguments (was: bug#7181: 24.0.50;


From: Óscar Fuentes
Subject: bug#7181: after-change-functions hook arguments (was: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file)
Date: Sun, 10 Oct 2010 00:08:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> 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?

Seems that insert-file-contents is trying to be smart and determine
which parts of the contents are shared among the old and the new
text. On this case b.h.next and b.h.master differ only on the central
region of text. The arguments passed to c-after-change indicates a
deletion from position 94 to position 94+286=380.

I don't know if that is correct, as the transformation is not a deletion
but a replacement of the middle text segment of the buffer with a text
chunk of different lenght, and the doc is not clear about that case.





reply via email to

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