From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:09:06 2025 Received: (at submit) by debbugs.gnu.org; 5 Aug 2025 14:09:06 +0000 Received: from localhost ([127.0.0.1]:56594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujILh-0002sZ-Lb for submit@debbugs.gnu.org; Tue, 05 Aug 2025 10:09:06 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39520) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ujFlO-0005G6-87 for submit@debbugs.gnu.org; Tue, 05 Aug 2025 07:23:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujFlI-00079M-Kc for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2025 07:23:20 -0400 Received: from www553.your-server.de ([78.46.153.203]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujFlA-0001Ya-Ad for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2025 07:23:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tony-zorman.com; s=default2502; h=Content-Type:MIME-Version:Message-ID:Date :Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=m/Gdxztk91BQryCs62vYLylOeHHpt7kS98+y37Xmg5M=; b=dW+bqNTcX/psHgSzwATXm0lItP CoAUWQ597/wjbjGM72Wugh28N0PIVQj8FAE2dRKXz79pO6IoGB7c9CuFFzB9busC6A7mXFLy8YWCd 9fVeB0VC3hdMRoRvuKCGEU8aA/42IvEGyoLPCwVgWeey4038gpEbeSwOpi5JxMowgRQVid/ajcEVr r7Q+/oPEz/braa1RlaBhMpjFA/QB8yKChqfCbIJhO0IBGVzlXVSoCMtOCF3JPuTn269ABdKOvFViW zw3qLjQy0v+9K46DYRQ8PgHi98sds+ARzkl1B3BJNgv+WGjekSzHxmoG24OJjQnbQj/LQeOZy0Nwf mpRTUrLQ==; Received: from sslproxy05.your-server.de ([78.46.172.2]) by www553.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1ujFl3-0003iH-0x for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2025 13:23:05 +0200 Received: from localhost ([127.0.0.1]) by sslproxy05.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ujFl3-000I41-09 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2025 13:23:05 +0200 From: Tony Zorman To: bug-gnu-emacs@gnu.org Subject: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property X-Debbugs-Cc: Date: Tue, 05 Aug 2025 13:23:04 +0200 Message-ID: <874iumnhbb.fsf@hyperspace> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Virus-Scanned: Clear (ClamAV 1.0.7/27723/Tue Aug 5 10:36:10 2025) Received-SPF: pass client-ip=78.46.153.203; envelope-from=mail@tony-zorman.com; helo=www553.your-server.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 05 Aug 2025 10:09:02 -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: -0.3 (/) --=-=-= Content-Type: text/plain Tags: patch Hi, when one uses `kill-ring-deindent-mode' and selects read-only text, the mode can't actually deindent it, which causes a lot of `beep' noise and prevents the user from killing the selected text (or from any other action, really). This patch fixes this by removing that particular property before the text is inserted into the temporary buffer. Thanks, Tony --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-indent-aux.el-Remove-read-only-text-property.patch >From 5ef0ce6716dd0cb2f08833fdc54a83cca7b4f691 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Tue, 5 Aug 2025 13:08:43 +0200 Subject: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property --- lisp/indent-aux.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/indent-aux.el b/lisp/indent-aux.el index eeb8f1ee6bb..c184c1805da 100644 --- a/lisp/indent-aux.el +++ b/lisp/indent-aux.el @@ -49,6 +49,7 @@ is yanked." (text (if delete (delete-and-extract-region beg end) (buffer-substring beg end)))) + (remove-text-properties 0 (max 0 (1- (length text))) '(read-only) text) (with-temp-buffer ;; Indent/deindent the same as the major mode in the original ;; buffer. -- 2.50.1 --=-=-= Content-Type: text/plain -- Tony Zorman | https://tony-zorman.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:49:57 2025 Received: (at 79176) by debbugs.gnu.org; 5 Aug 2025 14:49:57 +0000 Received: from localhost ([127.0.0.1]:56653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujIzF-0004sj-F5 for submit@debbugs.gnu.org; Tue, 05 Aug 2025 10:49:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46084) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ujIzC-0004sT-SA for 79176@debbugs.gnu.org; Tue, 05 Aug 2025 10:49:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujIz5-0004SW-IN; Tue, 05 Aug 2025 10:49:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WPvFSH7htW3bqOKPHIwrMxCWVSKpCGyYwosIt01ucMU=; b=oiHHKyE6aPiR /bmMzDz2m+5XPjDo0tBFn3hBM4V5KmVzTDWAdBQwLFcs6CHKsmFKAC0Sy/ztGEsk2vsHzL1kU8ZTQ NTy3CajIEJWr+ZvR1+mw5hUrrEUMPRRd2NtO5rOkdMeQT0JCQYLr9uorwsrZO30atAmlNzpuRa8lU LpApS+OcS1YH8G13xYYVKM5A3Zu/AQAvdIpL+Dnoc7BeYyoiDXPYCPTzhlpNHe8mG5AvgsOIr76ba Roq4Np8Ha/47aWXguSHmKf1ZT9x2KtiWEtnooG4rPsxqN7RIoEKsk7hOETckTeMIg4CUOfv/gWFcb 9IL9A+fXLVb4xi0BQwnmtw==; Date: Tue, 05 Aug 2025 17:49:24 +0300 Message-Id: <865xf1vn63.fsf@gnu.org> From: Eli Zaretskii To: Tony Zorman In-Reply-To: <874iumnhbb.fsf@hyperspace> (message from Tony Zorman on Tue, 05 Aug 2025 13:23:04 +0200) Subject: Re: bug#79176: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property References: <874iumnhbb.fsf@hyperspace> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79176 Cc: 79176@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: -3.3 (---) > From: Tony Zorman > Date: Tue, 05 Aug 2025 13:23:04 +0200 > > when one uses `kill-ring-deindent-mode' and selects read-only text, the > mode can't actually deindent it, which causes a lot of `beep' noise and > prevents the user from killing the selected text (or from any other > action, really). This patch fixes this by removing that particular > property before the text is inserted into the temporary buffer. Thanks, but isn't it better to bind inhibit-read-only non-nil around the code which modifies the text instead? By default yank-excluded-properties includes read-only, but what if someone changes the value not to include read-only? won't they expect to see the read-only property when the text is yanked? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 02:13:10 2025 Received: (at 79176) by debbugs.gnu.org; 6 Aug 2025 06:13:10 +0000 Received: from localhost ([127.0.0.1]:57810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujXOg-0006YZ-4j for submit@debbugs.gnu.org; Wed, 06 Aug 2025 02:13:10 -0400 Received: from www553.your-server.de ([78.46.153.203]:46274) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ujXOc-0006Xq-LD for 79176@debbugs.gnu.org; Wed, 06 Aug 2025 02:13:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tony-zorman.com; s=default2502; h=Content-Type:MIME-Version:Message-ID:Date :References:In-Reply-To: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; bh=jGj6DmfdsfuQL3PKLFkJ8sy/NTyMsWmKedSj0SI0BfE=; b=XC3um40KHqMVsSDKSD5WMoUjmi EWjpblsq8R2t2dteidVdEWltNJCEiOmTXvyAnJapRdkmtGJRxS2+61ityYXIcx+wVRemAEKuoPY0Y E0Rlx43d1dFTj1KjgGumMnxFsy3uOlNpXRYCgAzBQ6aNRkfCbUhnzqmgfY5rep2xCkYpdpYqngZiq gBNGPo0U35hD1C0YCWsbj5o2ETV8jIVZdBQz9d/P08MXF24sR8KrECY1xH/d5L9sLtUyzpcyJXxe5 MRqRrSEp6xamwvYfwgscxJKHhThdXQx5dN+loLqs3+eeevSerScB7r4guBlAcdLraGlXz4+lwrq00 UuXlVngg==; Received: from sslproxy04.your-server.de ([78.46.152.42]) by www553.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1ujXOV-0001Eo-0U; Wed, 06 Aug 2025 08:12:59 +0200 Received: from localhost ([127.0.0.1]) by sslproxy04.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ujXOU-0002Q1-0Z; Wed, 06 Aug 2025 08:12:58 +0200 From: Tony Zorman To: Eli Zaretskii Subject: Re: bug#79176: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property In-Reply-To: <865xf1vn63.fsf@gnu.org> References: <874iumnhbb.fsf@hyperspace> <865xf1vn63.fsf@gnu.org> User-Agent: Notmuch/0.39, Emacs 31.0.50 Date: Wed, 06 Aug 2025 08:12:58 +0200 Message-ID: <871pppnfkl.fsf@hyperspace> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Virus-Scanned: Clear (ClamAV 1.0.7/27723/Tue Aug 5 10:36:10 2025) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79176 Cc: 79176@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 (-) --=-=-= Content-Type: text/plain On Tue, Aug 05 2025 17:49, Eli Zaretskii wrote: >> From: Tony Zorman >> Date: Tue, 05 Aug 2025 13:23:04 +0200 >> >> when one uses `kill-ring-deindent-mode' and selects read-only text, the >> mode can't actually deindent it, which causes a lot of `beep' noise and >> prevents the user from killing the selected text (or from any other >> action, really). This patch fixes this by removing that particular >> property before the text is inserted into the temporary buffer. > > Thanks, but isn't it better to bind inhibit-read-only non-nil around > the code which modifies the text instead? By default > yank-excluded-properties includes read-only, but what if someone > changes the value not to include read-only? won't they expect to see > the read-only property when the text is yanked? Ah, I didn't know about yank-excluded-properties. You're right, in that case perhaps it's better to use inhibit-read-only; I've updated the patch accordingly. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-indent-aux.el-Remove-read-only-text-property.patch >From e5aa85fd98113debe0e287a9ccbe03fd8cec1493 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Tue, 5 Aug 2025 13:08:43 +0200 Subject: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property --- lisp/indent-aux.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/indent-aux.el b/lisp/indent-aux.el index eeb8f1ee6bb..4a05136ac1a 100644 --- a/lisp/indent-aux.el +++ b/lisp/indent-aux.el @@ -50,13 +50,14 @@ is yanked." (delete-and-extract-region beg end) (buffer-substring beg end)))) (with-temp-buffer - ;; Indent/deindent the same as the major mode in the original - ;; buffer. - (setq indent-tabs-mode i-t-m) - (insert text) - (indent-rigidly (point-min) (point-max) - (- indentation)) - (buffer-string)))) + (let ((inhibit-read-only t)) + ;; Indent/deindent the same as the major mode in the original + ;; buffer. + (setq indent-tabs-mode i-t-m) + (insert text) + (indent-rigidly (point-min) (point-max) + (- indentation)) + (buffer-string))))) ;;;###autoload (define-minor-mode kill-ring-deindent-mode -- 2.50.1 --=-=-= Content-Type: text/plain -- Tony Zorman | https://tony-zorman.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 09:14:12 2025 Received: (at 79176-done) by debbugs.gnu.org; 7 Aug 2025 13:14:12 +0000 Received: from localhost ([127.0.0.1]:34039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uk0Rf-0006zu-BB for submit@debbugs.gnu.org; Thu, 07 Aug 2025 09:14:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55244) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uk0RZ-0006zE-6J for 79176-done@debbugs.gnu.org; Thu, 07 Aug 2025 09:14:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uk0RT-0001Or-8g; Thu, 07 Aug 2025 09:13:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Xx8nduWVXQ8+VsoaJky35noWJIocbS91bnHO5ewkfNs=; b=ISUDtGdv62tY xie8H+0xSkFqgXJT1zrw5irXWc4NVly/hvxD8GxM25j4Hfca3FqpDBxme5QmK4eye0SH/uMPoQCe0 6u2+CnDxtoQ2VpINOJc3CLStcN8uIlItaQwLs5D/Xik+RDz+pM8yu1S97w8gWRvHfvDkygvJ5722r SHoUBTcQgCZ53BHlVW5CeDCZib6UnGmb6UygXQGVI2k3nDIBdfYJDvYDpNXBLqj5Y4CFgJAyMDFJv VnfE41dPy9KdeR4XohQQKoXZMOzr+9wrQJwhC2YtI8QDn1C86t9yoV6+dPctqTh8XOBiDNsAFd23S gqwIP1bOZDe01SHx8CFlHQ==; Date: Thu, 07 Aug 2025 16:13:56 +0300 Message-Id: <86h5yjqnor.fsf@gnu.org> From: Eli Zaretskii To: Tony Zorman In-Reply-To: <871pppnfkl.fsf@hyperspace> (message from Tony Zorman on Wed, 06 Aug 2025 08:12:58 +0200) Subject: Re: bug#79176: [PATCH] ; * lisp/indent-aux.el: Remove read-only text property References: <874iumnhbb.fsf@hyperspace> <865xf1vn63.fsf@gnu.org> <871pppnfkl.fsf@hyperspace> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79176-done Cc: 79176-done@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: -3.3 (---) > From: Tony Zorman > Cc: 79176@debbugs.gnu.org > Date: Wed, 06 Aug 2025 08:12:58 +0200 > > > Thanks, but isn't it better to bind inhibit-read-only non-nil around > > the code which modifies the text instead? By default > > yank-excluded-properties includes read-only, but what if someone > > changes the value not to include read-only? won't they expect to see > > the read-only property when the text is yanked? > > Ah, I didn't know about yank-excluded-properties. You're right, in that > case perhaps it's better to use inhibit-read-only; I've updated the > patch accordingly. Thanks, now installed on the master branch (after fixing the commit log message, since it still talked about removing the property). I'm therefore closing this bug.