emacs-devel
[Top][All Lists]
Advanced

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

Re: delete-selection-mode as default


From: hw
Subject: Re: delete-selection-mode as default
Date: Thu, 13 Sep 2018 06:16:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

> Hello, hw.
>
> On Wed, Sep 12, 2018 at 00:34:11 +0200, hw wrote:
>> Drew Adams <address@hidden> writes:
>
>> Highlighting regions should be separated from whether they are active
>> or not, and I don't want hidden regions, either.
>
> I do.  I want point and mark, and the region between them to be regarded
> as "the" region.  That's it.  I currently (almost) have that option.

How do I get the region highlighted so I can see where it is?

>> Currently even when a region is not active (it is a hidden region
>> because it is not highlighted), you can do something with it, so users
>> always get an "active" region even when they don't want one.  It's only
>> a bit less active than it is when it is highlighted.
>
> As I've pointed out several times in the distant past, the terminology
> used for things in this part of Emacs is thoroughly suboptimal.  A region
> is never "active"; it never does anything, it is never an agent.  For
> example.

Maybe "workable" is a better term.

>> > [...]
>> > I suspect that things are very different for you, and I
>> > suspect it is because of `C-x C-x' activating the region
>> > even though you have no intention of acting on it.
>
>> Exchanging point and mark is a purely navigational thing, and somehow
>> the activation and deactivation of hidden(!) regions ....
>
> There's exactly one region, except when there's none (before the mark has
> been set in a buffer).

There shouldn't be one unless it's highlighted.  If highlighted, it
depends on how you consider it:  multiple regions, or still one region
which is non-consecutive.

>> .... which may have been modified because point may have moved since a
>> region was selected last time(!) has been mixed into that.  That is ill
>> advised.
>
> No, it's central and essential to how Emacs works.  There is ONE region,
> the part of the buffer between mark and point.  Let's not muck around
> with this.

Then how come I can't even see where the mark is, let alone the region?
Why is that not displayed?

>> > I feel like region activation by `C-x C-x' was maybe foisted
>> > on people who never wanted or expected to do anything
>> > with an active region.
>
>> Do you mean they would rather do things with hidden regions?  I never
>> want to do that.
>
> I do.  I don't want my region highlighted, ever.

Why not?  When highlighting screws up your syntax highlighting, maybe a
different way of highlighting could help.  Even only marking the fringes
of lines that are selected would be better than nothing.

How do you limit functions to a part of a buffer when you do not use
transient-mark-mode?

>> Right, so why not separate navigational functions from highlighting and
>> regions?
>
>> Use point and mark purely for navigation, set a selection-start-marker
>> with C-spc and a selection-end-marker with another C-spc (or whatever
>> key binding is appropriate for it).  The region is between these
>> markers, and you can have multiple regions in the same buffer.  Do
>> something with a region, and its markers are forgotten unless you use a
>> prefix.  Have a key binding to jump around between the regions in a
>> buffer, and you can tell Emacs with which of them you want to do
>> something by moving point into it.  If you want to do the same thing
>> with multiple regions, move point into one after another and make them
>> "sticky" for operation, or mark them right after selecting them.
>
>> That might make a lot of things much simpler, and we wouldn't have to
>> feel uneasy about the hidden regions all the time.
>
> Simpler?  You've got to be kidding!  Who really wants to have several
> regions, and why?  I think the times one would want several regions would
> be so rare as to be pure unjustified complexity.

One reason is visual indication.  I can set a register or a bookmark in
a buffer and never see it, or I can write 'FIXME:' comments which is
silly when I'm working on something so that it's gona be fixed anyway,
and hard to see --- or I could highlight the lines I'm concerned about
and need to look into.  If I could highlight parts, I could go through
the source and read it, which I do anyway, highlight the relevant places
and have it much easier to move around and to find things and not
overlook something.  It could be a big relieve because I don't need to
remember so much all at the same time because I could just see it
highlighted.

If it wouldn't screw up regions and do what ever hidden stuff, I might
even use the mark for navigation, so navigating would be easier in two
ways.

>> > [...]
>> > There you go. That's probably the right thing to do for
>> > someone who doesn't want d-s-m behavior. But then
>> > do you have to monkey around with temporary t-m-m,
>> > or do you just not bother, ever, with having an active
>> > region? I'm guessing the latter.
>
>> It can make it difficult to do things supposed to be limited to a
>> region.  I might disable t-m-m if I could see what I have selected with
>> it disabled and monkey.
>
> Monkey?

... around with temporary t-m-m to limit functions to selections.

> One of the uses of C-x C-x is to check what is currently in the region.
> Typically, you'd type it twice, to get back to your starting point.

Why would I?

>> I never use C-x C-x, so it doesn't make a difference otherwise, which
>> leaves nothing but disadvantages to having t-m-m disabled.
>
> There are many advantages to having transient-mark-mode disabled:
> primarily simplicity, and the severe reduction in the modal behaviour (in
> the sense of key sequences doing different things in things like vi's
> insert mode and command mode).  And I'm not happy having my font-locking
> splatted by the region's highlighting.

Any simplicity here is no more than a deceptive apparition.

It's not like I like transient-mark-mode, it's only the least evil.  The
concept of "the" region and having it all messed up with each other is
what's really evil.

I want my selection highlighted.  I'd also need to have regions and
selections decoupled from the navigation.  There's no sense in "the"
region.  I don't need a region to navigate.  I don't need a region for a
selection.  I need to navigate and to select, independently of each
other, and I especially don't need "the" lurking hidden region to screw
things up for me because it's coupled to everything.

> But everybody's different here, with different preferences, likes, hates.
> It's a mistake (which I've made quite a few times) to assume that
> "obvious" options in Emacs actually are obvious.

Is there anything obvious about Emacs? :)



reply via email to

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