GNU bug report logs - #9722
list-colors-duplicates does not exclude enough colors on Windows

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Mon, 10 Oct 2011 22:51:01 UTC

Severity: minor

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 9722 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9722 <at> debbugs.gnu.org
Subject: Re: bug#9722: list-colors-duplicates does not exclude enough colors
	on Windows
Date: Tue, 11 Oct 2011 22:54:22 +0200
On Tue, Oct 11, 2011 at 21:39, Eli Zaretskii <eliz <at> gnu.org> wrote:

> What is the purpose of checking w32-default-color-map?  Is it solely
> for detecting the System* colors?

Well, I don't really know, but in that function that's the only thing
it is used for. revno:59445, which introduced list-colors-duplicates
and the use of w32-default-color-map, removed the following comment

    ;; Identify duplicate colors by the name rather than the color
    ;; value.  For example, on MS-Windows, logical colors are added to
    ;; the list that might have the same value but have different
    ;; names and meanings.  For example, `SystemMenuText' (the color
    ;; w32 uses for the text in menu entries) and `SystemWindowText'
    ;; (the default color w32 uses for the text in windows and
    ;; dialogs) may be the same display color and be adjacent in the
    ;; list.  Detecting duplicates by name insures that both of these
    ;; colors remain despite identical color values.

so it seems that was the only intention.

BTW, if we remove the call to w32-d-c-m from list-colors-duplicates,
its only use will be in w32fns.c:Fx_open_connection (to initialize
Vw32_color_map) and then it is no longer necessary to have it as a
lisp level function.

> That sounds an odd method of doing so.

Yes.

> It is also fragile: it means any color not in
> w32-default-color-map will pass the duplicate test.

Not sure what you mean with "pass the duplicate test". It means that
any color not in w32-default-color-map will never be considered
duplicate of another color.

> No, they aren't.  Don't you see the lines below?
>
>  dark slate gray       dark slate gray,dark slate grey,DarkSlateGray,DarkSlateGrey  #2f4f4f
>  dim gray              dim gray,dim grey,DimGray,DimGrey  #696969
>  slate gray            slate gray,slate grey,SlateGray,SlateGrey  #708090
>  light slate gray      light slate gray,light slate grey,LightSlateGray,LightSlateGrey  #778899
>  light gray            light gray,light grey,LightGray,LightGrey  #d3d3d3

Yes, I see them. That means that list-colors-duplicates is correctly
detecting them as duplicates:

ELISP> (list-colors-duplicates '("black" "dark slate gray" "dark slate
gray" "dark slate grey" "DarkSlateGray" "DarkSlateGrey"))
(("black")
 ("dark slate gray" "DarkSlateGrey" "DarkSlateGray" "dark slate grey"
"dark slate gray"))

Or am I missing something?

    Juanma




This bug report was last modified 13 years and 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.