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: Sat, 26 Oct 2024 18:14:57 +0000 Message-ID: <036d33f0-f5fc-46f1-aadd-f9d6d8b17d0b@protonmail.com> References: Reply-To: Okamsn Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1=_zvKkaqHFdgH8AK1oB9DxKIzIt1LTx4Q5tdXWvlM0uOk" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20538"; 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 Sat Oct 26 20:15:57 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 1t4lKN-00059R-Is for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Oct 2024 20:15:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t4lJz-0000xu-1b; Sat, 26 Oct 2024 14:15:31 -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 1t4lJw-0000xR-Tx for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2024 14:15:28 -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 1t4lJw-0006X0-Li for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2024 14:15:28 -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=OHH4UYoesgZz4CEc8m55M7yttZYiaCY3CL8GQp06u2k=; b=qdcMMG6sr4EkPa9ctsd6ggV+bOtAl4y3Tl8fGMU01Zc5bi15fZAZfKJacUuS2iBu94mV3GdKw4jNu440YTlG39ywiRmyMFVmB+S4nQMEt29QZwyiYM5k0WOjOB3Hqrna4BC6sJgOETlo3OxMup2dhzruIxGnyMNYhGXwGpuvjKjprVrOEw4ssarUAxfcHUExqPpf4CUO0o541rvhd8l/n5ztBAApQu8nlnv/H7X5+o0Pf1Y2wImp6nj9Y2zXQwz7HVDFdvVQG0nBq7wjG5a0zGI/fcmKCtprQxPoeZpFQlp00oJ/MGcgkFP7LvGadrkkJGXFC25U1IbOFfID5Bo5qQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t4lKU-0002lx-95 for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2024 14:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Okamsn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2024 18:16: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.172996654610286 (code B ref 73782); Sat, 26 Oct 2024 18:16:02 +0000 Original-Received: (at 73782) by debbugs.gnu.org; 26 Oct 2024 18:15:46 +0000 Original-Received: from localhost ([127.0.0.1]:42550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4lKD-0002fj-44 for submit@debbugs.gnu.org; Sat, 26 Oct 2024 14:15:45 -0400 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]:56859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4lKA-0002fM-FF for 73782@debbugs.gnu.org; Sat, 26 Oct 2024 14:15:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1729966502; x=1730225702; bh=OHH4UYoesgZz4CEc8m55M7yttZYiaCY3CL8GQp06u2k=; 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=U6mgy7KHkb7ViXRFXoEsBP/avXRSLa13bFRgRlY23giwgHbwv8mHoviF6x19ec4+T ghlqGdRjH8GZwybpxvE2le/7zbav8zFoMKe8yqYxjUOhkyYpSddhfFE64/bMODxB4x VLzEYS8KiH0HPTaG1BfqsPkRoQzV4SsuPl9ScjUocXIoQO1h9CBzX2CIrAoaRgU3Vw qfKK+q7HfsijoMyhE38CMKoe90DqDox68HSiGksXe3NnVB94zEcUUcBdEfSLKh2B4z sSCn26E3Myb9o5jabvQXVjRxT67COM+6YBQ8h2HrVXxL+giOovAQbN6J7UPNuqcBCM FY0zBNja5UpGw== In-Reply-To: Feedback-ID: 25935600:user:proton X-Pm-Message-ID: 7093a993c6cc9d85dce4d76cbdafc569d9f64c68 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:294291 Archived-At: --b1=_zvKkaqHFdgH8AK1oB9DxKIzIt1LTx4Q5tdXWvlM0uOk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan Monnier wrote: >> Do you think that disabling the local mode should remove the >> buffer-local version of `delete-selection-mode` via >> `kill-local-variable`? It seems that once the variable is made buffer >> local, the global mode can't take effect in the buffer, even when the >> local mode is disabled. >=20 > In `electric-indent-local-mode` I faced the same question and wasn't > completely sure but I opted somewhat arbitrarily to do the > `kill-local-variable` whenever applicable. > I still don't know if it's the better choice, but FWIW, nobody's > complained about it: >=20 > (cond > ((eq electric-indent-mode (default-value 'electric-indent-mode)) > (kill-local-variable 'electric-indent-mode)) >=20 >> * lisp/delsel.el (delete-selection-pre-hook): Check whether local mode >> is active. >=20 > AFAICT you don't change `delete-selection-pre-hook` any more. >=20 >> * doc/emacs/mark.texi (Using Region): Describe >> delete-selection-local-mode. >> +;;;###autoload >> +(define-minor-mode delete-selection-local-mode >> + "Toggle Delete Selection mode in the current buffer. >> + >> +See the command `delete-selection-mode'. >=20 > FWIW, for `electric-indent-local-mode` I went for something shorter: >=20 > "Toggle `electric-indent-mode' only in this buffer." >=20 >=20 > - Stefan >=20 Hello, Please see the attached patch with the changes you suggested. Thank you. --b1=_zvKkaqHFdgH8AK1oB9DxKIzIt1LTx4Q5tdXWvlM0uOk Content-Type: text/x-patch; charset=UTF-8; name=v4-0001-Add-delete-selection-local-mode.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=v4-0001-Add-delete-selection-local-mode.patch RnJvbSA1MmQ4YWM0NzhlZjAxNWU2ODc1ZmFhNmUwYzc2ZGMzMDA5ZmE1OTYwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFYXJsIEh5YXR0IDxva2Ftc25AcHJvdG9ubWFpbC5jb20+CkRh dGU6IFNhdCwgMTIgT2N0IDIwMjQgMjA6Mjg6MjUgLTA0MDAKU3ViamVjdDogW1BBVENIIHY0XS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