unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: Serhii Mozghovyi <egnartsms@gmail.com>
Cc: 41002@debbugs.gnu.org, larsi@gnus.org
Subject: bug#41002: Undo breaks inhibit-read-only text property
Date: Sun, 03 May 2020 06:22:20 +0300	[thread overview]
Message-ID: <m2zhap8zyr.fsf@fastmail.fm> (raw)
In-Reply-To: <b2936185-9314-0e92-5be1-d779f3fe4dda@gmail.com> (Serhii Mozghovyi's message of "Sat, 2 May 2020 22:09:27 +0300")

> On 5/2/20 8:33 PM, Filipp Gunbin wrote:
[...]
>> Cannot reproduce on current master.  Can you reproduce it with emacs -Q?
>> Do you have any custom undo functionality? (like a package)

I see I wasn't trying right, it's actually reproducible on master too.

I think this comes from verify_interval_modification (textprop.c).  For
each interval, we check INTERVAL_WRITABLE_P, and then:

commit d1b04a9e7ada7070dbd84bb450411c1f169b3739
Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
Date:   Sun Nov 16 23:36:58 2014 +0100
[...]
diff --git a/src/textprop.c b/src/textprop.c
--- 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.

Filipp





  reply	other threads:[~2020-05-03  3:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 10:38 bug#41002: Undo breaks inhibit-read-only text property Serhii Mozghovyi
2020-05-02 17:33 ` Filipp Gunbin
2020-05-02 19:09   ` Serhii Mozghovyi
2020-05-03  3:22     ` Filipp Gunbin [this message]
2020-05-09  7:37       ` Eli Zaretskii
2020-05-09 13:34         ` Filipp Gunbin
2020-05-09 13:49           ` Eli Zaretskii
2020-05-09 16:55             ` Filipp Gunbin
2020-05-19 12:12       ` Lars Ingebrigtsen

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=m2zhap8zyr.fsf@fastmail.fm \
    --to=fgunbin@fastmail.fm \
    --cc=41002@debbugs.gnu.org \
    --cc=egnartsms@gmail.com \
    --cc=larsi@gnus.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).