From debbugs-submit-bounces@debbugs.gnu.org Fri May 01 11:41:31 2020 Received: (at submit) by debbugs.gnu.org; 1 May 2020 15:41:31 +0000 Received: from localhost ([127.0.0.1]:50448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUXn5-0002wd-Oe for submit@debbugs.gnu.org; Fri, 01 May 2020 11:41:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:55004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUT2E-0000VK-1a for submit@debbugs.gnu.org; Fri, 01 May 2020 06:36:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51384) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUT2C-00017l-Bj for bug-gnu-emacs@gnu.org; Fri, 01 May 2020 06:36:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUT24-0006zy-Qb for bug-gnu-emacs@gnu.org; Fri, 01 May 2020 06:36:44 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:39080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUT24-0006z0-Dw for bug-gnu-emacs@gnu.org; Fri, 01 May 2020 06:36:36 -0400 Received: by mail-lj1-x22e.google.com with SMTP id u6so2234456ljl.6 for ; Fri, 01 May 2020 03:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=v4q9DEhGKxbhEnj5no2ilmYX18WpLEZ9uVDFraSAch4=; b=Kqw74/FTJGfYXIjwJJTGJJgXjhvfA9r7sT49mq1NjBx7BmhNEzPVg+vbAD1PaW/JU4 B7rVxfxVR2u5HzauWyvOUpaRC6qzh/sTaG7RMY539092SBHTlnXAsu0ni5PfsUANM52Z YPhVQd6cT+TENhM5NWRyEewcm1YMdKHkYTESx0oyTizfHDORcr6qAaLCITuz0teCWAIu LUQs2+e+Pdo9//lHzMKb9n0/Tg5OmLb2J0jXjXhQRmJqVhuOH5nbSQwCM3GIX20Dsc9b EbkHOjzh51m9cevQraTO202wVHucFb0A30jddl/7HpOm7csrkKu8o822O9oivMI5Yx5D GOsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=v4q9DEhGKxbhEnj5no2ilmYX18WpLEZ9uVDFraSAch4=; b=M3PdpcbKbQHYCVw6dU9g9Cvch9t3INXoJT8rzQMMY3jlSeVeVY5Mu0xRW2E/lsn1QJ 99DC50AHeIY74dVPMN6NM+IpEWQzakmXbGQ57KFbN0XHJyq/muRcBNh5hoo9ltfS0Jm6 5oX0DvRu3UylbIwFHJvkEnK+V1rP9Dg8bAzVOh3wyFO2CNRdRxyyd/QJnfaelrRR3Nxa boV4G2ZSYKJZRASnkNo3u7qDjW524/OmPa0sFY5O9owIziXFLruoO1bI25xLeKHB3Soj ADn8KFOsUWJn+k4A1RxPvt4ligl0cps1sHekMZOTsve7gUg/zMn3sB+nHYuoMmlYJNdf DgEg== X-Gm-Message-State: AGi0PuYaXdURGHkqXDfKcrCq4lxqlFdh60uXDomYC/OjqOxf+QA/hqZI 6SsBJTwqBCjNB/tfAPjRHsXKk6yW X-Google-Smtp-Source: APiQypKNrL/dTDxxA9NNj+nUPO2uMgWV4dqt2luKLQsA3+18vky12tfFrXi112pwhOL0KH+rQzaObw== X-Received: by 2002:a2e:9055:: with SMTP id n21mr2139850ljg.46.1588329393818; Fri, 01 May 2020 03:36:33 -0700 (PDT) Received: from [192.168.1.115] ([77.222.156.104]) by smtp.gmail.com with ESMTPSA id s7sm1926570lfb.40.2020.05.01.03.36.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 May 2020 03:36:33 -0700 (PDT) To: bug-gnu-emacs@gnu.org From: Serhii Mozghovyi Subject: Undo breaks inhibit-read-only text property Message-ID: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> Date: Fri, 1 May 2020 13:38:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=egnartsms@gmail.com; helo=mail-lj1-x22e.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::22e X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 May 2020 11:41:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) The inhibit-read-only text property in a read-only buffer does not work with Undo: C-x b , then insert some text, such as: --- First paragraph. Second paragraph. --- Then M-: (put-text-property (point-min) (point-max) 'inhibit-read-only t), and C-x C-q to make the buffer read-only. Now select the "Se" and kill it with C-w: it succeeds. Then hit C-/ to undo, select "Sec" and try to kill again. Now it fails. For any other region that does not intersect with "Se", killing works. From debbugs-submit-bounces@debbugs.gnu.org Sat May 02 13:33:19 2020 Received: (at 41002) by debbugs.gnu.org; 2 May 2020 17:33:19 +0000 Received: from localhost ([127.0.0.1]:53862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUw0s-0007QO-Oe for submit@debbugs.gnu.org; Sat, 02 May 2020 13:33:19 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56227) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUw0q-0007QA-IP for 41002@debbugs.gnu.org; Sat, 02 May 2020 13:33:17 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3B0B75C0036; Sat, 2 May 2020 13:33:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 02 May 2020 13:33:11 -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=Zu/Ll8VOcv/u3ckMZXe6cryHt2 4ZNue7Z2Xf9txfZcM=; b=NRhZLzAbiEIsg+tP3D5CwzAd7BuszdQP8MXOCwJDrQ b3Cp58w5AxjGRnDCX1e1AlMlCh0U3DjDREPwWqNciv8sDN+61RWSv5zpNkWjzhPb XkhDyaPTmgNB8jK3YtuEnvf6KIza7jPcg30XfROKqMXo80fw0axMWh1MQ7blOzEj Ad/QU90RHpDgy7niTUh7pl+Mz2CENfRAsx2n8JKST4f1E9JIMht50b+JGboajDmu k6ahWBNs4Qec6SwjFFtj4qv0RZscBsCOUMJtd5SbGGGBdySAMWdqCkmix6othqO9 hta/YlPr+PzZYButumEgUz2sDovjy42ZRSWHv06oN5ew== 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=Zu/Ll8 VOcv/u3ckMZXe6cryHt24ZNue7Z2Xf9txfZcM=; b=zSM/WikW/4Alc274m5MXSP ewI5w/SSWxvSXWgKitXRnVEmK/jGec7VjYuaFb4N/S2isFRt96kq+Z1l/m7t//m4 rE8dM3voNTT55eqVofjBuAxhpi7Yy526+p+F4jKL6pegyu4OliBAlPk/zUOLod2n oiApDdg/LLYKLyqECNgHRLFPthDIWkm3RJE0F9x7gbm9OMzMz0FWZRNeIKCs25z5 Av80CksiaAMpsA08KZtAKGlh+62YPCEUAjjKxa6Hljjysako+nFZm13fb1rj80hH AOW5RypxWyyKWAnowLWle1ZKGlhd2tb07Mr+E3fDuLIfp20193YRrzcr5Pe4a6cQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrieelgdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffujghffgffkfggtgesthdtre dttdertdenucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehf rghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpedvveekffdvueevhfdutdejhe ekvdeufeevtedttdevuddugfeiffeiveeivefhtdenucfkphepkeefrddutddvrddugeej rdelleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hfghhunhgsihhnsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Received: from fgunbin.local (unknown [83.102.147.99]) by mail.messagingengine.com (Postfix) with ESMTPA id 8451A3065F3D; Sat, 2 May 2020 13:33:10 -0400 (EDT) From: Filipp Gunbin To: Serhii Mozghovyi Subject: Re: bug#41002: Undo breaks inhibit-read-only text property In-Reply-To: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> (Serhii Mozghovyi's message of "Fri, 1 May 2020 13:38:24 +0300") References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Date: Sat, 02 May 2020 20:33:08 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 01/05/2020 13:38 +0300, Serhii Mozghovyi wrote: > The inhibit-read-only text property in a read-only buffer does not work > with Undo: > [...] Cannot reproduce on current master. Can you reproduce it with emacs -Q? Do you have any custom undo functionality? (like a package) You should file a proper bug report with M-x report-emacs-bug, it will automatically include your Emacs version. Filipp From debbugs-submit-bounces@debbugs.gnu.org Sat May 02 15:24:58 2020 Received: (at 41002) by debbugs.gnu.org; 2 May 2020 19:24:58 +0000 Received: from localhost ([127.0.0.1]:53958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUxkv-0001rd-U4 for submit@debbugs.gnu.org; Sat, 02 May 2020 15:24:58 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUxUD-0001Os-4K for 41002@debbugs.gnu.org; Sat, 02 May 2020 15:07:41 -0400 Received: by mail-lf1-f65.google.com with SMTP id g10so6327257lfj.13 for <41002@debbugs.gnu.org>; Sat, 02 May 2020 12:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Z/plLsdn0DhKkM5gdC0k1wdCfVJN0QzNF/R/NFp6aLY=; b=IiZEKwBAZEcgPTNOEU2leiZF+X3+uF6U5NJ2zQR9gBCP9y9LsdnpAouQ72wSx/Nero WdMiYHb5XBc9dATrNAjc366zLK0ISEbibzquV6OnJnN+xxyjGG/ErZytPxtLCqGv3oyb XqqPGfwHA7XEmAHncAE7pU7MM4D5J3BV+U8fI9ZDxmyzSPB99dHbjLjfk54aXeiUH5M4 m4hxvD527de4RJIV5qNOAo2yVDYPkcUoBhAKdMmlU4A5zpFT16/BssdaBGYuF0wM3Jj+ u+Us8mg4+mJMNWyaPUmI0rr8cPVi1zgCKpkq54yWVvFzSRY4ZGiRV1l8fLa520dIj9sv hWjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Z/plLsdn0DhKkM5gdC0k1wdCfVJN0QzNF/R/NFp6aLY=; b=GPF7wn5db6XZ1hP2YBtaFpgoymi0z3K59wUG8hAsxyduYpYdkG+7XcHrC8lFLqENSj sF+uJ4d5+kbaimK5mGT2XX38hFyeyA17wQMlCo/ZLTQYhe8PHDfMR0YRaYqf4mphPA+j 13viN2/GbD3uTO88UqAj6X1X8tgZCZesaHW2UtFstKXsBXamyM5vWiTi1tKpGchH/ev9 03OiFcrtkCSKOTCeSJoNaKybQ7UdgL4rJOJ08CR26ze7p6KxLfUpDtsXDW9bYwavmN/S 57hwDw/ERQdmYNakwQMOd9pI0CigUDKyiIZ4WlxzaC3tByqsvt+p1VjsOLDMXLkbaVu7 UQTQ== X-Gm-Message-State: AGi0PuZfnFUzClteAS/hYXXue1niiDmxK9fNYwWCYUYTm5Jsld2Vw0oO P4LGYRSkmxRQOIgzm+L31fvj/A1A X-Google-Smtp-Source: APiQypIRgh6UuaO0AnQ7xXm0qgoOcLhFDk3y25pb6BjDf/QTOGTJ4NCB3YIW+UvIUAhpezjT2gBPAQ== X-Received: by 2002:a19:c515:: with SMTP id w21mr6244834lfe.186.1588446454767; Sat, 02 May 2020 12:07:34 -0700 (PDT) Received: from [192.168.1.115] ([109.206.33.53]) by smtp.gmail.com with ESMTPSA id l18sm4346132ljg.98.2020.05.02.12.07.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 May 2020 12:07:34 -0700 (PDT) Subject: Re: bug#41002: Undo breaks inhibit-read-only text property To: Filipp Gunbin References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> From: Serhii Mozghovyi Message-ID: Date: Sat, 2 May 2020 22:09:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41002 X-Mailman-Approved-At: Sat, 02 May 2020 15:24:57 -0400 Cc: 41002@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yes, I can reproduce with emacs -Q. My Emacs version is 26.3. Here are the details: In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)  of 2020-05-01 built on serhii-dell Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description:    CentOS Linux release 7.7.1908 (Core) Recent messages: Quit nil Read-Only mode enabled in current buffer Mark set 19 (#o23, #x13, ?\C-s) 20 (#o24, #x14, ?\C-t) Undo! Mark activated kill-region: Text is read-only: # Making completion list... Configured using:  'configure --prefix=/home/serhii/local' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS Important settings:   value of $LANG: en_US.UTF-8   value of $XMODIFIERS: @im=ibus   locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect:   tooltip-mode: t   global-eldoc-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t   buffer-read-only: t   line-number-mode: t   transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95086 6451)  (symbols 48 20250 1)  (miscs 40 47 168)  (strings 32 28285 1382)  (string-bytes 1 745581)  (vectors 16 13895)  (vector-slots 8 500670 14660)  (floats 8 50 198)  (intervals 56 235 9)  (buffers 992 13)  (heap 1024 24712 1221)) On 5/2/20 8:33 PM, Filipp Gunbin wrote: > On 01/05/2020 13:38 +0300, Serhii Mozghovyi wrote: > >> The inhibit-read-only text property in a read-only buffer does not work >> with Undo: >> > [...] > > Cannot reproduce on current master. Can you reproduce it with emacs -Q? > Do you have any custom undo functionality? (like a package) > > You should file a proper bug report with M-x report-emacs-bug, it will > automatically include your Emacs version. > > Filipp From debbugs-submit-bounces@debbugs.gnu.org Sat May 02 23:22:32 2020 Received: (at 41002) by debbugs.gnu.org; 3 May 2020 03:22:32 +0000 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 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 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) 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: 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) From: Filipp Gunbin To: Serhii Mozghovyi Subject: Re: bug#41002: Undo breaks inhibit-read-only text property In-Reply-To: (Serhii Mozghovyi's message of "Sat, 2 May 2020 22:09:27 +0300") References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Date: Sun, 03 May 2020 06:22:20 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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 From debbugs-submit-bounces@debbugs.gnu.org Sat May 09 03:38:13 2020 Received: (at 41002) by debbugs.gnu.org; 9 May 2020 07:38:13 +0000 Received: from localhost ([127.0.0.1]:46746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXK3o-0000KQ-Of for submit@debbugs.gnu.org; Sat, 09 May 2020 03:38:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXK3k-0000K8-GW for 41002@debbugs.gnu.org; Sat, 09 May 2020 03:38:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46610) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXK3f-0007tW-4W; Sat, 09 May 2020 03:38:03 -0400 Received: from [176.228.60.248] (port=4683 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXK3e-00022D-EQ; Sat, 09 May 2020 03:38:02 -0400 Date: Sat, 09 May 2020 10:37:52 +0300 Message-Id: <83blmxh833.fsf@gnu.org> From: Eli Zaretskii To: Filipp Gunbin In-Reply-To: (message from Filipp Gunbin on Sun, 03 May 2020 06:22:20 +0300) Subject: Re: bug#41002: Undo breaks inhibit-read-only text property References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, egnartsms@gmail.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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? Btw, how is this related to undo? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat May 09 09:35:22 2020 Received: (at 41002) by debbugs.gnu.org; 9 May 2020 13:35:22 +0000 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 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 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) 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: 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) From: Filipp Gunbin To: Eli Zaretskii Subject: Re: bug#41002: Undo breaks inhibit-read-only text property In-Reply-To: <83blmxh833.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 May 2020 10:37:52 +0300") References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> <83blmxh833.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Date: Sat, 09 May 2020 16:34:43 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, egnartsms@gmail.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat May 09 09:49:46 2020 Received: (at 41002) by debbugs.gnu.org; 9 May 2020 13:49:46 +0000 Received: from localhost ([127.0.0.1]:46976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXPrN-0008D0-T9 for submit@debbugs.gnu.org; Sat, 09 May 2020 09:49:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXPrM-0008Cg-7h for 41002@debbugs.gnu.org; Sat, 09 May 2020 09:49:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52285) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPrG-0005XA-TG; Sat, 09 May 2020 09:49:38 -0400 Received: from [176.228.60.248] (port=3911 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXPrG-00012d-Bq; Sat, 09 May 2020 09:49:38 -0400 Date: Sat, 09 May 2020 16:49:28 +0300 Message-Id: <838si1fcbb.fsf@gnu.org> From: Eli Zaretskii To: Filipp Gunbin In-Reply-To: (message from Filipp Gunbin on Sat, 09 May 2020 16:34:43 +0300) Subject: Re: bug#41002: Undo breaks inhibit-read-only text property References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> <83blmxh833.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, egnartsms@gmail.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Filipp Gunbin > Cc: egnartsms@gmail.com, 41002@debbugs.gnu.org, larsi@gnus.org > Date: Sat, 09 May 2020 16:34:43 +0300 > > > 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. That tests if the interval is _not_ writable. But the problem is not triggered by the interval, it is triggered by characters after the interval, is it not? > The problem is I don't know what the "if" I cited is for. Hopefully, Lars will answer that. > > 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. Right, thanks. So this situation could be recreated without any undo in the recipe, right? From debbugs-submit-bounces@debbugs.gnu.org Sat May 09 12:56:06 2020 Received: (at 41002) by debbugs.gnu.org; 9 May 2020 16:56:06 +0000 Received: from localhost ([127.0.0.1]:48305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXSlh-0001Pl-PJ for submit@debbugs.gnu.org; Sat, 09 May 2020 12:56:06 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:39517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXSlf-0001PF-RK for 41002@debbugs.gnu.org; Sat, 09 May 2020 12:56:04 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C659F6D4; Sat, 9 May 2020 12:55:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 09 May 2020 12:55:58 -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=pUzw2dBYIER1ydjR2YGQkuXonp QZvE577lVlPy+ll1g=; b=bztuyal7hE7hjA1GOUZcIhMnAt/Wvofg7zDeTLv3gg f91U3ULsVFRLhLSyM10Pu2M3dryznNILCGfz/oG7XmyOIAPv/a62x/1YGVUNCjAU q1wKKaZWm7nDi/MukU6xZklQ3VB3TDXSIeDR9mrBy1dwFTUv/qd/gNuv9LCkug3R jYyeA8/pKAA/mzmT/3mMdA1qoSSID22D7ium1ABPJPPwY4QY8czzae7UHXjWQJMU sBsykgwxZPFaqV4ySnXd2hFkY1NttZCwRDmBL6YlS+y5erZ8UOe+/ScFhUiYnNuJ nRDwRvSNYWO200dKVW815hACZGEmvCpShXnm49iXyt9g== 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=pUzw2d BYIER1ydjR2YGQkuXonpQZvE577lVlPy+ll1g=; b=goNmx9oKeyE2bONPyoCi32 KBB3tVw3M5TLO0xTdLK/qS5bxRsHQclxLTaeamj40CxcRiLHKHfQ/dYdQ6KzoD/G m3PX173rD5ag4HuQPp5lOCsbPfkb+LdrXYa+kIHs+OonjYfwNHl4Ex3Ld4mFh+pz fRraSC7iVcoBT/ZhP3PRqxXGx9O+LICWUcLcsPUK2fgdz87BBfIEKgj5mlWAIYYY qFU+vmiEDVYpDPYRM/MipM7zVPJRQd4a2KK771OBRlCG8OYwP1VfgHQJlG6NCORB NclDOY4zEkotC2k8S2B0GKxN6IUV3fLM964BUW0CxJaTW8vnXG/MgGG3iAJTuU2Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeehgddutdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf grthhtvghrnhepvdevkeffvdeuvefhuddtjeehkedvueefveettddtveduudfgieffieev ieevhfdtnecukfhppeekfedruddtvddrvddtfedruddvnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgrihhl rdhfmh X-ME-Proxy: Received: from fgunbin.local (unknown [83.102.203.12]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B93C3280060; Sat, 9 May 2020 12:55:56 -0400 (EDT) From: Filipp Gunbin To: Eli Zaretskii Subject: Re: bug#41002: Undo breaks inhibit-read-only text property In-Reply-To: <838si1fcbb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 May 2020 16:49:28 +0300") References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> <83blmxh833.fsf@gnu.org> <838si1fcbb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Date: Sat, 09 May 2020 19:55:24 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, egnartsms@gmail.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 09/05/2020 16:49 +0300, Eli Zaretskii wrote: >> From: Filipp Gunbin >> Cc: egnartsms@gmail.com, 41002@debbugs.gnu.org, larsi@gnus.org >> Date: Sat, 09 May 2020 16:34:43 +0300 >> >> > 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. > > That tests if the interval is _not_ writable. But the problem is not > triggered by the interval, it is triggered by characters after the > interval, is it not? The buffer is read-only, and all characters have inhibit-read-only property set (it's in the recipe). Undo properly restores characters as well as their properties. But now, after undo, we don't have one single interval any more, we have 3 intervals instead: before killed region, killed (and restored) region, and the rest. And this is where our problematic (?) "if" triggers. So I wouldn't talk about characters after the interval, no. >> > 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. > > Right, thanks. So this situation could be recreated without any undo > in the recipe, right? Yes, just put-text-property on separate (and adjacent) intervals instead of the full buffer at once, and try to kill a region which crosses any interval boundary: (with-temp-buffer (insert "ab") (put-text-property 1 2 'inhibit-read-only t) (put-text-property 2 3 'inhibit-read-only t) (setq buffer-read-only t) (kill-region 1 3)) ;(kill-region 1 2) works Thanks, Filipp From debbugs-submit-bounces@debbugs.gnu.org Tue May 19 08:12:28 2020 Received: (at 41002) by debbugs.gnu.org; 19 May 2020 12:12:28 +0000 Received: from localhost ([127.0.0.1]:49467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb16i-00073l-35 for submit@debbugs.gnu.org; Tue, 19 May 2020 08:12:28 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb16g-00073W-FL for 41002@debbugs.gnu.org; Tue, 19 May 2020 08:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dj/Rc8XTHkk52Yt38a0htt8VwgJAIP8R6rgsGupKBPM=; b=LWxRDr5n88SD7RI8codUcfjgZC OIHyH3V3qibJIVU5WGMmGUl1EKN7dTKrYkn2SlRyVqTclDi7yFzf8YM1X4WIm6Jaz1APDvizWz4Nl Wl6Ny0qfu9ve2DtKOX6KQrO8NegOCDakN58X6qduFJ7STXiOjz+gP8hzRGBygiOKrVao=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jb16U-0000N3-MZ; Tue, 19 May 2020 14:12:19 +0200 From: Lars Ingebrigtsen To: Filipp Gunbin Subject: Re: bug#41002: Undo breaks inhibit-read-only text property References: <76e70d06-5dd7-700e-2d05-e3f1ec282a7c@gmail.com> Date: Tue, 19 May 2020 14:12:13 +0200 In-Reply-To: (Filipp Gunbin's message of "Sun, 03 May 2020 06:22:20 +0300") Message-ID: <87sgfwrun6.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Filipp Gunbin writes: > @@ -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 ()); [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41002 Cc: 41002@debbugs.gnu.org, Serhii Mozghovyi X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Filipp Gunbin writes: > @@ -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. Hm... I've re-read the original patch, and I don't really have any recollection of what my original thought here was, I'm afraid. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no