Subject: Re: bug#16822: 24.3.50; show-paren-mode adds confusion to active region

From: Eli Zaretskii <[email-masked]>
Date: Thu, 15 Jul 2021 09:53:08 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Thu, 15 Jul 2021 06:59:21 +0200
> Cc: [email-masked]
> 
> [email-masked] writes:
> 
> > When show-paren-mode is on, it adds confusion to the active
> > region. Suppose I have some text which is (hello),
> >
> > 1. I set the region to (hello and place the cursor on the left paren.
> > 2. I set the region to (hello) and place the cursor on the left paren.
> >
> > Note that in Case 1, the right paren is not part of the region while in
> > Case 2 it is. In the two cases above, I get exactly the same color on
> > the screen, then how can I distinguish between these two different
> > cases?
> 
> This is still the case in Emacs 28.  Whether I put the mark after the
> "o" or after the ")", and then go to the start of the line (in
> *scratch*), I get this displayed:
> [...]
> Perhaps the solution here is just to introduce a new face for parens
> that are part of the region?  Any opinions?

I admit that I don't understand the problem.  Why should the display
be different in these two cases?  It sounds like the (unspelled-out)
assumption is that showing the region is more important than showing
the (mis)matched parens?  But if this is the assumption, then I don't
think I agree: show-paren-mode is for _temporary_ display of the
parens, so if it temporarily obscures the region, it's perfectly okay.

Adding a new face would bump into the problem of making sure the
colors of this new face are always visible and distinguishable from
the other two colors.  I don't see how that could work reliably.