From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#41002: Undo breaks inhibit-read-only text property Date: Sun, 03 May 2020 06:22:20 +0300 Message-ID: References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="36863"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: 41002@debbugs.gnu.org, larsi@gnus.org To: Serhii Mozghovyi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 03 05:23:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jV5Dj-0009VL-2P for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 May 2020 05:23:11 +0200 Original-Received: from localhost ([::1]:44716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jV5Di-0006fp-0U for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 May 2020 23:23:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV5Da-0006d1-QO for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 23:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jV5Da-0003Lf-GU for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 23:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jV5Da-0005te-Bb for bug-gnu-emacs@gnu.org; Sat, 02 May 2020 23:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 May 2020 03:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41002 X-GNU-PR-Package: emacs Original-Received: via spool by 41002-submit@debbugs.gnu.org id=B41002.158847615222605 (code B ref 41002); Sun, 03 May 2020 03:23:02 +0000 Original-Received: (at 41002) by debbugs.gnu.org; 3 May 2020 03:22:32 +0000 Original-Received: from localhost ([127.0.0.1]:54423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jV5D6-0005sX-0n for submit@debbugs.gnu.org; Sat, 02 May 2020 23:22:32 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:37757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jV5D3-0005sJ-PH for 41002@debbugs.gnu.org; Sat, 02 May 2020 23:22:30 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id BA36BC8B; Sat, 2 May 2020 23:22:23 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 02 May 2020 23:22:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=l9gRj0h221rxHDaU5uOyW2SYAt DpQ3tjfU3yiKk2f7E=; b=Ajibbfc5aoUpKnQs2MKmrZ4QdYDEbuRVmo89bF0f5U PqXgzkEsbiNU5Hx7q4TQDdItoy+lfiP9HnpP+Fd3LHsEWuipgYOx+s997G/w2C4x NlUIie0ylRd5PtXqswlVmzjTgHC64sgj8XMb2NPC4xDyqyL6l3+R+Nwv1YO8Uo5K 7kTdbJD97XjCKeoMENhlZAlcmo9uqIVB6Rit5bRWtK3XVZG0fJ2lo0DIFaYr93el odxlFLnJ3GQgmggEErqH78TjhF4LTJvBX9yrKJRPL13j//NRYK7XQ7RAvIYrgTMH rLePKASWC4lyinZsYgkZ8KnZIc7tuEV8BGK9xRVsjP7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=l9gRj0 h221rxHDaU5uOyW2SYAtDpQ3tjfU3yiKk2f7E=; b=P9dC6WdBDuGdZTzhlWytbg fqjfwDlMw4Boofo5TSWTyYjPFeGDwqOuoixJU/AgS0YPSr7y8NGukjyZ3WdyXm/A 4C2e+BkYatS2w+mqxndeLl6znW7ulyTKeoBJni7Hh+aA2Xma2EYcg6rESvtzGPIW id8hWcGZB3/ncaMO7NVCdb13/xuW4TthlHTp7WOxz9Xxs019Meb/t/tcf1LtWKLE 9t31D5FW6os0VeLiIoGfod+SdqwAcnOpD6Y1iAH4S438ldtrOkhr3NjQ4pglVvus FS/IabYgsK9Ve/6BO49D8f2msBs/jZbcV9dcr4gAjSRQsSSQUTV5CJev/cBU1Zsw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjedtgdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehttdertd dtredtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhesfhgr shhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepvdevkeffvdeuvefhuddtjeehke dvueefveettddtveduudfgieffieevieevhfdtnecukfhppeekfedruddtvddrudegjedr leelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfh hguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from fgunbin.local (unknown [83.102.147.99]) by mail.messagingengine.com (Postfix) with ESMTPA id 69B6D328005A; Sat, 2 May 2020 23:22:22 -0400 (EDT) In-Reply-To: (Serhii Mozghovyi's message of "Sat, 2 May 2020 22:09:27 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179564 Archived-At: > 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 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