From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: How to remove the "read-only" property... Date: Sun, 28 Aug 2022 13:12:08 +0530 Message-ID: <87ilmcu84v.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2314"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel To: Davin Pearson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 28 10:18:18 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oSDUn-0000OG-R5 for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Aug 2022 10:18:17 +0200 Original-Received: from localhost ([::1]:56144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSDUm-0003ZW-SN for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Aug 2022 04:18:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSCw3-0005qM-Nu for emacs-devel@gnu.org; Sun, 28 Aug 2022 03:42:23 -0400 Original-Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:53190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSCw1-0003Ig-GU for emacs-devel@gnu.org; Sun, 28 Aug 2022 03:42:22 -0400 Original-Received: by mail-pj1-x1044.google.com with SMTP id bg22so5252662pjb.2 for ; Sun, 28 Aug 2022 00:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc; bh=z6KJLAAy775qkJG9NVZszZaBxCgR/1zCrxcFzKhiBxo=; b=oz3SQ2z6DjrnyyrL2ZoCe9zKHImAJhKVcUJlk8cieEy2Cx5JJUKoAAdbBg5X0hQFR8 B6hH/qQqsyKPSdEkFPBChlzaIu/OLRnEWG469mTR9DvUuAfkIpAkAsrGZ9Gsa98D2H1b SFBKm5Yxqy3spLdpdfr6kHlEOHCXOAUJB6cz+j1JIHVfgYzXOsvhpnqlTc6DCSWnEQo/ oCP+v2i7Z+VkQwTdcFe+ghtRWPT8rOL+iuxstXN2aqy68XjoidjdWcTHkwU0SoQAqGS6 XXLdXVQigR4FalRmvPu76Zor5hVO/6DNRgMJz+DE2wtwBpds5n0tLEnKPFQbBpJzQ5qv yk+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc; bh=z6KJLAAy775qkJG9NVZszZaBxCgR/1zCrxcFzKhiBxo=; b=qupCFIKtX/iUQOdzObKSCm34qgbbyMPQpi3RX2nsX1DDlqrf3RoTHWP9IWlGFIQHlF mlVrBN49/B/3imDznbjfn51bxUraYzsdFBzNE4kyyrR7ij5S4o897/CfM9S9aqz8D5hk id0XSAluk6Jc1FDusUmfz7rb9az2w+e87WlV36WfuxYSiA50uiqBqznHICfi4nmxmBgE 0o5hR33T/N8xfHxmawVSBfN80lFYyU+TVvFbv5euB+9hp+yI3jXDCk41NoaBXqMHzBHD YrJ50d2/IHSW4yrjCv7/x0P+lz8YKXjUuNcGvcam1psu7kxX5NfcD/ziZkpBLuPzZ5jG VkYw== X-Gm-Message-State: ACgBeo1TS/Imc6Amp0VsVylpyTD088YMhsOjDJ4zSvB9V0uJpPK6C8Uy dEbpISDm06sSY+mnB+dXrvQ= X-Google-Smtp-Source: AA6agR65jSOTAwlbBcIKO7bXFD6Vd7H32/poWGpVVoEf0VRTHsdbsJx7bmBQ1KaAIJWTOQ/yf5hnKw== X-Received: by 2002:a17:902:bcc9:b0:16e:fde3:172f with SMTP id o9-20020a170902bcc900b0016efde3172fmr11651227pls.36.1661672538747; Sun, 28 Aug 2022 00:42:18 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d7-20020a170902654700b001641b2d61d4sm4812104pln.30.2022.08.28.00.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 00:42:17 -0700 (PDT) In-Reply-To: (Davin Pearson's message of "Sun, 28 Aug 2022 19:27:07 +1200") Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1044.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 28 Aug 2022 04:16:57 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294223 Archived-At: [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=86=E0=AE=95= =E0=AE=B8=E0=AF=8D=E0=AE=9F=E0=AF=8D 28, 2022] Davin Pearson wrote: > > I have written some code that makes the first line read-only: > > (save-excursion > (goto-char (point-min)) > (set-text-properties (point-at-bol) (point-at-eol) '(read-only t)) > ) > > When I try to remove all text-properties: > > (condition-case err > (save-excursion > (set-text-properties (point-min) (point-max) nil)) > (error > (message "dmp-error:err=3D%s" err))) > > It barfs with the following error message: > > dmp-error:err=3D(text-read-only) > > How do I go about removing the read-only property of the text? =E2=80=98read-only=E2=80=99 If a character has the property =E2=80=98read-only=E2=80=99, then modi= fying that character is not allowed. Any command that would do so gets an error, =E2=80=98text-read-only=E2=80=99. If the property value is a s= tring, that string is used as the error message. Insertion next to a read-only character is an error if inserting ordinary text there would inherit the =E2=80=98read-only=E2=80=99 prop= erty due to stickiness. Thus, you can control permission to insert next to read-only text by controlling the stickiness. *Note Sticky Properties::. Since changing properties counts as modifying the buffer, it is not possible to remove a =E2=80=98read-only=E2=80=99 property unless you k= now the special trick: bind =E2=80=98inhibit-read-only=E2=80=99 to a non-=E2= =80=98nil=E2=80=99 value and then remove the property. *Note Read Only Buffers::. >From (info "(elisp) Special Properties")