From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73782: [PATCH] Add `delete-selection-local-mode'. Date: Thu, 24 Oct 2024 03:24:14 +0000 Message-ID: References: Reply-To: Okamsn Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1=_3HXbf8ttfixQVw2GbRkaE1cAqJVpxndZaCOQTc2BoY" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40341"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73782@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 24 05:25:01 2024 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 1t3oT6-000AKX-5S for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Oct 2024 05:25:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3oSg-0007wP-Tg; Wed, 23 Oct 2024 23:24:35 -0400 Original-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 1t3oSe-0007w2-QY for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2024 23:24:33 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3oSe-0007gx-HU for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2024 23:24:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=CmnVHhvZtXNHRqBIrkmbbi6YV2s+RgYPwXd2J8kkkb4=; b=h6cD4Rkm2VuKGW+Skil20+tZrmv4KncaG0Y81Fqtz2jgNtXOMK7ej50YoJjjskm+kRW763dThLvNlhjvRmcNfBq7Wxzw7Pox/LRqN+F7z9AT9f1AOs8mzX2nFX5AtCTUPifWmp8LspEf++SXepfmAcJ1R5nEEVD3Hhfg2r7ad97uC8yWibClGjU1atyHzDDWfiL1BlYTpCbFAhidDlHy7eyWuwEaBrvJm5J/0zbA2IUogbM5PN95P9sklE57xiHsGDnxs108pJzMhfj3eDFKmdF6rqhBGLZiMbKCA4urZErNXg3ZQvYzRCmy1W8BCeyJdTz1c3Lyqyew8sbLq/XP/Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3oT8-0000TA-9y for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2024 23:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Okamsn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2024 03:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73782 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73782-submit@debbugs.gnu.org id=B73782.17297402981786 (code B ref 73782); Thu, 24 Oct 2024 03:25:02 +0000 Original-Received: (at 73782) by debbugs.gnu.org; 24 Oct 2024 03:24:58 +0000 Original-Received: from localhost ([127.0.0.1]:33106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3oT3-0000Sj-G4 for submit@debbugs.gnu.org; Wed, 23 Oct 2024 23:24:57 -0400 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]:27829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3oT0-0000SS-DB for 73782@debbugs.gnu.org; Wed, 23 Oct 2024 23:24:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1729740256; x=1729999456; bh=CmnVHhvZtXNHRqBIrkmbbi6YV2s+RgYPwXd2J8kkkb4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=wc6crXjY/E7KvdX9LeAkMvBDqTYkuepUzmrIAFnLSdy92+g9kr4WjN+V95yzj+NdR /GIXcYF6Q3OTrKQzoyPNFmxorLybmLjIS9BDnqCNftIrpzJOVe+QTWpmzSTKXgSdVI zdwYrkB9xwX9ONphUWRx8s9i/KzkmYqaTByCPDpVSAruMleoxkW8PHAm9QoFu9AteK mxC0Clp8PDhjLe0Hpzbi9H4sLVRj4zS+6aXEGvi334XvzKxMOZJLYBHUjf/KuST8O7 uostmXl6O0tH8aXrNZJo9IjZi2Zhkcg3j/GsziKe9LBvIePbeXHrXkYULNhc9+BNSF 8tmA1ordFJhlg== In-Reply-To: Feedback-ID: 25935600:user:proton X-Pm-Message-ID: e95908f8e0c64f37cd72de7e8f80590fe6d334c3 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294162 Archived-At: --b1=_3HXbf8ttfixQVw2GbRkaE1cAqJVpxndZaCOQTc2BoY Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan Monnier wrote: >> +(define-minor-mode delete-selection-local-mode >> + "Toggle Delete Selection mode in the current buffer. >> + >> +See the command `delete-selection-mode'. >> + >> +For compatibility with features and packages that are aware of >> +`delete-selection-mode', this mode also sets the >> +variable `delete-selection-mode' in the current buffer." >> + :global nil :group 'editing-basics >=20 > Have you tried to use the `:variable (buffer-local-value > 'delete-selection-mode)` instead of introducing a parallel > `delete-selection-local-mode` variable? >=20 >=20 > Stefan >=20 I had not thought to try that. Attached is a patch which uses=20 `buffer-local-value` as a `setf`-able place. I had to include the third=20 argument `(current-buffer)`. Do you think that disabling the local mode should remove the=20 buffer-local version of `delete-selection-mode` via=20 `kill-local-variable`? It seems that once the variable is made buffer=20 local, the global mode can't take effect in the buffer, even when the=20 local mode is disabled. If you do think that the local version of the variable should be=20 removed, do you think that it should be removed selectively or always? Thank you. --b1=_3HXbf8ttfixQVw2GbRkaE1cAqJVpxndZaCOQTc2BoY Content-Type: text/x-patch; charset=UTF-8; name=v3-0001-Add-delete-selection-local-mode.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=v3-0001-Add-delete-selection-local-mode.patch RnJvbSA5MDAxMzFlZGI5MzM3YmVkM2I2MjRhODAyOTVjMmU5NWNiNzVlMjRkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFYXJsIEh5YXR0IDxva2Ftc25AcHJvdG9ubWFpbC5jb20+CkRh dGU6IFNhdCwgMTIgT2N0IDIwMjQgMjA6Mjg6MjUgLTA0MDAKU3ViamVjdDogW1BBVENIIHYzXSBB ZGQgZGVsZXRlLXNlbGVjdGlvbi1sb2NhbC1tb2RlLgoKKiBsaXNwL2RlbHNlbC5lbCAoZGVsZXRl LXNlbGVjdGlvbi1sb2NhbC1tb2RlKTogQWRkIGxvY2FsIHZlcnNpb24gb2YKZGVsZXRlLXNlbGVj dGl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