GNU bug report logs -
#8219
23.3; Crash in indirect buffer
Previous Next
Reported by: Chong Yidong <cyd <at> stupidchicken.com>
Date: Thu, 10 Mar 2011 20:25:02 UTC
Severity: normal
Merged with 1242
Found in version 23.3
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Chong Yidong <cyd <at> stupidchicken.com>
> Date: Fri, 11 Mar 2011 14:48:21 -0500
> Cc: 8219 <at> debbugs.gnu.org
>
> Now consider what happens when a deletion is performed in buffer A,
> which is the base buffer for an indirect buffer B. It appears that the
> responsible functions, such as del_range_2, only update the attributes
> of buffer A, making no effort to update buffer B.
>
> Hence, in the aftermath of a deletion, buffer B's values of PT (and
> BUF_BEGV and BUF_ZV) can be larger than BUF_ZV.
Isn't that a bug, right there? Why doesn't del_range_2 update the
indirect buffer (B) as well, when deletion removes text so that its PT
becomes invalid?
The ELisp manual says:
The text of the indirect buffer is always identical to the text of
its base buffer; changes made by editing either one are visible
immediately in the other. This includes the text properties as well as
the characters themselves.
In all other respects, the indirect buffer and its base buffer are
completely separate. They have different names, independent values of
point, independent narrowing, independent markers and overlays (though
inserting or deleting text in either buffer relocates the markers and
overlays for both), [...]
This makes a lot of sense, but your description seems to point out
that the implementation does not behave according to the docs: if
markers are (or should be) relocated in sync as result of insertion
and deletion, the same should happen with PT, BUF_BEGV, etc.
Am I missing something? If not, the solution is to update the
attributes of the indirect buffer so as to preserve the invariants,
like PT <= BUF_Z etc.
> However, I suspect that we have other places in the code that assumes
> that if a point is smaller than BUF_ZV, it's necessarily smaller than
> BUF_Z
It is madness IMO to allow BUF_Z and BUF_ZV be out of sync.
This bug report was last modified 14 years and 71 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.