Subject: bug#9722: list-colors-duplicates does not exclude enough colors on Windows

From: Juanma Barranquero <[email-masked]>
Date: Mon, 17 Oct 2011 18:55:05 +0200

On Mon, Oct 17, 2011 at 18:41, Eli Zaretskii <[email-masked]> wrote:

> It doesn't sound TRT to me to use w32-default-color-map for the
> purpose of retaining some special colors in the list.

I doesn't seem TRT to me either. My proposed patch removed that
dependency. In fact, I believe that w32-default-color-map should be
declared obsolete, to be turned into an internal-only function in some
future release. There's no real point to have it exposed to elisp,
other than using it in list-colors-duplicates.

>  I think it
> would be cleaner to have a separate (much shorter) list of colors that
> should not be removed even if their RGB values are identical to other
> colors already present in the list produced by defined-colors.

We can add that list, but currently, only colors named System.* are in
that category. Checking for "^System" or populating that list are both
very ad hoc fixes for a very specific Windows problem.

> If you agree, let's create such a list, put it on w32-fns.el, and use
> it in facemenu.el.
>
> OK?

I'm not sure.

Pros:
- The new list could be expanded by the user (if exposed to elisp as a
list and not a function)
- It does not depend on the reserved colors all being called System.*

Contras:
- It does not remove the need for w32_color_map /
Fw32_default_color_map, because these have another use (default color
list in case etc/rgb.txt is not found).
- It adds a new function or variable and a bit of complexity, for what
is just filtering out a few colors.

    Juanma