From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C3=93scar?= Fuentes Newsgroups: gmane.emacs.bugs 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 Message-ID: <87aamn2f55.fsf_-___46472.0781812959$1286662331$gmane$org@telefonica.net> References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> <20101009211332.GA5486@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1286662331 8544 80.91.229.12 (9 Oct 2010 22:12:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2010 22:12:11 +0000 (UTC) Cc: 7181@debbugs.gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 10 00:12:10 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4heC-0008RS-Uk for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Oct 2010 00:12:09 +0200 Original-Received: from localhost ([127.0.0.1]:48955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4heB-0005Iw-PK for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Oct 2010 18:12:07 -0400 Original-Received: from [140.186.70.92] (port=41401 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4he5-0005Ir-DZ for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 18:12:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4he4-0000FK-9g for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 18:12:01 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4he3-0000Ey-0a; Sat, 09 Oct 2010 18:11:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P4hYH-0000AP-Pv; Sat, 09 Oct 2010 18:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 09 Oct 2010 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7181 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 7181-submit@debbugs.gnu.org id=B7181.1286661908629 (code B ref 7181); Sat, 09 Oct 2010 22:06:01 +0000 Original-Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 22:05:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4hXQ-0000A6-0h for submit@debbugs.gnu.org; Sat, 09 Oct 2010 18:05:08 -0400 Original-Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4hXN-00009k-3h for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 18:05:06 -0400 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm1.telefonica.net with bizsmtp id GlkW1f0120r0BT601m8QeS; Sun, 10 Oct 2010 00:08:24 +0200 Original-Received: from qcore ([83.52.52.115]) by IMPmailhost2.adm.correo with BIZ IMP id Gm8P1f0012V89Bn1im8PRk; Sun, 10 Oct 2010 00:08:24 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" In-Reply-To: <20101009211332.GA5486@muc.de> (Alan Mackenzie's message of "Sat, 9 Oct 2010 21:13:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 09 Oct 2010 18:06:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40789 Archived-At: Alan Mackenzie 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.