GNU bug report logs - #41002
Undo breaks inhibit-read-only text property

Previous Next

Package: emacs;

Reported by: Serhii Mozghovyi <egnartsms <at> gmail.com>

Date: Fri, 1 May 2020 15:42:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41002 <at> debbugs.gnu.org, egnartsms <at> gmail.com, larsi <at> gnus.org
Subject: bug#41002: Undo breaks inhibit-read-only text property
Date: Sat, 09 May 2020 16:34:43 +0300
On 09/05/2020 10:37 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin <at> fastmail.fm>
>> Date: Sun, 03 May 2020 06:22:20 +0300
>> Cc: 41002 <at> debbugs.gnu.org, larsi <at> gnus.org
>>
>> --- a/src/textprop.c
>> +++ b/src/textprop.c
>> @@ -2301,0 +2301,4 @@
>> +	  if (i->position + LENGTH (i) < end
>> +	      && (!NILP (BVAR (current_buffer, read_only))
>> +		  && NILP (Vinhibit_read_only)))
>> +	    xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
>>
>> So if there happens to be an (writeable) interval ending before "end"
>> (the end of the region we're killing with C-w), we will signal that the
>> buffer is read-only.  This may be read as "if we're going over the
>> boundary of an interval, then check the _buffer_ read-onliness".  Maybe
>> Lars, as the author of this code, could comment on this.
>
> I think you are right: we need to augment this with something that
> pays attention to the inhibit-read-only property.  Would you like to
> suggest a patch?

That property is checked in INTERVAL_WRITABLE_P just above, it looks
fine..  The problem is I don't know what the "if" I cited is for.

> Btw, how is this related to undo?

Before undo, we seem to have one interval spanning all the text.  After
undo, there appears a short interval on which "i->position + LENGTH (i)
< end" triggers.

Filipp




This bug report was last modified 5 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.