GNU bug report logs -
#73782
[PATCH] Add `delete-selection-local-mode'.
Previous Next
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
Message #22 received at 73782 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
>
> 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:
>
> (cond
> ((eq electric-indent-mode (default-value 'electric-indent-mode))
> (kill-local-variable 'electric-indent-mode))
>
>> * lisp/delsel.el (delete-selection-pre-hook): Check whether local mode
>> is active.
>
> AFAICT you don't change `delete-selection-pre-hook` any more.
>
>> * 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'.
>
> FWIW, for `electric-indent-local-mode` I went for something shorter:
>
> "Toggle `electric-indent-mode' only in this buffer."
>
>
> - Stefan
>
Hello,
Please see the attached patch with the changes you suggested.
Thank you.
[v4-0001-Add-delete-selection-local-mode.patch (text/x-patch, attachment)]
This bug report was last modified 265 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.