emacs-devel
[Top][All Lists]
Advanced

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

Re: visual-region-mode?


From: Charles A. Roelli
Subject: Re: visual-region-mode?
Date: Mon, 24 Sep 2018 19:42:50 +0200

> From: hw <address@hidden>
> Date: Fri, 21 Sep 2018 22:28:53 +0200
>
> > There would be a way to "fortify" the region, if you had another
> > binding for toggling whether the region is active or not.
> 
> Without t-m-m, the region can not become active.

Yes, but since we have commands that offer behavior specific to active
regions, we have the so-called "temporary transient mark mode" --
which is a hack to get around this problem.  I'd rather have a way to
explicitly activate/deactivate the region.

> >> With t-m-m disabled, the region can not be activated, so why would I try
> >> to do that?  My function is ignorant of t-m-m anyway.
> >> 
> >> Why would I disable t-m-m only to ask to temporarily enable it?
> >
> > That's how the current implementation is designed: the region is
> > considered "active" when both "mark-active" is non-nil /and/ "t-m-m"
> > is on.
> 
> That doesn't explain why I would disable t-m-m.

No, it explains why you would temporarily enable it after disabling it
permanently.

> Perhaps there is a way to disable the highlighting.  I haven't found out
> how something is highlighted.

It's possible to disable the highlighting by customizing the "region"
face.

> > and without the region randomly deactivating itself after certain
> > commands as it does with "t-m-m" switched on.
> 
> [...]
>
> Are you referring to commands deactivating the region?  

Yes.  See the doc of "t-m-m":

            The mark is "deactivated" by changing the buffer,
and after certain other operations that set the mark but whose
main purpose is something else--for example, incremental search,
M-<, and M->.

>                                                         That could be
> configurable, though I'm not sure how useful it is to indefinitely do
> something with a region until it is explicitly deactivated.  

That's how the region works with "t-m-m" off: you can always invoke a
sequence of commands that use the region, without having to think
about whether it's active.  I'd like to be able to carry this behavior
over to commands that require an active region for certain things,
like M-% does for replacing inside a region.
 
> > Highlighting the region could be a separate mode.
> 
> Highlighting the region all the time is probably not very useful.

Yes, but the user knows best, IMO.  The default would still be the
same behavior as it is now.

> >> Are there any disadvantages of having t-m-m enabled that would overcome
> >> all the advantages of having it disabled?
> >
> > Not sure I understand this.
> 
> Disabling t-m-m doesn't make any sense at all.  Why would anyone disable
> it?
> 
> I can see it for someone who doesn't like the highlighting, so if it was
> configurable --- and it is amazing that is isn't --- whether to
> highlight the region when it's active or not, everyone who dislikes the
> highlighting could have t-m-m enabled.  I would remove having it
> disabled entirely from Emacs because there is no point in that and only
> complication.

I think the main point of contention is C-x C-x: it activates the mark
by default, which is irritating when you're using the mark for
navigation.  Even if you disable the highlighting of the region,
certain commands will behave differently in response to the region
being active.

You've already posted an improved version of C-x C-x that does not
activate the mark by default: I think that is the right way to go, as
well as a new command for explicitly activating/deactivating the mark.
With these two fixes, much of the contention surrounding "t-m-m"
should go.

> Without highlighting, a different indicator could be useful to show
> whether the region is active or not, like a hint in the mode line.

Yes, offering an indicator in the mode line to show whether the region
is active would be a good start.

Btw, I'm culling most of the CC list since it seems no longer relevant.



reply via email to

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