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: Sat, 09 May 2020 16:34:43 +0300 Message-ID: References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> <83blmxh833.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="13690"; 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, egnartsms@gmail.com, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 09 15:36: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 1jXPeF-0003SN-1O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 May 2020 15:36:11 +0200 Original-Received: from localhost ([::1]:50716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPeD-0001sc-H7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 May 2020 09:36:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPe6-0001r4-8Q for bug-gnu-emacs@gnu.org; Sat, 09 May 2020 09:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPe5-00015v-V3 for bug-gnu-emacs@gnu.org; Sat, 09 May 2020 09:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jXPe5-0007pi-R3 for bug-gnu-emacs@gnu.org; Sat, 09 May 2020 09:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 May 2020 13:36:01 +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.158903132230050 (code B ref 41002); Sat, 09 May 2020 13:36:01 +0000 Original-Received: (at 41002) by debbugs.gnu.org; 9 May 2020 13:35:22 +0000 Original-Received: from localhost ([127.0.0.1]:46968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXPdS-0007oc-9Z for submit@debbugs.gnu.org; Sat, 09 May 2020 09:35:22 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:37029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXPdQ-0007oK-Vq for 41002@debbugs.gnu.org; Sat, 09 May 2020 09:35:21 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 0D6592F9; Sat, 9 May 2020 09:35:14 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 09 May 2020 09:35:15 -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=AwJlnr1/cWEdPkPsSFMWxrMFo2 DIPqmODD+nMJ78VME=; b=QeRaHc7OR3NrIVpSC2sWIPNnVzeulUuKQboPOFO2to okSarFgcgYEDJJTUq0HmLeKAPilEuzsfGbL3oL1XTOeud+WaDD6xSYBlzNHf8QMG 8jZ/lL0IS1+2pU/5bVPbo/0m/Xs/JYgOx4naPduvheSuhAFNoVpXG66Hr899AEMd AgF5dqU2bkO6wztK1HA4OkRsprEZBAAJO1LfQmdzqKfV87wahWUKIBRBLI3sVhTe YcwUzKu2UUXUYCMwapIsObCBl0AtrWoPtZdxsUF1GiAKSxDG7+vkQBABjQKr9an6 MEhBcz90ZxgcWZPipVAlMcZDKcXmE2XeV/B4Q/SlDzUQ== 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=AwJlnr 1/cWEdPkPsSFMWxrMFo2DIPqmODD+nMJ78VME=; b=OQDemzkzjXQ9VZ3nVdFgUG FBl2hqoz/S5+K4Qsady76J+FbWyBlZr6WbZRqOg4FV2UGIl/qxKzSO3LwpUMWS5/ +ePJiVkZtkP3nL6eFqDvNL7O0l8ibpQZXfvL//bAmABFMKblXruHEZo5M3QXZlAX p8pgDwtd9O6DfbE+MUc+DKytmIS/MH4c1Lfu3uQladlq3lo0Adz4ik/9yTVxjsfn IDJcijootFCSyHwqTbhRcUqND+mD0AC5DdopOG5aGAIvuYkkX8edzUFSVWjQgBW0 6K1c6txhoQdqf6X5QcOtUHEVlzRZ+X3eOh9RmqHvkERUNQFQo8riAfE/Ce5Mnx3A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeehgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhiphhp ucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtffrrg htthgvrhhnpedvveekffdvueevhfdutdejheekvdeufeevtedttdevuddugfeiffeiveei vefhtdenucfkphepkeefrddutddvrddvtdefrdduvdenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhmrghilhdr fhhm X-ME-Proxy: Original-Received: from fgunbin.local (unknown [83.102.203.12]) by mail.messagingengine.com (Postfix) with ESMTPA id 9EE523280066; Sat, 9 May 2020 09:35:13 -0400 (EDT) In-Reply-To: <83blmxh833.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 May 2020 10:37:52 +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:179968 Archived-At: On 09/05/2020 10:37 +0300, Eli Zaretskii wrote: >> From: Filipp Gunbin >> Date: Sun, 03 May 2020 06:22:20 +0300 >> Cc: 41002@debbugs.gnu.org, larsi@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