GNU bug report logs - #73782
[PATCH] Add `delete-selection-local-mode'.

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Sun, 13 Oct 2024 02:05:02 UTC

Severity: wishlist

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Okamsn <okamsn <at> protonmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 73782 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#73782: [PATCH] Add `delete-selection-local-mode'.
Date: Thu, 24 Oct 2024 03:24:14 +0000
[Message part 1 (text/plain, inline)]
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
> 
> Have you tried to use the `:variable (buffer-local-value
> 'delete-selection-mode)` instead of introducing a parallel
> `delete-selection-local-mode` variable?
> 
> 
>          Stefan
> 

I had not thought to try that. Attached is a patch which uses 
`buffer-local-value` as a `setf`-able place. I had to include the third 
argument `(current-buffer)`.

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.

If you do think that the local version of the variable should be 
removed, do you think that it should be removed selectively or always?

Thank you.
[v3-0001-Add-delete-selection-local-mode.patch (text/x-patch, attachment)]

This bug report was last modified 264 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.