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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Okamsn <okamsn <at> protonmail.com>
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 10:01:36 -0400
> 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





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.