unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 7181@debbugs.gnu.org
Subject: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file
Date: Sat, 09 Oct 2010 15:39:14 +0200	[thread overview]
Message-ID: <87sk0f32pp.fsf@telefonica.net> (raw)
In-Reply-To: <83wrprn3ou.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 Oct 2010 10:57:53 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> emacs -Q
>> C-x C-f some-moderately-big-header-file.h
>> <make some big modification on disk to the file>
>> M-x revert-buffer
>> Lisp error: (args-out-of-range 580 36722)
>> 
>> The buffer is left semi-reverted, on an edited state. Doing a M-x
>> revert-buffer again works ok.
>> 
>> Setting debug-on-error to t shows this:
>> 
>> Debugger entered--Lisp error: (args-out-of-range 580 36722)
>>   remove-text-properties(580 36722 (category))
>
> Can you verify that the problem happens because one or both argument
> positions of remove-text-properties don't exist due to the changes?

Essentially, the end position which is out of range corresponds to the
size of the *previous* contents of the file, not of the current
file. For instance:

While visiting file ffi.h with size 26675, replace it on disk with
another version of 36721 bytes, revert-buffer, (args-out-of-range 580
26676).

If we are visiting the long version of ffi.h (the one with 36721 bytes)
and replace it on disk with the short version, then (args-out-of-range
580 36722).

On both cases the buffer is left with 580 bytes of content, part of them
belonging to the beginning of the file and the other part to the end of
the file. The first byte missing from the buffer after revert-buffer
fails is the first character which differs from one version to another
of the file.

I'll try to reduce a test case file.





  reply	other threads:[~2010-10-09 13:39 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 [this message]
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         ` bug#7181: after-change-functions hook arguments (was: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file) Óscar Fuentes
2010-10-09 23:33         ` bug#7181: 24.0.50; args-out-of-range while reverting C++ header file 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=87sk0f32pp.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=7181@debbugs.gnu.org \
    --cc=eliz@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).