From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Alan Mackenzie <acm@muc.de>
Cc: 7181@debbugs.gnu.org, emacs-devel@gnu.org
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 [thread overview]
Message-ID: <87aamn2f55.fsf_-___46472.0781812959$1286662331$gmane$org@telefonica.net> (raw)
In-Reply-To: <20101009211332.GA5486@muc.de> (Alan Mackenzie's message of "Sat, 9 Oct 2010 21:13:32 +0000")
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.
next prev parent reply other threads:[~2010-10-09 22:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-09 4:30 bug#7181: 24.0.50; args-out-of-range while reverting C++ header file Oscar Fuentes
2010-10-09 8:57 ` Eli Zaretskii
2010-10-09 13:39 ` Óscar Fuentes
2010-10-09 13:56 ` Óscar Fuentes
2010-10-09 21:13 ` Alan Mackenzie
[not found] ` <20101009211332.GA5486@muc.de>
2010-10-09 22:08 ` Óscar Fuentes [this message]
2010-10-09 23:33 ` Stefan Monnier
2010-10-10 14:09 ` bug#7181: 24.0.50; args-out-of-range while reverting C++ header file. PATCH Alan Mackenzie
[not found] ` <20101010140958.GA5249@muc.de>
2010-10-10 18:40 ` Óscar Fuentes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87aamn2f55.fsf_-___46472.0781812959$1286662331$gmane$org@telefonica.net' \
--to=ofv@wanadoo.es \
--cc=7181@debbugs.gnu.org \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).