unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@linkov.net>
Cc: Alan Mackenzie <acm@muc.de>, Lars Ingebrigtsen <larsi@gnus.org>,
	43702@debbugs.gnu.org
Subject: bug#43702: Emacs master: Incorrect highlighting in regexp isearch.
Date: Tue, 6 Oct 2020 15:40:43 -0700 (PDT)	[thread overview]
Message-ID: <f4a417d9-07c3-476c-bb8f-07f25e9f4533@default> (raw)
In-Reply-To: <87mu0z3zxf.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 3295 bytes --]

> > As I mentioned, it's simple to just repeat the use
> > of the same 8 faces, for 9-16, 17-24, etc.
> 
> This is a very good idea.  Now this is implemented in isearch.
>
> > I've added a third screenshot, where I did this:
> > recycle the faces of groups 1-5 for groups 9-13.
> 
> Yes, recycling is nice, this is what now is used in isearch.

Good to hear.

> You see?  So many problems when you tried to design
> a color palette for many isearch faces.

Did you say that before & I disagreed?  I don't think so.

(What I mentioned in my previous mail here was that I
didn't take into account that the foreground of face
`isearch' got used for all of the regexp-group faces,
because their default values didn't specify a foreground.)

> I suppose you agree that the previous color palette in
> isearch with a color gradient

I don't know what palette you're referring to, sorry.

> is not suitable for highlighting of group matches
> because while looking at highlighted matches it's quite impossible to
> say which color corresponds to which group number.
> I meant when colors looks like a heatmap, for example:

I'm not sure what to make of your heat-map image.
Is it supposed to show highlighting of regexps?
Certainly there are many, many fine gradations of
color in that image.

If your point is that it's hard to distinguish very
similar colors (e.g. your "-0.69" and "0.12"), then
yes, of course.

Your rainbow screenshot presumably is for matching
sequential regexp groups (again, not very typical).

It's OK, but it suffers from using a set of faces
with light and dark backgrounds.  The black foreground
is good against some of the backgrounds and bad against
others.

See attached, which are the faces I use by default
(for a light background mode).

The series runs first (groups 1-4) through different
pastel hues at the same saturation & value, and then
(groups 5-8) through the same series of hues but with
a lighter saturation & value (i.e., more pastel).

I think that helps, when trying to match regexp group
highlighting against group numbers.  There's only a
slight difference between the colors for the same hue
(different degrees of lightness), but it's pretty easy
to tell faces of different hue from each other.

I.e., it's easy to tell group 3 from groups 1, 2, and
4, and it's easy to tell 7 from 5, 6, and 7.  It's
harder to tell 3 from 7, but needing to do that will
be relatively rare.

> I started implementing group matches highlighting for lazy-highlight and also
> for query-replace, but then realized neither lazy-highlight nor query-replace
> need no such thing because this highlighting is only useful while
> incrementally constructing/inspecting a complex regexp for the current match
> in incremental isearch mode.

I don't agree, but won't argue about it.  I redefined
`replace-highlight' and `replace-dehighlight' so they
do highlight regexp groups, and I think it's helpful.

The same user option controls whether regexp groups
should be highlighted, for Isearch and replace:
`isearchp-highlight-regexp-group-levels-flag'.  And
you can toggle that during Isearch with `M-s h R'.

Anyway, thanks for working on this feature.  I think
it's helpful and will be welcome.

[-- Attachment #2: throw-isearch+-regexp-group-faces.png --]
[-- Type: image/png, Size: 72015 bytes --]

  reply	other threads:[~2020-10-06 22:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 12:13 bug#43702: Emacs master: Incorrect highlighting in regexp isearch Alan Mackenzie
2020-09-29 14:43 ` Eli Zaretskii
2020-09-29 15:33   ` Alan Mackenzie
2020-09-29 16:07     ` Eli Zaretskii
2020-09-30  2:08     ` Lars Ingebrigtsen
2020-09-30 19:16       ` Juri Linkov
2020-09-30 21:28         ` Drew Adams
2020-10-01 19:11           ` Juri Linkov
2020-10-01 19:38             ` Drew Adams
2020-10-01 22:41             ` Drew Adams
2020-10-06 20:01               ` Juri Linkov
2020-10-06 22:40                 ` Drew Adams [this message]
2020-10-07  8:13                   ` Juri Linkov
2020-10-07 15:42                     ` Drew Adams
2020-10-12 19:59                       ` Juri Linkov
2020-10-12 23:07                         ` Drew Adams
2020-10-13 20:14                           ` Juri Linkov
2020-10-13 20:54                             ` Drew Adams
2020-10-14  8:57                               ` Juri Linkov
2020-10-14 17:03                                 ` Drew Adams
2020-10-07  7:16                 ` Eli Zaretskii
2020-10-07  8:09                   ` Juri Linkov
2020-10-07  9:14                     ` Eli Zaretskii
2020-10-07 19:09                       ` Juri Linkov
2020-10-07 20:02                         ` Drew Adams
2020-10-07 20:22                           ` Juri Linkov
2020-10-07 20:56                             ` Drew Adams
2020-10-01  1:12         ` Lars Ingebrigtsen
2020-10-01 19:20           ` Juri Linkov
2020-10-01 19:23             ` Lars Ingebrigtsen
2020-10-01 19:26             ` Eli Zaretskii
2020-10-01 19:39             ` Drew Adams
2020-10-02  6:57               ` Juri Linkov
2020-10-06 20:17             ` Juri Linkov

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=f4a417d9-07c3-476c-bb8f-07f25e9f4533@default \
    --to=drew.adams@oracle.com \
    --cc=43702@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).