From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Subject: RE: Replacing huge hidden selection when pasting text
Date: Sat, 2 Jan 2016 19:10:36 -0800 (PST) [thread overview]
Message-ID: <4657a06c-58f8-44d7-89fe-34d5ff4e9d49@default> (raw)
In-Reply-To: <871t9zwgan.fsf@web.de>
> > > Apologies for not following this thread. But offhand I'd say that
> > > there's your problem right there: you enable `delete-selection-mode'
> > > but you disable `transient-mark-mode'. That should be a no-no.
> >
> > Oh my dear, I managed to hit a no-no! But if it's a no-no why is it
> > possible in the first place? Why ain't there a single warning? Where
> > are emacs's no-nos listed? Where is the checkbox and message saying "I
> > agree not to do any emacs no-no, even if I don't know what they are"?
> > Are you serious?
>
> I think there was much confusion in the thread, no doubt did the
> nihilistic tone of Alexandre inhibit a fruitful discussion.
>
> Drew only wanted to help. But I think he was wrong with what he said.
> I think it's ok to use the two modes at the same time. In the sentence
> Drew cited:
>
> When Delete Selection mode is enabled, Transient Mark mode is also
> ^^
> enabled, typed text replaces the selection if the selection is active,
> and DEL deletes the selection.
>
> I think there is an "and" missing, and the sentence means something
> different from what we thought.
In fact, until Emacs 24.4, `delete-selection-mode' explicitly turned
on `transient-mark-mode', and the doc string was as I quoted it (and
it was correct). No "and" was missing; t-m-mode was really enabled
by d-s-mode. Emacs 24.3:
(if (not delete-selection-mode)
(remove-hook 'pre-command-hook 'delete-selection-pre-hook)
(add-hook 'pre-command-hook 'delete-selection-pre-hook)
(transient-mark-mode t)) ; <=========
Starting with Emacs 24.4, d-s-mode no longer turns on t-m-mode.
> The current docstring (in my Emacs 25) says:
> When Delete Selection mode is enabled, typed text replaces the
> selection if the selection is active. Otherwise, typed text is just
> inserted at point regardless of any selection.
>
> With `transient-mark-mode' off, you can mark a region (i.e., turn on
> transient mark mode temporarily) by hitting C-SPC twice. Only then does
> delete-selection-mode replace the region. In any other case (when the
> region is not visible, i.e. not active) transient-mark-mode is just off,
> and delete-selection-mode should not delete the region, never.
I think you are right. This is not the original design of d-s-mode,
but was done when "temporary t-m-mode" was added (presumably precisely
to avoid the kind of gotcha that bit Alexandre).
> So I think the behavior he sometimes gets could indeed be a bug. Would
> be good to have a bug report, and it would be good if Alexandre would
> try to find a recipe so that we can find out what's going on (this could
> also be caused by some add on package) and fix the issue when necessary.
Agreed. (And maybe the doc string of `transient-mark-mode' should,
like the Emacs manual (node `Disabled Transient Mark'), mention
temporary activation of t-m-mode (via C-SPC C-SPC or C-u C-x C-x).
next prev parent reply other threads:[~2016-01-03 3:10 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-24 1:01 Replacing huge hidden selection when pasting text Alexandre Oberlin
2015-12-24 1:37 ` Drew Adams
2015-12-24 13:27 ` Alexandre Oberlin
2015-12-24 23:04 ` Stefan Monnier
2015-12-25 1:18 ` Pascal J. Bourguignon
[not found] ` <mailman.529.1451006347.843.help-gnu-emacs@gnu.org>
2016-01-02 21:40 ` Alexandre Oberlin
2016-01-02 22:03 ` Marcin Borkowski
[not found] ` <mailman.1550.1451772215.843.help-gnu-emacs@gnu.org>
2016-01-02 22:28 ` Alexandre Oberlin
2016-01-02 23:04 ` Drew Adams
[not found] ` <mailman.1551.1451775915.843.help-gnu-emacs@gnu.org>
2016-01-03 0:11 ` Alexandre Oberlin
2016-01-03 0:28 ` Michael Heerdegen
[not found] ` <mailman.1554.1451780942.843.help-gnu-emacs@gnu.org>
2016-01-03 0:41 ` Alexandre Oberlin
2016-01-03 1:07 ` Michael Heerdegen
2016-01-03 2:10 ` Robert Thorpe
2016-01-03 2:11 ` Drew Adams
2016-01-03 2:25 ` Michael Heerdegen
2016-01-03 3:10 ` Drew Adams [this message]
2016-01-03 3:21 ` Drew Adams
2016-01-03 4:09 ` Yuri Khan
2016-01-03 5:08 ` Random832
[not found] ` <mailman.1572.1451797753.843.help-gnu-emacs@gnu.org>
2016-01-13 17:13 ` Alexandre Oberlin
2016-01-14 14:07 ` Stefan Monnier
[not found] ` <mailman.2334.1452780465.843.help-gnu-emacs@gnu.org>
2016-01-14 15:35 ` Alexandre Oberlin
2016-01-14 16:11 ` Kaushal Modi
2016-01-14 17:20 ` Eli Zaretskii
2016-01-14 16:36 ` Michael Heerdegen
2016-01-14 16:41 ` Eli Zaretskii
[not found] ` <mailman.2341.1452787916.843.help-gnu-emacs@gnu.org>
2016-01-14 16:45 ` Alexandre Oberlin
2016-01-14 17:05 ` Kaushal Modi
2016-01-14 19:37 ` Stefan Monnier
[not found] ` <mailman.2359.1452800411.843.help-gnu-emacs@gnu.org>
2016-01-14 23:41 ` Alexandre Oberlin
[not found] ` <mailman.1570.1451794187.843.help-gnu-emacs@gnu.org>
2016-01-13 16:42 ` Alexandre Oberlin
2016-01-13 17:54 ` Yuri Khan
[not found] ` <mailman.2302.1452707668.843.help-gnu-emacs@gnu.org>
2016-01-14 13:57 ` Alexandre Oberlin
[not found] ` <mailman.1564.1451787927.843.help-gnu-emacs@gnu.org>
2016-01-13 17:26 ` Alexandre Oberlin
[not found] ` <mailman.528.1450998293.843.help-gnu-emacs@gnu.org>
2016-01-14 14:00 ` Alexandre Oberlin
2016-01-14 15:02 ` Stefan Monnier
2015-12-24 5:48 ` Pascal J. Bourguignon
2015-12-24 14:40 ` Andreas Röhler
2015-12-27 22:15 ` Robert Thorpe
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=4657a06c-58f8-44d7-89fe-34d5ff4e9d49@default \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
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).