emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Tweaking t-m-m to make room for d-s-m


From: Drew Adams
Subject: RE: Tweaking t-m-m to make room for d-s-m
Date: Thu, 25 Mar 2010 16:56:31 -0700

> Here is how I see the situation:
> - The DEL part of d-s-m would be acceptable right now
>   (i.e. generalizing mouse-region-delete-keys to non-mouse-activated
>   regions).
> - The self-insert part of d-s-m is more problematic.  The main problem
>   being the regions that are active "because of t-m-m" rather than
>   because the user wanted to activate the region.
>
> AFAIK the first point is decided and I'm just waiting for someone to
> code it up.  [ The main reason why I like it is that I dislike the
> current implementation of mouse-region-delete-keys. ]
> 
> For the second point, it's a real problem.  Enabling self-insert
> d-s-m without addressing the problem will lead to frequent 
> annoyances for some usage patterns.  So, yes, we're back to
> discussing how to make t-m-m work right, so that the region is
> active iff the user wants it.

So much for the famous user poll. ;-)
 
> make C-SPC not activate the region (but let everything else
> activate it), so that the region is only active when the user
> really intended to activate it.

Inappropriate assumption about user intention. Why assume that a user never
intends to activate the region when s?he sets the mark using C-SPC? Sometimes I
do and sometimes I don't.

Setting the mark sets a navigation point, but it also sets one end of the region
(by definition). If you want to select everything from here to there, and there
is no ready command that does that (as does `C-M-@' for sexps, for example),
then you want to set the mark here, move point there, and have the region
activated. That's not an uncommon intention.

Currently, you can avoid activating the region by using C-SPC C-SPC instead of
C-SPC. And if you activate it and change your mind, you can use C-g to
deactivate it. Not good enough?

If you think C-SPC C-SPC is too much trouble, then switch the two: Let C-SPC set
the mark without activating the region and C-SPC C-SPC set mark and activate. I
could live with that, and I'll bet other d-s-moders could too.

If t-m-mode is off, C-SPC C-SPC currently activates the region temporarily (i.e.
without turning on t-m-mode). This change would just mean that C-SPC C-SPC
always activates.

But we can do better: Let users decide individually, by adding an option that
says whether a single or a double C-SPC activates the region. The default could
be either (double, if you like). That way, John Default can use C-SPC to set
mark without activating and use C-SPC C-SPC to set and activate. And Jane
Customize can use C-SPC to set and activate and C-SPC C-SPC to set without
activating.

Even better: The option could be defined so that one possible choice separates
the navigational use from the region use completely. One of the possible values
would thus mean that the key that sets mark and activates the region would not
push it to the mark ring.

For example, let the option value be a cons of two commands, the car being for
C-SPC and the cdr for C-SPC C-SPC. The commands could be chosen from these:

a. set mark and push to mark-ring  (do not activate)
b. set mark and activate  (do not push to mark-ring)
c. set mark, activate, and push to mark-ring

A value of (a . b) would mean C-SPC sets mark for navigation only and C-SPC
C-SPC uses it only for selection. A value of (c . a) would give today's
behavior; (a . c) would swap today's keys.

> One of the problems left with it is what to do for C-x C-x.

Why not leave it as is? If t-m-mode is on, it activates; if off, it doesn't. The
real concern, I think, is what happens when one uses C-SPC (see above).

Or if C-x C-x C-g is really too much trouble, then add an option for this too.

> we'd want two commands: one that swap point and mark, and one that
> activates the region.  Currently C-x C-x does both.

Only if t-m-mode is on.

> if we don't change C-x C-x, then users who want to
> navigate to the mark get the region activated when they 
> didn't want it.

Just use C-g (or whatever new key we choose for deactivation).

And if someone never uses the active region, then by definition she never needs
t-m-mode, and s?he can just turn it off.

> This C-x C-x issue can also be solved if we can come up with a short
> key-binding that activates the region (in which case C-x C-x doesn't
> need to activate the region).  Notice that we also have a need for
> a short key-binding to deactivate the region (one that has fewer
> side-effects than C-g, e.g. can be embedded in a keyboard macro).
> So maybe the answer to all this is to find a "short" key-binding that
> can toggle the region's active status.

Sure, why not? That would combine well with my suggestion above about C-SPC vs
C-SPC C-SPC. Let users choose the general behavior they want, and give them a
key to toggle the current active/inactive state. And set the default behavior to
whatever you want.

Do I have a great key in mind for activate/deactivate? Dunno. How about `C-z' or
`C-x C-z'? Does `suspend-frame' really need to be bound to both of those?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]