unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@IRO.UMontreal.CA>,
	"'Juri Linkov'" <juri@jurta.org>
Cc: 'Andrew Helsley' <helsleya@cs.ucr.edu>, emacs-devel@gnu.org
Subject: RE: [PATCH] isearch: lazy-highlighting of sub-exps of regexps
Date: Tue, 23 Nov 2010 21:03:17 -0800	[thread overview]
Message-ID: <C0E043AFD3414C9AA9625C23A84907A4@us.oracle.com> (raw)
In-Reply-To: <jwv1v6b4f5d.fsf-monnier+emacs@gnu.org>

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

> > The most difficult question (as usual) is color selection
> > for sub-exps faces.  I think the most intuitive would be a rainbow.
> 
> Well, let's first install one of those patches and then see what
> improvements are needed.  So what matters is not really the color
> selection, but the cleanliness of the code so we can easily change the
> color selection.

The color selection is somewhat important, IMO.  Wrt this, have a look at the
coloring I use for this kind of thing in Icicles search.

Example:
http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#SearchHighl
ightingContextLevels (also attached)

I use 8 search-context levels, that is, 8 regexp group levels, with a different
face for each.  Past 8 levels the face sequence repeats.

One of the attached screenshots shows the 8 faces.  For a dark background mode,
there are corresponding dark colors.  In practice these colors work pretty well.
Note that there are two subsequences, the second one (levels 5-8) being a less
saturated (paler) version of the first one (levels 1-4).

The face (color) definitions are here:
http://www.emacswiki.org/emacs/icicles-face.el

Not sure what you had in mind by "cleanliness of the code so we can easily
change the color selection".  In my case, I use separate faces, so users can
easily customize them.

I picked the default colors by tweaking (using palette.el).  I picked the
dark-background colors by starting with the complements of the light-background
colors (and then modifying a bit, IIRC).  I probably got some user feedback on
the dark-background colors (I use a light background, myself), but I don't
remember.

HTH.

[-- Attachment #2: drew-emacs-icicle-search-context-levels.png --]
[-- Type: image/png, Size: 34935 bytes --]

[-- Attachment #3: drew-emacs-icicle-search-context-colors.png --]
[-- Type: image/png, Size: 11424 bytes --]

  reply	other threads:[~2010-11-24  5:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 10:38 [PATCH] isearch: lazy-highlighting of sub-exps of regexps Andrew Helsley
2010-11-23  0:59 ` Juri Linkov
2010-11-23 14:48   ` Stefan Monnier
2010-11-24  1:55     ` Juri Linkov
2010-11-24  2:43       ` Stefan Monnier
2010-11-24  5:03         ` Drew Adams [this message]
2010-11-25  1:39           ` Juri Linkov
2010-11-25  3:20             ` Drew Adams

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=C0E043AFD3414C9AA9625C23A84907A4@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=helsleya@cs.ucr.edu \
    --cc=juri@jurta.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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).