From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Okamsn <okamsn@protonmail.com>
Cc: 73782@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#73782: [PATCH] Add `delete-selection-local-mode'.
Date: Thu, 24 Oct 2024 10:01:36 -0400 [thread overview]
Message-ID: <jwvwmhx1ub0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <d55dcb93-4af4-42e0-839e-c5a23802bdd5@protonmail.com> (okamsn@protonmail.com's message of "Thu, 24 Oct 2024 03:24:14 +0000")
> 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
next prev parent reply other threads:[~2024-10-24 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-13 1:25 bug#73782: [PATCH] Add `delete-selection-local-mode' Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-13 5:38 ` Eli Zaretskii
2024-10-17 17:07 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-24 3:24 ` Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-24 14:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-26 18:14 ` Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-26 18:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwmhx1ub0.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=73782@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=okamsn@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).